I've writing a python script that coverts data to WKT. It works fine except it seems to assume that all source polygon layers are multipolygons, even if they aren't. The syntax is correct for multipolygon, but it seems that the data access module treats all shape@wkt commands and returns multipolygon even when the when the source data is a single polygon that doesn't participate in multipart geometry. Has anyone else noticed this?
Solved! Go to Solution.
This is one of those lost in translation moments. Esri doesn't implement a Polygon and Multipolygon, they implement a "Polygon" that is a Multipolygon. Esri's polygon can be single or multipart, but they treat them both the same for translating to OGC's WKT.
This is one of those lost in translation moments. Esri doesn't implement a Polygon and Multipolygon, they implement a "Polygon" that is a Multipolygon. Esri's polygon can be single or multipart, but they treat them both the same for translating to OGC's WKT.
Good to know - thanks Josh!
I meant to include the following in my original reply but had to step away. You can see what I am talking about by using three different ways to create an ArcPy Polygon and then return the WKT for all three:
>>> polys = [ ... arcpy.FromWKT("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))"), ... arcpy.FromWKT("MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)))"), ... arcpy.Polygon( ... arcpy.Array([ ... arcpy.Point(0, 0), ... arcpy.Point(1, 0), ... arcpy.Point(1, 1), ... arcpy.Point(0, 1), ... arcpy.Point(0, 0) ... ]) ... ) ... ] ... >>> for poly in polys: ... print poly.WKT ... MULTIPOLYGON (((0 0, 1 0, 1 1, 0 1, 0 0))) MULTIPOLYGON (((0 0, 1 0, 1 1, 0 1, 0 0))) MULTIPOLYGON (((1.0001220703125 0, 1.0001220703125 1.0001220703125, 0 1.0001220703125, 0 0, 1.0001220703125 0)))