1722 int type = GEOSGeomTypeId(geom);
1723 int SRID = GEOSGetSRID(geom);
1728 if (want3d && !GEOSHasZ(geom))
1730 LWDEBUG(3,
"Geometry has no Z, won't provide one");
1738 case GEOS_GEOMETRYCOLLECTION:
1739 LWDEBUG(4,
"lwgeom_from_geometry: it's a Collection or Multi");
1741 ngeoms = GEOSGetNumGeometries(geom);
1745 geoms =
lwalloc(ngeoms *
sizeof *geoms);
1748 lwerror(
"lwtin_from_geos: can't allocate geoms");
1751 for (i = 0; i < ngeoms; i++)
1753 const GEOSGeometry *poly, *ring;
1754 const GEOSCoordSequence* cs;
1757 poly = GEOSGetGeometryN(geom, i);
1758 ring = GEOSGetExteriorRing(poly);
1759 cs = GEOSGeom_getCoordSeq(ring);
1767 case GEOS_MULTIPOINT:
1768 case GEOS_MULTILINESTRING:
1769 case GEOS_MULTIPOLYGON:
1770 case GEOS_LINESTRING:
1771 case GEOS_LINEARRING:
1773 lwerror(
"lwtin_from_geos: invalid geometry type for tin: %d",
type);
1777 lwerror(
"GEOS2LWGEOM: unknown geometry type: %d",
type);
POINTARRAY * ptarray_from_GEOSCoordSeq(const GEOSCoordSequence *cs, uint8_t want3d)
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
LWTRIANGLE * lwtriangle_construct(int srid, GBOX *bbox, POINTARRAY *points)
void * lwalloc(size_t size)
#define SRID_UNKNOWN
Unknown SRID value.
#define LWDEBUG(level, msg)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.