I have GIS data in csv file format that describes polygons (administrative districts). There are four values: 1. Longitude 2. Latitude 3. Unique identifier 4. Text name of the administrative districts.
A polygon then is described in the following manner: Note the first vertex point is repeated at the end to indicate the extent of the polygon before a new polygon is described.
Can someone tell me, if it is possible, how to import these data into ArcGIS and create a polygon shape file? My ultimate objective is to calculate the area of district.
This ESRI article suggests several methods:
Note that some of the processes require higher level licenses and one solution requires a third-party software (ET Geowizards).
Chris Donohue, GISP
Here's a starting point using Python. This only reads your csv and outputs a polygon for all the points. It gets a little more complicated to create separate polygons for each ID, to write out all the attributes, etc.
>>> import csv # import csv library ... polys =  # list to hold polygon geometry ... with open(r'C:\junk\pointcsv.csv', 'rb') as csvFile: # open csv file ... csvFile.readline() # skip header ... csvReader = csv.reader(csvFile) # create csv reader ... polyPoints = arcpy.Array() # array to hold points ... for row in csvReader: # read csv ... polyPoints.append(arcpy.Point(row,row)) # create point and add to array ... polys.append(arcpy.Polygon(polyPoints,arcpy.SpatialReference(4326))) # create polygon and add to list ... arcpy.CopyFeatures_management(polys, r'in_memory\polys') # write out polygons
Unless you're committed to learning Python, your best bet is probably to add your csv as points, convert to line, then convert to polygon.
Thank you for the suggestions. I am not a Python and find it easier to use the built-in windows-driven tools.
When I use the "Points to Line" feature, what do I specify for "Line field" "Sort field" and "Close line" boxes? If I enter nothing, I then receive the error message when I try to draw the line layer/shapefile stating "a lock cannot be acquired".
What am I missing here? Thank you!
Line field is the field controlling the line IDs (tells the tool when to end the current line and move to the next line), Sort field sorts the records from first to last (if they aren't in the correct order already) and Close line forces the lines closed (if they aren't already).