Derive a new geometry with vertices added to ensure no vertex is more than max_seg_length (in radians) from any other vertex.
Derive a new geometry with vertices added to ensure no vertex is more than max_seg_length (in radians) from any other vertex.
Input geometry is not altered, output geometry must be freed by caller.
- Parameters
-
lwg_in | = input geometry |
max_seg_length | = maximum segment length in radians |
Definition at line 1743 of file lwgeodetic.c.
1747 LWPOLY *lwpoly_in, *lwpoly_out;
1759 switch (lwg_in->
type)
1773 for ( i = 0; i < lwpoly_in->
nrings; i++ )
1785 for ( i = 0; i < lwcol_in->
ngeoms; i++ )
1792 lwerror(
"lwgeom_segmentize_sphere: unsupported input geometry type: %d - %s",
1797 lwerror(
"lwgeom_segmentize_sphere got to the end of the function, should not happen");
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
int lwpoly_add_ring(LWPOLY *poly, POINTARRAY *pa)
Add a ring, allocating extra space if necessary.
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
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)
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
LWPOLY * lwgeom_as_lwpoly(const LWGEOM *lwgeom)
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
LWGEOM * lwgeom_segmentize_sphere(const LWGEOM *lwg_in, double max_seg_length)
Create a new, densified geometry where no segment is longer than max_seg_length.
static POINTARRAY * ptarray_segmentize_sphere(const POINTARRAY *pa_in, double max_seg_length)
Create a new point array with no segment longer than the input segment length (expressed in radians!...
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
References COLLECTIONTYPE, LWCOLLECTION::geoms, LINETYPE, lwcollection_add_lwgeom(), lwcollection_as_lwgeom(), lwcollection_construct_empty(), lwerror(), lwgeom_as_lwcollection(), lwgeom_as_lwline(), lwgeom_as_lwpoly(), lwgeom_clone(), lwgeom_clone_deep(), lwgeom_has_m(), lwgeom_has_z(), lwgeom_is_empty(), lwgeom_segmentize_sphere(), lwline_as_lwgeom(), lwline_construct(), lwpoly_add_ring(), lwpoly_as_lwgeom(), lwpoly_construct_empty(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, LWPOLY::nrings, LWLINE::points, POINTTYPE, POLYGONTYPE, ptarray_segmentize_sphere(), LWPOLY::rings, LWGEOM::srid, and LWGEOM::type.
Referenced by geography_segmentize(), lwgeom_segmentize_sphere(), test_geos_subdivide(), and test_lwgeom_segmentize_sphere().