Created
October 23, 2015 17:18
-
-
Save amarinelli/daad2cec74f4ad2f64db to your computer and use it in GitHub Desktop.
Search Cursor (arcpy)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from: http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/searchcursor-class.htm | |
import arcpy | |
fc = 'c:/data/base.gdb/well' | |
fields = ['WELL_ID', 'WELL_TYPE', 'SHAPE@XY'] | |
# For each row print the WELL_ID and WELL_TYPE fields, and the | |
# the feature's x,y coordinates | |
with arcpy.da.SearchCursor(fc, fields) as cursor: | |
for row in cursor: | |
print('{0}, {1}, {2}'.format(row[0], row[1], row[2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment