Definition at line 110 of file liblwgeom/lwgeom_geos.c.
References GEOS2LWGEOM(), lwalloc(), lwcollection_construct(), LWDEBUG, lwerror(), lwline_construct(), lwline_construct_empty(), lwpoint_construct(), lwpoint_construct_empty(), lwpoly_construct(), lwpoly_construct_empty(), ptarray_from_GEOSCoordSeq(), ptarray_to_GEOSCoordSeq(), SRID_UNKNOWN, and ovdump::type.
Referenced by convexhull(), GEOS2LWGEOM(), GEOS2POSTGIS(), GEOSARRAY2LWGEOM(), isvaliddetail(), lwgeom_buildarea(), lwgeom_centroid(), lwgeom_clip_by_rect(), lwgeom_delaunay_triangulation(), lwgeom_difference(), lwgeom_extract_unique_endpoints(), LWGEOM_GEOS_buildArea(), LWGEOM_GEOS_makeValid(), LWGEOM_GEOS_makeValidPolygon(), LWGEOM_GEOS_nodeLines(), lwgeom_geos_noop(), lwgeom_intersection(), lwgeom_linemerge(), lwgeom_make_valid(), lwgeom_node(), lwgeom_normalize(), lwgeom_offsetcurve(), lwgeom_sharedpaths(), lwgeom_snap(), lwgeom_symdifference(), lwgeom_unaryunion(), lwgeom_union(), lwgeom_voronoi_diagram(), lwline_split_by_line(), lwpoly_split_by_line(), and rt_raster_surface().
114 int SRID = GEOSGetSRID(
geom);
121 hasZ = GEOSHasZ(
geom);
124 LWDEBUG(3,
"Geometry has no Z, won't provide one");
139 const GEOSCoordSequence *cs;
141 const GEOSGeometry *g;
146 LWDEBUG(4,
"lwgeom_from_geometry: it's a Point");
147 cs = GEOSGeom_getCoordSeq(
geom);
148 if ( GEOSisEmpty(
geom) )
153 case GEOS_LINESTRING:
154 case GEOS_LINEARRING:
155 LWDEBUG(4,
"lwgeom_from_geometry: it's a LineString or LinearRing");
156 if ( GEOSisEmpty(
geom) )
159 cs = GEOSGeom_getCoordSeq(
geom);
164 LWDEBUG(4,
"lwgeom_from_geometry: it's a Polygon");
165 if ( GEOSisEmpty(
geom) )
167 ngeoms = GEOSGetNumInteriorRings(
geom);
169 g = GEOSGetExteriorRing(
geom);
170 cs = GEOSGeom_getCoordSeq(g);
172 for (i=0; i<ngeoms; i++)
174 g = GEOSGetInteriorRingN(
geom, i);
175 cs = GEOSGeom_getCoordSeq(g);
182 case GEOS_MULTIPOINT:
183 case GEOS_MULTILINESTRING:
184 case GEOS_MULTIPOLYGON:
185 case GEOS_GEOMETRYCOLLECTION:
186 LWDEBUG(4,
"lwgeom_from_geometry: it's a Collection or Multi");
188 ngeoms = GEOSGetNumGeometries(
geom);
193 for (i=0; i<ngeoms; i++)
195 g = GEOSGetGeometryN(
geom, i);
200 SRID, NULL, ngeoms, geoms);
203 lwerror(
"GEOS2LWGEOM: unknown geometry type: %d", type);
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
#define LWDEBUG(level, msg)
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
#define SRID_UNKNOWN
Unknown SRID value.
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
LWPOINT * lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point)
void * lwalloc(size_t size)
POINTARRAY * ptarray_from_GEOSCoordSeq(const GEOSCoordSequence *cs, char want3d)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.