Python in ArcGIS
Arc installs a special version of Python 6
- This version crashes JPype!
• ArcPy is supported by modules, including:
– A mapping module (arcpy.mapping)
– A Spatial Analyst module (arcpy.sa) to support map algebra
– A Geostatistical Analyst module (arcpy.ga)
arcpy.env – environments
arcpy.env.workspace
arcpy.env.outputCoordinateSystem
arcpy.env.extent
arcpy.env.cellSize
arcpy.env.mask
Sample:
# ~~~ PYTHON CODE ~~~
importarcpy
# Set the workspace
arcpy.env.workspace = "c:/st_Johns/GISData.gdb"
# ExecuteGeoprocessing tool
arcpy.Intersect_analysis(["roads","urban_area","urban_roads",
5, "join")
ESRI training:
Intro to Python:
- Video-based free training
http://training.esri.com/acb2000/showdetl.cfm?DID=6&Product_ID=971
Extending ArcGIS with Python:
- Good resource for programmers with some Python experience or significant experience with another language (i.e. VBA in ArcGIS 9)
http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=E659B67B-1422-2418-A0FE-4F1642052299
4.17 Python and ArcGIS
- Accessing ArcGIS functions from Python
- batch processing
- access geodatabases?
- animation?