arcgis tips / tricks & tools - esri cis
TRANSCRIPT
1
ArcGIS Tips / Tricks & Tools
An assortment of everyday usable stuff that may increase your productivity or just make others say… WOW!
we believe in making use of what others will let us borrow - we don't
have programmer resources available often, or for gis projects, so much of what we
do is 'borrowed' or out of the box or modified from existing code. there are lots of
things you can do with existing resources, things to make doing the gis activities
you need to do easier for repetitive tasks, and that with a little know-how and
resourcefulness there is a whole lot more potential to GIS that you can offer your
employer.
Everyone has ‘things’ they take pride in, maybe they made something themselves
or got a group of people using. Often they improve productivity while using existing
resources.
2
Presenters?
• Bryan Townsend
– GIS Administrator, York County, SC
• Brad Barnell
– GIS Manager, Greenwood County, SC
• Shane Sprouse
– GIS Analyst, Greenwood County, SC
• Sandra Ellenberg
– GIS Analyst, Greenwood County, SC
3
Blogs? (lots of info nuggets here)
• http://gismatters.blogspot.com/ (david maguire)
• http://www.spatiallyadjusted.com/links/ (Brian Goldin)
• Getting Started with GeoChat – Richie Carmichaelhttp://spaces.msn.com/members/MrRichie/
• http://slashgeo.org
• (like the slashdot.org website “news for nerds, stuff that matters,” but with geospatial twist)
Why read blogs? Latest in GIS happenings; news, product reviews/issues, ways to use gis
There are numerous ESRI Staff blogs. David Maguire (esri Director of products)
SpatiallyAdjusted – links to other blogs -
More GIS/ESRI Staff Blogs….
4
Places to start when you need help
• Arcscripts.esri.com – extensions, scripts
• Support.esri.com – forums, downloads
• Edn.esri.com -- ESRI Developer Network
• Google.com
Try searching support.esri.com when you have an issue. Someone has likely had
your same problem and posted how they fixed it. If you run into an issue where
nobody has posted, “pay it forward” when you resolve it by posting how you solved
your issue.
5
Other Resources (tips)
• KesslerGIS.com Tips and Tricks
• Connecting to an Excel Table for use in
ArcCatalog and ArcMap (*out-of-box @ 9.2)
• Recover your identify results window or any other
window that has accidentally gotten moved off
your screen
When researching tips and tricks for this session I knew we would present what we
knew well and were already using. There are a few others who have put together
materials similar to this and the next few slides provides a ‘summary’ of these
tips/tricks that were discovered.
6
Other Resources (tips)
• Vermont Center for Geographic Information
• ArcGIS and Tech tips
• Lots of ArcScript suggestions, some tips and tricks
(location of normal.mxt, calculating field tips), a
listing of free tools & other tools
http://www.vcgi.org/techres/?page=./white_papers/techtips/ArcGISTips.cfm
7
Other Resources (tips)
• ESRI Wisconsin User Group (EWUG)
• 2004 presentation “ArcGIS Tips and Tools”– Geoprocessing wizard toolbox, recognizing ArcInfo interchange
files, working with tables, generating a report, common calculation formulas using vbScript, Shortcuts, thumbnails
– cartography (transparency, clipping data frames, templates, printing/exporting maps)
– work performance tips (grouping layers, data frame focus, new layer visibility, cancel drawing, pausing the drawing in ArcMap,removing buttons, create graphic circle with specific radius, calculate area of graphic in ArcMap, count features within graphic area),
http://www.ewug.org/images/2004/ArcGISTipsAndTools.pdf
8
Other Resources (tips)
• Utah AGRC – Tips and Tricks (technical document section)
• About Fields in the ArcGIS 9.0 Geodatabase
– Field definition, field name, field types, issues with
loading and exporting data (using the simple data
loader, exporting from pGDB to shapefile)
• http://agrc.its.state.ut.us/agrc_gistraining/tipstricks/tipsdata/ArcGIS9_Fields.pdf
9
Where did we find it?
Key for Tips and Tricks
• (O) - Out-Of-The-Box
• (A) - ArcScripts
• (H) - Home Grown
• (S) - Support.esri.com / edn.esri.com
• (C) – ESRI Class
• Level of Difficulty or User Experience Needed
10
Overview
1. (Brad) AXL File Hacks (Creating & Labeling a Major Roads Layer)
2. (Brad) Shareware JavaScript optimizer to reduce the size of an ArcIMS website
3. (Sandra) Parcel editing tools (line editing toolbar, zipper task, map book)
4. (Shane) TerraserverGP download tool
5. (Shane) Multiversion Spatial view in RDBMS to display edits in the adds table
6. (O) Change Data Source of ArcMap Doc. / Find & Replace Pathnames
7. (O) Why Download…Share using ArcIMS!
8. (S) ArcIMS Performance: Analyze Log Files
9. (A) Log Concurrent License Use
10. (C) Export all Layer Files from ArcMap using simple VBA
11. (H) Organize Data by Layers
12. (S) Archive Data Model: All deleted features archived in a history FeatureClass
13. (H) Set up a Spatial View in your RDBMS: Take advantage of hyperlinking
14. (O) Custom ArcPad data collection using Out-of-the-Box Geodatabase Design
15. (A) Geodatabase Diagrammer
16. (A) NPS Metadata tools
17. (O) System Monitoring with Big Brother/Hobbit
Lots of tips / tricks and tools here. Way more than advertised in the title of the session. This ppt will
be posted on the ineternet.
A few more not included –
• (A) - download and use xTools Pro, it has many free tools you don’t have to pay for. Delete
fields, calculate acres.
• (O) – Package data with ArcPad or Disconnected editing toolbars. ArcPad toolbar extracts
images to MrSID files, both clip to extent and produce a map document retaining layer properties
including view extents and symbology.
• (H) – NPS Metadata Tools Extension, custom toolbar from nature.nps.gov that wraps up the
USGS mp.exe FGDC metadata parser and validator, allows you to spellcheck your metadata
with MS Office, lets you export to 5 different formats, and best of all is FREE.
• (S) Geocoding development kit –
• (A) TerraServerGP – Download DRG, DOQ or Urban Area imagery from MS TerraServer. Uses
extent of features in layer (county boundaries, makes individual images for each county
boundary). It is added as a tool in the Toolbox.
• (A) - GeoDatabase Reporter
• (C) - GeoDatabase Toolset
• (A)(0) – Build image catalog from a directory of images within ArcCatalog, use vb Replace()
function to remove the path and leave the file name in another field using ArcMap. replace(
[IMAGE] ,"G:\chester_orthos_sid_out\tiles_20\", "")
11
Creating a Major Road Layer
<LAYER type="featureclass" name="Major Roads" id="1" minscale="1:125000" maxscale="1:2000000">
<DATASET name="StreetCen" type="line" workspace="sde_ws-0" />
<SPATIALQUERY where="StreetClass = 1" searchorder="AttributeFirst" />
<GROUPRENDERER>
<VALUEMAPRENDERER lookupfield="StreetClass">
<EXACT value="1" label="Multi-Lane Hwy">
<SIMPLELINESYMBOL width="4" color="225,25,0" />
</EXACT>
</VALUEMAPRENDERER>
<VALUEMAPRENDERER lookupfield="StreetClass">
<EXACT value="1" label="Multi-Lane Hwy">
<SIMPLELINESYMBOL width="2" color="255,200,0" />
</EXACT>
</VALUEMAPRENDERER>
</GROUPRENDERER>
</LAYER>
Brad
12
Labeling Based on Area
<SCALEDEPENDENTRENDERER lower="1:9600" upper="1:35000">
<VALUEMAPLABELRENDERER lookupfield="Acres" labelfield="Name">
<RANGE lower="1000.0" upper="999999.0">
<TEXTSYMBOL font="Arial" fontsize="11" glowing="255,255,170" />
</RANGE>
<RANGE lower="10.0" upper="1000.0">
<TEXTSYMBOL font="Arial" fontsize="12" glowing="255,255,170" />
</RANGE>
</VALUEMAPLABELRENDERER>
</SCALEDEPENDENTRENDERER>
Brad
13
Labeling on a Predefined Scale Value
<SCALEDEPENDENTRENDERER lower="1:1200" upper="1:2400">
<VALUEMAPLABELRENDERER lookupfield="Scale"labelfield="Label">
<RANGE lower="100" upper="99999">
<TEXTSYMBOL font="Arial" fontsize="10" />
</RANGE>
</VALUEMAPLABELRENDERER>
</SCALEDEPENDENTRENDERER>
Brad
14
Compacting JavaScript Files
Brad
15
Compacting Options
Brad
16
Compacting Results
Brad
17
ARCGIS “NON-GURU” Tips
• Some of you may think the the ArcScripts and Developer’s Samples are just for the “Gurus”.
• Please explore the many options out there. You will be amazed at how easy these tools will be.
• Don’t be afraid to call ESRI support.
• Read the User forums.
• Other new User’s have the same questions.
• Bonus Tip For Attribute Transfer Added to this presentation.
18
Line Editing Toolbar:
• This set of code contains a toolbar with six commands for the editing of lines and three additional commands for displaying characteristics of lines (vertices, dangles, and directions). The purpose of the toolbar is to provide some additional functionality for editing of line work. Some of the commands are similar to what can be done with ArcEdit.
I missed the features of ArcEditing coverages when we changed to ArcGIS editing.
So I was glad to find a great toolbar that offered the things I had come accustomed
to using. This way I can turn on the vertices for my lines and see the directions etc.
Go to ESRI support http://arcscripts.esri.com/details.asp?dbid=13729 to download
this script (filename Line_Edit_Toolbar.zip).
19
Functionality in this toolbar includes:
• 1. Display vertices and end points.
• 2. Display directional arrows.
• 3. Display dangles.
• 4. Split at midpoint.
• 5. Divide lines.
• 6. Proportion lines.
• 7. Remove dangles.
• 8. Create intersections.
• 9. Flip Command.
20
21
Map Book
• We had a need in Greenwood County for a Map
Grid Book. Our first version was created with
AMLs. This Map Book script has been very helpful
in creating grid books for Law Enforcement, EMS,
Dispatch and even Public works uses.
• DS_Map_BookVisual_Basic creates a Map Series
that can be exported out to jpg or pdf.
We had a need in Greenwood County for a Map Grid Book. Our first version was
created with AMLs. This Map Book script has been very helpful in creating grid
books for Law Enforcement, EMS, Dispatch and even Public works uses.
This Map Book Developer’s Sample is found
ArcGIS\DeveloperKit\samples\Cartography\DS_Map_BookVisual_Basic.
Or there are a few new ones such as MapbookTool.zip online in ESRI ArcScripts.
22
Map
Book
• Map books are
multi page
documents
based on a
dataset and an
index grid
representing the
pages.
23
Map
Book
• The Index grid
for a map book
represents how
the dataset set
should be divided
up for plotting at a
more workable
scale.
24
Map Book Toolbar
25
26
Zipper Task
• This sample allows features within a user specified tolerance to be snapped to the edit sketch.
• Using the sketch tool a polyline sketch is created. When the sketch is finished, a dialog appears asking for a tolerance and the layers to be adjusted.
This great editing tool Developer’s Sample is found in
ArcGIS\DeveloperKit\samples\Editing\Zipper_TaskVisual_Basic. When you have
lines or polygons that have gaps that need to closed, this tool will save the day.
27
Zipper Task
• Features from the specified layers that fall within the tolerance are then aligned to the geometry of the sketch.
• The Trace tool is used to create a sketch of the geometry in the feature, and the Zipper Task will then use this geometry to align the other features
28
29
Attribute Transfer Tool
• This sample puts selected features from a source to a destination layer.
• This dialog also lets you map attributes between the source and destination features.
30
These are defined in the Spatial Adjustment Attribute Transfer Mapping dialog, found under the Spatial Adjustment menu on the Spatial Adjustment toolbar.
Attribute Transfer Tool
31
How to use:
1.Open the Attribute Transfer Mapping dialog, from the Spatial Adjustment menu on the Spatial Adjustment toolbar.
2. Set source/target layers and desired field mapping.
32
•3. Select source features to be put into the target layer.
•4. Click from source to target and it will transfer data.
33
ArcSDE Multiversioned Views
• Allows you to create a DBMS “view” of a versioned table.
• Use: sdetable –o create_mv_view
• Useful for customized applications that don’t recognize geodatabase versioning. For example, a GIS website application that uses ArcIMS functionality to query the geometry from a feature class, but “bypasses” ArcIMS for the attribute query. The base table is queried directly in SQL Server using ADO.Net (We do this in Greenwood County to speed up searches on our website, which are slower using ArcIMS functionality)
• In the scenario above SQL Server has no specific “knowledge” of the delta tables (A & D) that are part of a versioned feature class. Any edits to the feature class attributes are stored in the delta tables and would not be returned by a query of the base table without compressing the geodatabase in ArcCatalog.
• In a multiversioned view a Select statement is stored that queries all records from the base table and joins them with the records from the delta tables (edits) in the current version.
This is not really a “trick” per say, however most users are probably little aware of it.
34
ArcSDE Multiversioned Views
• The multiversioned view allows all rows
from the base and delta tables that
represent a feature or features to be
returned transparently to the end user.
• This “trick” has worked well for Greenwood
because it significantly speeds up
parcel searching on our website and
allows us to display “live” edits there.
• See ESRI Technical Paper:
“Working with the Geodatabase Using SQL”
35
TerraServer
Geoprocessing Tool
• Download from arcscripts.esri.com
• Geoprocessing tool for downloading
DOQ’s and scanned USGS topo
quad maps from Microsoft’s
TerraServer website.
• Download imagery in
various resolutions depending
on what’s available in area of
interest.
• Can store imagery as a file-based
raster dataset or in a geodatabase
raster catalog
• Can use this tool in a script or model
Shane
TerraServer
DOQ Layer
“Read-Me” file is installed along with the tool which is very useful for configuring the
tool. It also lists known bugs.
36
TerraServer
Geoprocessing Tool
• Newest version of the tool includes an option to download
true color, high resolution (1/4 meter) orthos where available.
(larger urban areas)
• Input layer must have a spatial
reference. The tool will recognize
the spatial reference and the
imagery will be stored with that
reference
• Downloads based on
geographical extent of
input feature class or of
selected feature(s) in feature
class.
• Requires .NET Framework 1.1
and .NET ArcObjects support
“Urban Area” resolution available only in places like Atlanta, Seattle, etc.
37
TerraServer
Geoprocessing Tool
• Most recent version works as a geoprocessing tool in
ArcToolBox.
• Previous Version works only as a Toolbar inside
ArcMap. It allows downloads as a permanent Dataset
or as a temporary layer in ArcMap. Available in ArcGIS
8.x and 9.x (Download Tool)
The most recent version is the one that works as a geoprocessing tool, hence the
‘GP’. It can be accessed inside ArcCatalog or ArcMap.
It can also be scripted like all other tools in ArcToolBox.
Older version allows downloading as a permanent dataset or as a temporary layer
but only works as toolbar inside ArcMap.
Performance seems to be better with newer version
38
TerraServer
Geoprocessing Tool• DRG option – USGS topo quad data
downloaded at highest resolution available
39
TerraServer
Geoprocessing Tool• 1994 TerraServer DOQ’s displayed on York County’s ArcIMS website:
maps.yorkcountygov.com
York County example. They are displaying 1994 DOQ’s downloaded for York and
surrounding counties. Lower image shows property lines and streets overlaid on
the imagery
40
Change Data Source of ArcMap Doc.
Find & Replace Pathnames (1 of 2)
• ArcGIS 9 allows a user to replace pathnames in
batch, unlike in 8.x
• Ever moved data from one folder to another and
seen all those red ‘!’ next to all your layers ?
• Open ArcCatalog, Browse to the folder that
contains the .mxd you want to change pathnames
in, right click the .mxd, Select Set Data Source(s)
41
• A list of pathnames for associated data layers appears. You can choose a new data source for a single layer or multiple layers. A new .mxdreferencing the changed pathnames is created.
Change Data Source of ArcMap Doc.
Find & Replace Pathnames (2 of 2)
•**Does not work with sde connections very well, from my testing at least
•Don’t forget to use relative path names in the map document (file > map properties
> data source options > store relative path names)
42
Why Download…
Share using ArcIMS!
• All data in an ArcIMS website (orthos, contours, parcels, etc.) can be used in ArcMap by the following process:
1. Open ArcCatalog. 2. At table of content, under node "Internet Servers", click on "Add Internet server". 3. In the dialog, use "http://maps.yorkcountygov.com" as URL of server. 4. choose all services and get a list of map services. One map service you should see is named “yorkcogisonline“.
5. Click OK to add the server. 6. Expand the node, Open ArcMap and drag the "yorkcogisonline" to your ArcMap. 7. Turn on/off layers as needed.
Sometimes the map service may not be made available (acl file with password set,
web server configuration)
Most arcims services are unpublished. To find the service, use the website url
“maps.yorkcountygov.com”
Once added to arcmap, you can perform spatial and tabular queries on the
individual layers, albeit a little slow.
There is even a way to download the data to your computer from ArcMap !
43
Why Download…
Share using ArcIMS! (2 of 2)Three image services in the ArcMap TOC below;
maps.co.union.nc.us
maps2.co.mecklenburg.nc.us
maps.yorkcountygov.com
Examples of 3 ArcIMS web services in ArcMap (Union Co, Meck Co NC and York
Co, SC)
There are OGC extensions to enable connections to other OGC compliant map
servers (WMS, etc) (Minn Map Server)
our thought is to make the information available to everyone in this way – it’s the
best way for the tax payers to get the most bang for their buck.
44
ArcIMS Performance:
Analyze Log Files (1 of 4)
1. Script to turn on/off log files dynamically
(..\..\ArcIMS\Server\log\*.log)
2. Script to process log files and produce html page
with useful info. Must have Perl installed
www.perl.org, look for ‘Download Perl’
– you may have to install a perl module module or
‘extension’
– all of this is ‘FREE’
Interested in improving map performance?
Need to know what layers are drawing slowest?
Which layers or map services are getting used more?
2 steps (besides knowing a little about how arcims works, where the logfiles are
created, downloading and installing perl)
- execute the script to begin logging ArcIMS requests (next slide)
- download the perl script, execute the script (next slide)
45
ArcIMS Performance:
Analyze Log Files (2 of 4)
Run from the command prompt on ArcIMS server or
make a batch file containing this:java com.esri.aims.admincore.cmd.Exec http://server.domain.com username password cmd setlogs true
Note: to turn off logging, change the ‘true’ above to ‘false’.
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=20844
IIS or webserver can tell you what pages are accessed on your server –
This tells you layer specific information and resources required to render those
layers. Looking at this information you can improve performance (change
symbology, sde/rdbms indexes)
46
• Download and Install Perl then;
• “ArcIMS Spatial Server log file analyzer” from• http://support.esri.com/index.cfm?fa=downloads.samplesUtilities.viewSample&PID=43&MetaID=142
• Aimslogs.pl - analyzes your ArcIMS Feature Server, Image Server, and Query
Server log files for performance statistics and calculates average times, and
total requests and responses for each map service and layer.
• From a Command prompt or batch file;aimslogs.pl -html=outfiles\stats_logs_2005-11-14.html ".\logs_2005-11-14\*.log"
ArcIMS Performance:
Analyze Log Files (3 of 4)
47
ArcIMS Performance:
Analyze Log Files (4 of 4)
Interested in improving map performance? Need to know what layers are drawing
slowest?
Which layers or map services are getting used more?
(map service and its layer is listed along with hits and retrieval/search time)
48
Log Concurrent License Use
(1 of 3)
Set up a service that logs who uses concurrent licenses and for how long
• Ever wanted to know who was keeping licenses checked out so often? Are you trying to show justification for purchasing more licenses?
• What ESRI product is most popular with the users? When are your ESRI licenses in high demand? Where does the heaviest usage of ESRI licenses occur?
It will continuously monitor license useage and record pertinent information (UserName, ESRIProduct, Version, CheckOutTime, CheckInTime, HoursUsed) to a comma delimited text file. This output file can then be loaded into an application such as Microsoft Access or Excel for further compilation and analysis.
• Log License Use • http://arcscripts.esri.com/details.asp?dbid=14223
Watch Out!! This one is somewhat involved & technical to set up. This should be
every step.
49
Uses lmutil.exe, srvany.exe, instsrv.exe and custom program posted on
arcscripts.esri.com
(Files from Windows Server Resource Kit are included in zipped ArcScript download file)
.NET framework 1.1 is a separate download
Use: instsrv [new service name] [location of srvany.exe]
instsrv LogLicenseUse_localhost "C:\LogLicenseUse_localhost\srvany_setup\srvany.exe“
THEN alter a registry setting:• http://support.microsoft.com/kb/q137890/
Log Concurrent License Use
(2 of 3)
50
Once the service has been started it runs every 1 minute and pulls information from the license metering software.
lmutil lmstat -a -c @ArcGIS_License_Server
Then, you can load the output into Excel, Access or RDBMS for further analysis
User, Machine, Product, Version, CheckOut, CheckIn, HoursUsed
townsendb, mis-townsendb, Editor, 9.0, 10/25/2005 10:23:00 AM, 10/25/2005 10:26:00 AM, 0.05
townsendb, mis-townsendb, Spatial Analyst, 9.0, 10/25/2005 10:23:00 AM, 10/25/2005 10:26:00 AM, 0.05
langenj, pl-langenjo, ArcInfo, 9.0, 10/25/2005 12:21:00 PM, 10/25/2005 12:23:00 PM, 0.03
crimemapping, so-crimemapping, ArcInfo, 9.0, 10/25/2005 11:50:00 AM, 10/25/2005 12:26:00 PM, 0.6
Log Concurrent License Use
(3 of 3)
@ArcGIS_License_Server is the computer all the ArcGIS
Desktops check out a license from.
51
Organize Data with Layers
-Instead of connecting to an ArcSDE database and navigating through
Featuredatasets and featureclasses;
-The symbology is set, scale extents are set, layers have easily identifiable names,
they can be grouped by folders/sub-folders.
-Above: some folders and layer files found in our common S drive (available to both
city and county staff).
-Makes map making easier – finding data, symbolizing it is easier for first-time map
makers and convenient for those familiar.
-Users are encouraged to add to this collection of map layers, sharing their
creativity for others to use.
-We have 100’s of feature classes, many sql server databases, sql instances to
each database. Keeping up with all this from a user standpoint can be too much.
-Symbology can be stored, account information and named correctly in an easy to
find ‘folder view’
52
• Ever set up many layers in ArcMap perfectly and want them all saved out to layer files (without right clicking and saving each individually?)
• This VBA script does just this (see next few slides).
• York County and the City of Rock Hill staff have access to each other’s ArcSDE Geodatabases. We also have a shared network drive where layer files are available.
• As symbology or data evolves we can make a few changes and export out those layer files again. That way we both can make similar maps of the same information, spend less time on symbology and more on content.
Export all Layer Files from ArcMap
Sometimes you want to share the layer, or back up your layer settings to file – from
an arcmap document.
With both city and county staff looking for the geospatial resources, having layer
files in a directory makes finding what is needed and connecting easier. It also
makes explaining sde connections easier.
Between the two governments, we want a similar look for maps produced. Sharing
symbology keeps this uniformity and everyone appreciates not having to re-create
another's efforts.
53
• Open the Customize Dialogue
• Scroll down to UIControls
• Make New UIControl > UIButtonControl
• Double-Click to open VBA, paste the code here
Export all Layer Files from ArcMap
• Place this new button on a
toolbar by dragging and
inserting it somewhere.
• Close the Customize Dialog
and execute by clicking on
the new button.
This one is a bit more advanced since it requires an extra button to be added
through the customization dialogue, and also some VBA script to be copied and
pasted from the next slide.
54
Export all Layer Files from ArcMap
Using VBA
Private m_pMxDoc As IMxDocument
Private Sub UIButtonControl1_Click()
Set m_pMxDoc = ThisDocument
Dim pEnumLayers As IEnumLayer
Set pEnumLayers = m_pMxDoc.FocusMap.Layers
Dim pLayer As ILayer
Set pLayer = pEnumLayers.Next
Dim pgxlayer As IGxLayer
Dim pGxFile As IGxFile
Do Until pLayer Is Nothing
Set pGxFile = New GxLayer
Set pgxlayer = pGxFile
'
'change the line below:
pGxFile.Path = “C:\" & pLayer.Name & ".lyr"'
Set pgxlayer.Layer = pLayer
pGxFile.Save
Set pLayer = pEnumLayers.Next
Loop
MsgBox "all layers have been saved to: " & pGxFile.Path
End Sub
Private Function UIButtonControl1_Enabled() As Boolean
Set m_pMxDoc = ThisDocument
UIButtonControl1_Enabled = m_pMxDoc.FocusMap.LayerCount > 0
End Function
Public Sub AddMapSurrounds()
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
Dim pEnv As IEnvelope
Dim pId As New UID
Dim pMapSurround As IMapSurround
Set pMxDoc = ThisDocument
Set pActiveView = pMxDoc.PageLayout
Set pEnv = New Envelope
pEnv.PutCoords 7.5, 0.2, 8.5, 4
pId.Value = "esricore.Legend"
Set pMapSurround = CreateSurround(pId, pEnv, "Legend", pMxDoc.FocusMap, pMxDoc.PageLayout)
pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing
End Sub
Private Function CreateSurround(pId As UID, pEnv As IEnvelope, strName As String, _
pMap As IMap, pPageLayout As IPageLayout) As IMapSurround
Dim pGc As IGraphicsContainer
Dim pActiveView As IActiveView
Dim pMapSurroundFrame As IMapSurroundFrame
Dim pMapSurround As IMapSurround
Dim pMapFrame As IMapFrame
Dim pElement As IElement
Set pGc = pPageLayout
Set pMapFrame = pGc.FindFrame(pMap)
Set pMapSurroundFrame = pMapFrame.CreateSurroundFrame(pId, Nothing)
pMapSurroundFrame.MapSurround.Name = strName
Set pElement = pMapSurroundFrame
Set pActiveView = pPageLayout
pElement.Geometry = pEnv
pElement.Activate pActiveView.ScreenDisplay
pGc.AddElement pElement, 0
Set CreateSurround = pMapSurroundFrame.MapSurround
End Function
There are two text boxes on this slide, copy from one then paste into the vba
window, then copy from the other and paste just below the last line.
Note to change the line so that the files are exported to your directory.
55
Archive Data Model: All deleted
features archived in a history FC
• Whenever a feature is deleted it gets posted to another feature class with "_history" as its name. The editors don't see or notice anything when features are posted, no extra work on their part.
• Very simple to implement;
• Make a copy of each feature class you want to record history for, add some fields to each feature class, register a dll, edityour data
• Includes a ‘query by date’ tool that makes a definition query specifying features edited in a date range
Note: Sample specifies dll was compiled for use with an oracle database –we use with sql server, no changes made
http://support.esri.com/index.cfm?fa=downloads.dataModels.filteredGateway&dmid=38
56
Archive Data Model: All deleted
features archived in a history FC
• Applies to any layer where you want to track history
Note: didn’t work with annotation when I tried to set it up.
57
Set up a Spatial View in your
RDBMS: Take advantage of
hyperlinking
• Many GIS users have photos or reports they can
access over the internet or on their network using
ArcMap
• If your featureclass has a field in it that points to a
photo on the network or online document you can
use the hyperlink tool and access the information
through ArcMap by selecting the feature.
58
Set up a Spatial View in your
RDBMS: Take advantage of
hyperlinking
• Use sdetable -o create_view – just need a few basic fields
• Then edit the newly created view, for a url pointing to a parcel report it looks
something like this when adding a field that is auto-populated with the Tax ID field 'http://maps.yorkcountygov.com/gisonline/Reports/property_report.asp?layers=cobound;city;parcels;address;roads;regroads;watbod&tmid=' +
gis.TAXDATA_TB.TAXMAPID
• AS gisonlinereporturl
Hyperlink
tool
This one is for the folks comfortable with executing sde commands and modifying
views in an oracle or MS SQL Server database.
Instead of calculating fields whenever you update attributes, an RDBMS view can
concatenate information from fields and produce a URL on the fly.
59
Customized ArcPad data collection
from Out-of-the-Box Geodatabase
Design
• pick lists, calendar date menus, check boxes on
forms makes data entry (faster, easier, less room
to introduce error)
• You can get custom ArcPad forms by first
designing a Geodatabase (add featureclasses with
fields, subtypes, domains) (** see gdb diag slides)
• ArcMap has an ArcPad Toolbar used to “check-
out” and “check-in” shapefiles to a pGDB or eGDB
– This check-out process creates forms that help you
maintain the data integrity of the Geodatabase when
using ArcPad
60
Customized ArcPad data collection
from Out-of-the-Box Geodatabase
Design
Calendar menu
Choose from a
list of pre-defined
attributes
(numeric or text)
**Domains: see next slides, Geodatabase Diagrammer
Set field types to date for the calendar menu
A domain is assigned to a field to get a drop down list.
61
Geodatabase Diagrammer
SUBTYPES – *see next slide*
By choosing a subtype, domains in other fields become active
http://arcscripts.esri.com/details.asp?dbid=13616
This ArcCatalog command will create a visio diagram of your geodatabase. The diagram will
replicate the look and feel of the standard ESRI data model posters. You will have to move
things around and add descriptive text.
Example of a stormwater featureclass, the field names are listed along with their
data types, default value, domain assigned, length & text metadata description.
ALSO – the field with subtype is outlined and reference is made to the subtype
values. * see next slide.
62
Geodatabase
Diagrammer
Defining Subtypes allows you to take arcpad customization and data integrity to the
next level. The slide shows the subtypes from the featureclass just presented.
Each subtype chosen may have different domains designated for other fields. (*see
slide)
The example here shows that;
for pipe the material field has 3 values listed (RCP, PP, & MP),
for Open channel subtype no materials are listed (blank domain), for spillway outlet
subtype chosen more values are again listed,
for junction box subtype (another blank domain), and
for the other subtype materials include the combined domains for spillway and Pipe
(another domain here)
63
NPS Metadata tools
• Managing metadata can be a big task. The extension expands on existing functionality:
• Importing metadata – importing existing, batch import, or batch import parts of a template
• Exporting metadata – through MP
• Parsing and conversion – validating to FGDC standards – uses MP and err2html through ArcCatalog instead of command prompt.!!
• Editing metadata – tools to spell check, replace text
• Fix ArcGIS 8 errors introduced
I have been told that it works with metadata in ArcSDE
64
System Monitoring with Big
Brother/Hobbit
• www.bb4.org• Big Brother™ is a Web-
based systems and
network monitor. A
universal color-code
interface of "red is bad
and green is good"
allows anyone to
measure the health of a
network at a glance.
•
License (free for gov/edu if not monitoring e-commerce?)
Running on linux machine
Monitors ms sql server service, GIS Online, server room temperature,
CPU/processes % activev
Pages staff when something happens.
65
System Monitoring with Big
Brother/Hobbit
License (free for gov/edu if not monitoring e-commerce?)
Running on linux machine
Monitors ms sql server service, GIS Online, server room temperature,
CPU/processes % activev
Observe trends and history (day/month/year)
Cpu & processes used throughout day
Monitor server room heat, web pages (GIS Online)