I am creating very basic rectangular polygon using very basic a Python code
nCols,nRows=100,100
corners =[[0,0],[0,nRows],[nCols,nRows],[nCols,0],[0,0]]
p=arcpy.Polygon(arcpy.Array([arcpy.Point(*coords) for coords in corners]))
arcpy.AddMessage(p.area)
and this is a message
10000.0244140774
It seems that forced conversion to doubles is a reason, as described in ArcGIS 10 exports losing precision with large numbers
Who can please tell how to get more accurate result?
P.S. Polygon created in ArcView 3 using same coordinates has an area of 10000.0000
This is update on my original question. Slightly modified code:
nCols,nRows= 101, 101
corners =[[1,1],[1,nRows],[nCols,nRows],[nCols,1],[1,1]]
p=[arcpy.PointGeometry(arcpy.Point(*coords)) for coords in corners]
arcpy.CopyFeatures_management(p, "d:/rubbish/points.shp")
p=arcpy.Polygon(arcpy.Array([arcpy.Point(*coords) for coords in corners]))
arcpy.AddMessage(p.area)
produced correct answer(!). Area of polygon = 10000.
This is a relief, I don't have to write my own procedure in GIS to calculate area of the shape. What I don't like are coordinates of the points that makes this polygon:
