Last active
December 17, 2015 19:29
-
-
Save NPS-ARCN-CAKN/1cafe310c87f3af38e6c to your computer and use it in GitHub Desktop.
ArcPy: Access feature class data
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
import arcpy | |
import numpy | |
input = r"C:\Work\Waypoints.shp" | |
arr = arcpy.da.FeatureClassToNumPyArray(input, ('ident', 'Latitude', 'Longitude')) | |
for row in arr: | |
ident = row["ident"] | |
lat = row["Latitude"] | |
lon = row["Longitude"] | |
sql = "INSERT INTO MyTable(WaypointName,Lat,Lon) VALUES('" + str(ident) + "'," + str(lat) + "," + str(lon) + ");" | |
print sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment