Module 4: Geoprocessing
The image above displays that my script Mod4_BTims.py is working. The first step the code does is print out the "Adding XY coordinates to the shapefile...", it adds the XY points for the hospitals shapefile. It also prints the messages out from interpreter from when the code started and finishes, using GetMessages().
The next line of code executes a buffer analysis on the shapefile hospitalsXYpts.shp. The buffer extends to 1000 meters around the hospitals XY coordinates and also dissolves the hospital buffers into a single-feature layer. This line of code also uses the GetMessages() to get the start and end time of the code from the interpreter.
Process Summary Notes:
-It is recommended to use arcpy.env.workspace instead of
from arcpy import env followed by env.workspace.
-arcpy.<class>.<property>
-arcpy.<toolname>_<toolboxalias>(<parameters>)
-You can use the "\n" character to add a space
after each message, making messages easier to read.
No comments:
Post a Comment