1 / 41

Something cool … maps.google

Something cool … http://maps.google.com. Google Maps API. Live earthquake mapping http://earthquakes.tafoni.net/ Other cool Google Maps API examples :. More Google …. Search full text of books e.g. http://books.google.com/books?q=uml Calculator Search tips & Hidden features

jolene
Download Presentation

Something cool … maps.google

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Something cool … http://maps.google.com

  2. Google Maps API Live earthquake mapping http://earthquakes.tafoni.net/ Other cool Google Maps API examples:

  3. More Google … • Search full text of bookse.g. http://books.google.com/books?q=uml • Calculator • Search tips & Hidden features • Also look for Google Code, Drive & Translate

  4. Google Earth ( http://earth.google.com )

  5. MXD, Maps, Layers arcpy.mapping Classes

  6. Without opening ArcMap, wouldn’t it be nice to • Get or update • MapDocument (MXD) properties • e.g. title, keywords, relative path, author, etc • DataFrame properties • e.g. name, coordinate system, etc. • Layer properties • e.g. name, visibility, data source, symbology, etc. • Layout element properties • e.g. size, position, • Add, remove, move, and update layers • Save MXD or LYR to earlier version for distribution • Build PDF map books • e.g. Export to PDF or insert into existing PDF

  7. arcpy.mapping module

  8. Arcpy.mapping Classes & Functions

  9. MapDocument Properties

  10. MapDocument – Class / Function … NOTE: Disable background processing when using “CURRENT”

  11. Properties activeDataFrame (ro) activeView (rw) author (rw) credits (rw) dataDrivenPages (ro) dateExported (ro) datePrinted (ro) dateSaved (ro) description (rw) filePath (ro) hyperlinkBase (rw) relativePaths (rw) summary (rw) tags (rw) title (rw) Methods deleteThumbnail() findAndReplaceWorkspacePaths( find_workspace_path, replace_workspace_path, {validate}) makeThumbnail () replaceWorkspaces( old_workspace_path, old_workspace_type, new_workspace_path, new_workspace_type, {validate}) save () saveACopy( file_name, {version}) MapDocument Properties & Methods (ro) = read-only (rw) = read-write

  12. MapDocument.ActiveView

  13. DataFrame Properties

  14. Properties credits (rw) description (rw) displayUnits (rw) elementHeight (rw) elementPositionX (rw) elementPositionY (rw) elementWidth (rw) extent (rw) geographicTransformations (rw) mapUnits (ro) name (rw) referenceScale (rw) rotation (rw) scale (rw) spatialReference (rw) time (ro) type (ro) Methods panToExtent(extent) zoomToSelectedFeatures() DataFrame Properties & Methods

  15. Find DataFrames in MapDocument

  16. Layer Properties

  17. Find Layers in a DataFrame i.e. All layers in all DataFrame’s

  18. Layer Class / Function Layer Class Layer Function

  19. Properties brightness (rw) contrast (rw) credits (rw) datasetName (rw) dataSource (rw) definitionQuery (rw) description (rw) isFeatureLayer (ro) isGroupLayer (ro) isRasterizingLayer (ro) isRasterLayer (ro) labelClasses (rw) longName (ro) name (rw) serviceProperties (ro) showLabels (rw) transparency (rw) visible (rw) workspacePath (ro) Methods findAndReplaceWorkspacePath( find_workspace_path, replace_workspace_path, {validate}) getExtent( {symbolized_extent}) getSelectedExtent( {symbolized_extent}) replaceDataSource( workspace_path, workspace_type, dataset_name, {validate}) save () saveACopy( file_name, {version}) supports( layer_property) Layer Properties & Methods Layer = • .lyr file • Layer in DataFrame Selected properties

  20. Finding a specific layer in a DataFrame

  21. Working with Layers • arcpy.mapping can’t • Create new map layers in DataFrame or .lyr files from scratch • Change all layer properties in a script • arcpy.mapping can • Add lyr file to DataFrame & change selected layer properties • dataSource, definitionQuery, etc. (see “(rw)” on previous slide) • Apply symbology from existing lyr files to existing layers in DataFrame

  22. Adding a Layer to a DataFrame

  23. Managing Layers in a DataFrame

  24. Fixing broken data sources

  25. Methods for fixing broken data sources MapDocument.findAndReplaceWorkspacePaths(find_workspace_path, replace_workspace_path, {validate}) MapDocument.replaceWorkspaces(old_workspace_path, old_workspace_type, new_workspace_path, new_workspace_type, {validate}) Layer.findAndReplaceWorkspacePath(find_workspace_path, replace_workspace_path, {validate}) Layer.replaceDataSource(workspace_path, workspace_type, dataset_name, {validate}) TableView.findAndReplaceWorkspacePath(find_workspace_path, replace_workspace_path, {validate}) TableView.replaceDataSource(workspace_path, workspace_type, dataset_name, {validate})

  26. Fixing broken data source examples Update all workspace paths to new folder and save to new mxd. Update all workspace paths for all the mxd’s in a folder from local system to UNC paths

  27. Page Layout elements

  28. Getting Page Layout Elements

  29. MapSurround Element

  30. Text Element

  31. RefreshActiveView() and RefreshTOC() After changing the content of a DataFrame or Page Layout … arcpy.RefreshActiveView() After changing items in the Table of Contents (add, remove, move, update layers) …arcpy.RefreshTOC()

  32. Exporting maps to images (jpg)

  33. Exporting maps to PDF

  34. PDFDocument’s

  35. Creating/Opening PDF Documents

  36. PDFDocument.appendPages Example

  37. Working with arcpy.mapping scripts • Python Window has nice help … but pain for defining/calling functions, debugging, etc. • Edit in PyScripter and use Load …

  38. Help is not perfect Should be: Find the MAPSURROUND_ELEMENT with the name "ScaleBar" and move it's x position (relative to its anchor point) to the center of the parentDataFrame.  Save this change to the MXD. Update: ESRI listened to me:

  39. MapDocument, DataFrame, Layer MapDocument MapDocument.ActiveView = “PAGE_LAYOUT” 1:* DataFrame DATAFRAME_ELEMENT MAPSURROUND_ELEMENT * GRAPHIC_ELEMENT Layer PICTURE_ELEMENT GRAPHIC_ELEMENT LEGEND_ELEMENT

More Related