Currently there are two ways to create an empty geometry (e.g. Polygon):
from shapely import wkt
from shapely.geometry import mapping, Polygon
# Method 1: using an empty constructor
g1 = Polygon()
print('{}, {}, {}'.format(mapping(g1), g1.geom_type, g1.wkt))
# {'type': 'Polygon', 'coordinates': ()}, GeometryCollection, GEOMETRYCOLLECTION EMPTY
# Method 2: loading empty WKT
g2 = wkt.loads('POLYGON EMPTY')
print('{}, {}, {}'.format(mapping(g2), g2.geom_type, g2.wkt))
# {'type': 'Polygon', 'coordinates': ()}, Polygon, POLYGON EMPTY
(all other geometry types behave the same way).
In both cases, the Python objects know they are Polygons based on the Python object type. However the GEOS objects (referenced by ._geom) are either GeometryCollection or Polygon, based on how the geometries were constructed. This seems inconsistent to me, as I'd expect the two methods to be identical.
Currently there are two ways to create an empty geometry (e.g. Polygon):
(all other geometry types behave the same way).
In both cases, the Python objects know they are Polygons based on the Python object type. However the GEOS objects (referenced by
._geom) are either GeometryCollection or Polygon, based on how the geometries were constructed. This seems inconsistent to me, as I'd expect the two methods to be identical.