1943 int type = GEOSGeomTypeId(geom);
1944 int SRID = GEOSGetSRID(geom);
1949 if (want3d && !GEOSHasZ(geom))
1951 LWDEBUG(3,
"Geometry has no Z, won't provide one");
1959 case GEOS_GEOMETRYCOLLECTION:
1960 LWDEBUG(4,
"lwgeom_from_geometry: it's a Collection or Multi");
1962 ngeoms = GEOSGetNumGeometries(geom);
1966 geoms =
lwalloc(ngeoms *
sizeof *geoms);
1969 lwerror(
"lwtin_from_geos: can't allocate geoms");
1972 for (i = 0; i < ngeoms; i++)
1974 const GEOSGeometry *poly, *ring;
1975 const GEOSCoordSequence* cs;
1978 poly = GEOSGetGeometryN(geom, i);
1979 ring = GEOSGetExteriorRing(poly);
1980 cs = GEOSGeom_getCoordSeq(ring);
1988 case GEOS_MULTIPOINT:
1989 case GEOS_MULTILINESTRING:
1990 case GEOS_MULTIPOLYGON:
1991 case GEOS_LINESTRING:
1992 case GEOS_LINEARRING:
1994 lwerror(
"lwtin_from_geos: invalid geometry type for tin: %d",
type);
1998 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.