1741 int type = GEOSGeomTypeId(geom);
1742 int SRID = GEOSGetSRID(geom);
1747 if (want3d && !GEOSHasZ(geom))
1749 LWDEBUG(3,
"Geometry has no Z, won't provide one");
1757 case GEOS_GEOMETRYCOLLECTION:
1758 LWDEBUG(4,
"lwgeom_from_geometry: it's a Collection or Multi");
1760 ngeoms = GEOSGetNumGeometries(geom);
1764 geoms =
lwalloc(ngeoms *
sizeof *geoms);
1767 lwerror(
"lwtin_from_geos: can't allocate geoms");
1770 for (i = 0; i < ngeoms; i++)
1772 const GEOSGeometry *poly, *ring;
1773 const GEOSCoordSequence* cs;
1776 poly = GEOSGetGeometryN(geom, i);
1777 ring = GEOSGetExteriorRing(poly);
1778 cs = GEOSGeom_getCoordSeq(ring);
1786 case GEOS_MULTIPOINT:
1787 case GEOS_MULTILINESTRING:
1788 case GEOS_MULTIPOLYGON:
1789 case GEOS_LINESTRING:
1790 case GEOS_LINEARRING:
1792 lwerror(
"lwtin_from_geos: invalid geometry type for tin: %d",
type);
1796 lwerror(
"GEOS2LWGEOM: unknown geometry type: %d",
type);
POINTARRAY * ptarray_from_GEOSCoordSeq(const GEOSCoordSequence *cs, uint8_t want3d)
void * lwalloc(size_t size)
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
#define SRID_UNKNOWN
Unknown SRID value.
LWTRIANGLE * lwtriangle_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
#define LWDEBUG(level, msg)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.