1684 int type = GEOSGeomTypeId(geom);
1685 int SRID = GEOSGetSRID(geom);
1690 if (want3d && !GEOSHasZ(geom))
1692 LWDEBUG(3,
"Geometry has no Z, won't provide one");
1700 case GEOS_GEOMETRYCOLLECTION:
1701 LWDEBUG(4,
"lwgeom_from_geometry: it's a Collection or Multi");
1703 ngeoms = GEOSGetNumGeometries(geom);
1707 geoms =
lwalloc(ngeoms *
sizeof *geoms);
1710 lwerror(
"lwtin_from_geos: can't allocate geoms");
1713 for (i = 0; i < ngeoms; i++)
1715 const GEOSGeometry *poly, *ring;
1716 const GEOSCoordSequence* cs;
1719 poly = GEOSGetGeometryN(geom, i);
1720 ring = GEOSGetExteriorRing(poly);
1721 cs = GEOSGeom_getCoordSeq(ring);
1729 case GEOS_MULTIPOINT:
1730 case GEOS_MULTILINESTRING:
1731 case GEOS_MULTIPOLYGON:
1732 case GEOS_LINESTRING:
1733 case GEOS_LINEARRING:
1735 lwerror(
"lwtin_from_geos: invalid geometry type for tin: %d",
type);
1739 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 void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.