Definition at line 390 of file liblwgeom/lwgeom_geos.c.
394 GEOSGeom* geoms = NULL;
397 #if LWDEBUG_LEVEL >= 4
413 GEOSGeometry* g =
LWGEOM2GEOS(lwgeom_stroked, autofix);
423 switch (lwgeom->type)
429 g = GEOSGeom_createEmptyPolygon();
432 #if POSTGIS_GEOS_VERSION < 38
434 g = GEOSGeom_createPoint(sq);
439 g = GEOSGeom_createPoint(sq);
444 g = GEOSGeom_createPointFromXY(p->
x, p->
y);
463 g = GEOSGeom_createLineString(sq);
470 g = GEOSGeom_createEmptyPolygon();
474 if (!shell)
return NULL;
475 ngeoms = lwpoly->
nrings - 1;
476 if (ngeoms > 0) geoms =
lwalloc(
sizeof(GEOSGeom) * ngeoms);
478 for (i = 1; i < lwpoly->
nrings; i++)
484 for (k = 0; k < i - 1; k++)
485 GEOSGeom_destroy(geoms[k]);
487 GEOSGeom_destroy(shell);
491 g = GEOSGeom_createPolygon(shell, geoms, ngeoms);
501 geostype = GEOS_MULTIPOINT;
503 geostype = GEOS_MULTILINESTRING;
505 geostype = GEOS_MULTIPOLYGON;
507 geostype = GEOS_GEOMETRYCOLLECTION;
512 if (ngeoms > 0) geoms =
lwalloc(
sizeof(GEOSGeom) * ngeoms);
515 for (i = 0; i < ngeoms; ++i)
525 for (k = 0; k < j; k++)
526 GEOSGeom_destroy(geoms[k]);
532 g = GEOSGeom_createCollection(geostype, geoms, j);
533 if (ngeoms > 0)
lwfree(geoms);
542 GEOSSetSRID(g, lwgeom->srid);
544 #if LWDEBUG_LEVEL >= 4
545 wkt = GEOSGeomToWKT(g);
546 LWDEBUGF(4,
"LWGEOM2GEOS: GEOSGeom: %s", wkt);
static GEOSGeometry * ptarray_to_GEOSLinearRing(const POINTARRAY *pa, uint8_t autofix)
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
GEOSCoordSeq ptarray_to_GEOSCoordSeq(const POINTARRAY *, uint8_t fix_ring)
void lwgeom_free(LWGEOM *geom)
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
POINTARRAY * ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
Add a point in a pointarray.
LWGEOM * lwgeom_stroke(const LWGEOM *geom, uint32_t perQuad)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_NDIMS(flags)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
void * lwalloc(size_t size)
int lwgeom_has_arc(const LWGEOM *geom)
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
References COLLECTIONTYPE, POINTARRAY::flags, FLAGS_NDIMS, free(), LWCOLLECTION::geoms, getPoint2d_cp(), getPoint_internal(), LINETYPE, LW_FALSE, lwalloc(), LWDEBUGF, lwerror(), lwfree(), lwgeom_free(), lwgeom_has_arc(), lwgeom_has_z(), lwgeom_is_empty(), lwgeom_stroke(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POINTARRAY::npoints, LWPOLY::nrings, LWPOINT::point, LWLINE::points, POINTTYPE, POLYGONTYPE, ptarray_addPoint(), ptarray_to_GEOSCoordSeq(), ptarray_to_GEOSLinearRing(), LWPOLY::rings, LWGEOM::srid, LWGEOM::type, POINT2D::x, and POINT2D::y.
Referenced by _lwt_CheckEdgeCrossing(), _lwt_FindFaceContainingRing(), _lwt_GetEqualEdge(), boundary(), isvalid(), lwgeom_buildarea(), lwgeom_centroid(), lwgeom_clip_by_rect(), lwgeom_delaunay_triangulation(), lwgeom_difference(), lwgeom_extract_unique_endpoints(), lwgeom_geos_noop(), lwgeom_intersection(), lwgeom_is_simple(), lwgeom_linemerge(), lwgeom_make_valid(), lwgeom_node(), lwgeom_normalize(), lwgeom_pointonsurface(), lwgeom_sharedpaths(), lwgeom_snap(), lwgeom_symdifference(), lwgeom_unaryunion(), lwgeom_union(), LWGEOMARRAY2GEOS(), lwline_offsetcurve(), lwline_split_by_line(), lwpoly_split_by_line(), lwpoly_to_points(), lwt_AddPolygon(), mvt_grid_and_validate_geos(), mvt_safe_clip_polygon_by_box(), POSTGIS2GEOS(), PrepGeomCacheBuilder(), rt_raster_compute_skewed_raster(), rt_raster_gdal_polygonize(), rt_raster_geos_spatial_relationship(), rt_raster_intersects(), and rt_raster_surface().