Definition at line 432 of file liblwgeom/lwgeom_geos.c.
436 GEOSGeom* geoms = NULL;
437 uint32_t ngeoms, i, j;
439 #if LWDEBUG_LEVEL >= 4
455 GEOSGeometry* g =
LWGEOM2GEOS(lwgeom_stroked, autofix);
462 switch (lwgeom->
type)
467 g = GEOSGeom_createEmptyPoint();
471 #if POSTGIS_GEOS_VERSION < 30800
473 g = GEOSGeom_createPoint(sq);
478 g = GEOSGeom_createPoint(sq);
483 g = GEOSGeom_createPointFromXY(p->
x, p->
y);
494 g = GEOSGeom_createEmptyLineString();
508 g = GEOSGeom_createLineString(sq);
518 g = GEOSGeom_createEmptyPolygon();
522 if (!shell)
return NULL;
523 ngeoms = lwpoly->
nrings - 1;
524 if (ngeoms > 0) geoms =
lwalloc(
sizeof(GEOSGeom) * ngeoms);
526 for (i = 1; i < lwpoly->
nrings; i++)
532 for (k = 0; k < i - 1; k++)
533 GEOSGeom_destroy(geoms[k]);
535 GEOSGeom_destroy(shell);
539 g = GEOSGeom_createPolygon(shell, geoms, ngeoms);
549 g = GEOSGeom_createEmptyPolygon();
554 if (!shell)
return NULL;
555 g = GEOSGeom_createPolygon(shell, NULL, 0);
568 geostype = GEOS_MULTIPOINT;
570 geostype = GEOS_MULTILINESTRING;
572 geostype = GEOS_MULTIPOLYGON;
574 geostype = GEOS_GEOMETRYCOLLECTION;
579 if (ngeoms > 0) geoms =
lwalloc(
sizeof(GEOSGeom) * ngeoms);
582 for (i = 0; i < ngeoms; ++i)
592 for (k = 0; k < j; k++)
593 GEOSGeom_destroy(geoms[k]);
599 g = GEOSGeom_createCollection(geostype, geoms, j);
600 if (ngeoms > 0)
lwfree(geoms);
612 GEOSSetSRID(g, lwgeom->
srid);
614 #if LWDEBUG_LEVEL >= 4
615 wkt = GEOSGeomToWKT(g);
616 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)
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)
Convert type with arcs into equivalent linearized type.
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
int lwgeom_type_arc(const LWGEOM *geom)
Geometry type is one of the potentially "arc containing" types (circstring, multicurve,...
#define FLAGS_NDIMS(flags)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void * lwalloc(size_t size)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
References COLLECTIONTYPE, POINTARRAY::flags, FLAGS_NDIMS, LWCOLLECTION::geoms, getPoint2d_cp(), getPoint_internal(), LINETYPE, LW_FALSE, lwalloc(), LWDEBUGF, lwerror(), lwfree(), lwgeom_free(), lwgeom_has_z(), lwgeom_is_empty(), lwgeom_stroke(), lwgeom_type_arc(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POINTARRAY::npoints, LWPOLY::nrings, LWPOINT::point, LWLINE::points, LWTRIANGLE::points, POINTTYPE, POLYGONTYPE, ptarray_addPoint(), ptarray_to_GEOSCoordSeq(), ptarray_to_GEOSLinearRing(), LWPOLY::rings, LWGEOM::srid, TINTYPE, TRIANGLETYPE, LWGEOM::type, POINT2D::x, and POINT2D::y.
Referenced by _lwt_CheckEdgeCrossing(), _lwt_FindFaceContainingRing(), _lwt_GetEqualEdge(), isvalid(), lwgeom_buildarea(), lwgeom_centroid(), lwgeom_clip_by_rect(), lwgeom_concavehull(), lwgeom_delaunay_triangulation(), lwgeom_difference_prec(), lwgeom_extract_unique_endpoints(), lwgeom_geos_noop(), lwgeom_intersection_prec(), lwgeom_is_simple(), lwgeom_linemerge_directed(), lwgeom_make_valid_params(), lwgeom_node(), lwgeom_normalize(), lwgeom_pointonsurface(), lwgeom_reduceprecision(), lwgeom_sharedpaths(), lwgeom_simplify_polygonal(), lwgeom_snap(), lwgeom_symdifference_prec(), lwgeom_triangulate_polygon(), lwgeom_unaryunion_prec(), lwgeom_union_prec(), LWGEOMARRAY2GEOS(), lwline_offsetcurve(), lwline_split_by_line(), lwpoly_split_by_line(), lwpoly_to_points(), lwt_AddPolygon(), POSTGIS2GEOS(), PrepGeomCacheBuilder(), read_geos_from_partition(), rt_raster_compute_skewed_raster(), rt_raster_geos_spatial_relationship(), rt_raster_intersects(), rt_raster_surface(), and topologypreservesimplify().