56 for (i=0; i<coll->
ngeoms; i++)
80 for (i=0; i < coll->
ngeoms; i++)
122 for (i=0; i<col->
ngeoms; i++)
131 if ( lwgeom == NULL )
return NULL;
140 if ( lwgeom == NULL )
return NULL;
149 if ( lwgeom == NULL )
return NULL;
158 if ( lwgeom == NULL )
return NULL;
167 if ( lwgeom == NULL )
return NULL;
176 if ( lwgeom == NULL )
return NULL;
185 if ( lwgeom == NULL )
return NULL;
194 if ( lwgeom == NULL )
return NULL;
203 if ( lwgeom == NULL )
return NULL;
212 if ( lwgeom == NULL )
return NULL;
221 if ( lwgeom == NULL )
return NULL;
239 return (
LWTIN *)lwgeom;
255 if ( obj == NULL )
return NULL;
260 if ( obj == NULL )
return NULL;
265 if ( obj == NULL )
return NULL;
270 if ( obj == NULL )
return NULL;
275 if ( obj == NULL )
return NULL;
280 if ( obj == NULL )
return NULL;
285 if ( obj == NULL )
return NULL;
290 if ( obj == NULL )
return NULL;
295 if ( obj == NULL )
return NULL;
300 if ( obj == NULL )
return NULL;
305 if ( obj == NULL )
return NULL;
359 box = ogeoms[0]->
bbox;
360 ogeoms[0]->
bbox = NULL;
424 lwerror(
"lwgeom_release: someone called on 0x0");
431 LWDEBUGF(3,
"lwgeom_release: releasing bbox. %p", lwgeom->
bbox);
446 LWDEBUGF(2,
"lwgeom_clone called with %p, %s",
449 switch (lwgeom->
type)
484 LWDEBUGF(2,
"lwgeom_clone called with %p, %s",
487 switch (lwgeom->
type)
527 lwerror(
"Error writing geom %p to WKT", lwgeom);
546 LWDEBUGF(2,
"lwgeom_same(%s, %s) called",
550 if ( lwgeom1->
type != lwgeom2->
type )
559 LWDEBUG(3,
" ZM flags differ");
565 if ( lwgeom1->
bbox && lwgeom2->
bbox )
570 LWDEBUG(3,
" bounding boxes differ");
577 switch (lwgeom1->
type)
607 lwerror(
"lwgeom_same: unsupported geometry type: %s",
620 if ( ! p || ! p->
point )
653 if ( lwgeom->
bbox )
return;
666 if ( ! ( gbox || lwgeom->
bbox ) )
671 else if ( gbox && ! lwgeom->
bbox )
681 for ( i = 0; i < lwcol->
ngeoms; i++ )
719 switch (lwgeom->
type)
814 for ( i = 0; i < col->
ngeoms; i++ )
844 for ( i = 0; i < col->
ngeoms; i++ )
860 for ( i = 0; i < col->
ngeoms; i++ )
880 if ( ! geom )
return 0;
901 if ( ! geom )
return 0;
933 for ( i = 0; i < ply->
nrings; i++ )
941 for ( i = 0; i < col->
ngeoms; i++ )
954 switch (lwgeom->
type)
972 for (i=0; i<poly->
nrings; i++)
986 for (i=0; i<coll->
ngeoms; i++)
990 lwerror(
"lwgeom_longitude_shift: unsupported geom type: %s",
1026 for ( i = 0; i < col->
ngeoms; i++ )
1103 if( ! lwgeom )
return;
1107 switch (lwgeom->
type)
1194 if( ! geom )
return 0;
1196 LWDEBUGF(4,
"lwgeom_count_vertices got type %s",
1228 lwerror(
"%s: unsupported input geometry type: %s",
1232 LWDEBUGF(3,
"counted %d vertices", result);
1245 if( ! geom )
return -1;
1247 LWDEBUGF(4,
"lwgeom_dimension got type %s",
1275 return ( closed ? 3 : 2 );
1281 for( i = 0; i < col->
ngeoms; i++ )
1284 maxdim = ( dim > maxdim ? dim : maxdim );
1289 lwerror(
"%s: unsupported input geometry type: %s",
1321 result = ((
LWPOLY *)geom)->nrings;
1334 for( i = 0; i < col->
ngeoms; i++ )
1342 LWDEBUGF(3,
"counted %d rings", result);
1349 LWDEBUGF(4,
"lwgeom_is_empty: got type %s",
1382 lwerror(
"lwgeom_is_empty: unsupported input geometry type: %s",
1401 int dimensionality = 0;
1402 for ( i = 0; i < col->
ngeoms; i++ )
1405 if ( d > dimensionality )
1408 return dimensionality;
1415 LWDEBUGF(3,
"lwgeom_dimensionality got type %s",
1449 lwerror(
"lwgeom_dimensionality: unsupported input geometry type: %s",
1458 LWDEBUGF(4,
"lwgeom_remove_repeated_points got type %s",
1499 lwnotice(
"%s: unsupported geometry type: %s",
1523 LWDEBUGF(4,
"lwgeom_flip_coordinates, got type: %s",
1542 for (i=0; i<poly->
nrings; i++)
1563 for (i=0; i<col->
ngeoms; i++)
1570 lwerror(
"lwgeom_swap_ordinates: unsupported geometry type: %s",
1576 if ( in->
bbox && (o1 < 2 || o2 < 2) )
1587 LWDEBUGF(4,
"entered with srid=%d",srid);
1595 for ( i = 0; i < col->
ngeoms; i++ )
1604 switch (igeom->
type)
1638 for ( i = 0; i < col->
ngeoms; i++ )
1657 double perimeter = 0.0;
1660 for ( i = 0; i < col->
ngeoms; i++ )
1679 double perimeter = 0.0;
1682 for ( i = 0; i < col->
ngeoms; i++ )
1701 double length = 0.0;
1704 for ( i = 0; i < col->
ngeoms; i++ )
1723 double length = 0.0;
1726 for ( i = 0; i < col->
ngeoms; i++ )
1755 for( i = 0; i < p->
nrings; i++ )
1762 for( i = 0; i < c->
nrings; i++ )
1771 for( i = 0; i < c->
ngeoms; i++ )
1806 for( i = 0; i < p->
nrings; i++ )
1813 for( i = 0; i < c->
nrings; i++ )
1822 for( i = 0; i < c->
ngeoms; i++ )
1874 lwerror(
"lwgeom_construct_empty: unsupported geometry type: %s",
1886 switch( lwgeom->
type )
1904 lwerror(
"int: unsupported geometry type: %s",
1914 switch ( lwgeom->
type )
1931 lwerror(
"lwgeom_grid: Unsupported geometry type: %s",
1945 const int maxdepth = 50;
1948 double width = clip->
xmax - clip->
xmin;
1949 double height = clip->
ymax - clip->
ymin;
1950 GBOX subbox1, subbox2;
1951 LWGEOM *clipped1, *clipped2;
1958 if ( width == 0.0 && height == 0.0 )
1976 for ( i = 0; i < incol->
ngeoms; i++ )
1986 if ( depth > maxdepth )
1994 if ( nvertices == 0 )
2000 if ( nvertices < maxvertices )
2006 subbox1 = subbox2 = *clip;
2007 if ( width > height )
2056 static int startdepth = 0;
2057 static int minmaxvertices = 8;
2066 if ( maxvertices < minmaxvertices )
2069 lwerror(
"%s: cannot subdivide to fewer than %d vertices per output", __func__, minmaxvertices);
2086 lwnotice(
"Geometry is not a LINESTRING");
LWMPOINT * lwgeom_as_lwmpoint(const LWGEOM *lwgeom)
LWCIRCSTRING * lwcircstring_grid(const LWCIRCSTRING *line, const gridspec *grid)
int lwgeom_calculate_gbox_geodetic(const LWGEOM *geom, GBOX *gbox)
Calculate the geodetic bounding box for an LWGEOM.
LWPOINT * lwpoint_force_dims(const LWPOINT *lwpoint, int hasz, int hasm)
int lwtriangle_is_clockwise(LWTRIANGLE *triangle)
int lwcollection_count_vertices(LWCOLLECTION *col)
LWGEOM * lwgeom_stroke(const LWGEOM *geom, uint32_t perQuad)
static int lwcollection_dimensionality(LWCOLLECTION *col)
int lwgeom_startpoint(const LWGEOM *lwgeom, POINT4D *pt)
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
LWPSURFACE * lwgeom_as_lwpsurface(const LWGEOM *lwgeom)
GBOX * gbox_new(uint8_t flags)
Create a new gbox with the dimensionality indicated by the flags.
void lwgeom_add_bbox_deep(LWGEOM *lwgeom, GBOX *gbox)
Compute a box for geom and all sub-geometries, if not already computed.
LWPOLY * lwpoly_clone_deep(const LWPOLY *lwgeom)
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
char lwpoint_same(const LWPOINT *p1, const LWPOINT *p2)
double lwcircstring_length(const LWCIRCSTRING *circ)
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
void lwgeom_scale(LWGEOM *geom, const POINT4D *factor)
LWGEOM * lwgeom_force_3dm(const LWGEOM *geom)
void lwgeom_drop_srid(LWGEOM *lwgeom)
void lwmline_free(LWMLINE *mline)
LWLINE * lwline_segmentize2d(LWLINE *line, double dist)
LWTRIANGLE * lwtriangle_construct_empty(int srid, char hasz, char hasm)
int lwline_count_vertices(LWLINE *line)
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
LWPOLY * lwpoly_simplify(const LWPOLY *ipoly, double dist, int preserve_collapsed)
LWLINE * lwline_clone(const LWLINE *lwgeom)
int lwtin_is_closed(const LWTIN *tin)
void ptarray_scale(POINTARRAY *pa, const POINT4D *factor)
Scale a pointarray.
double lwgeom_length(const LWGEOM *geom)
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
void lwcircstring_free(LWCIRCSTRING *curve)
void lwgeom_force_clockwise(LWGEOM *lwgeom)
Force Right-hand-rule on LWGEOM polygons.
#define FLAGS_GET_GEODETIC(flags)
Datum area(PG_FUNCTION_ARGS)
void lwtin_free(LWTIN *tin)
void lwpoint_free(LWPOINT *pt)
LWGEOM * lwgeom_clip_by_rect(const LWGEOM *geom1, double x0, double y0, double x1, double y1)
LWPOLY * lwgeom_as_lwpoly(const LWGEOM *lwgeom)
int lwgeom_ndims(const LWGEOM *geom)
Return the number of dimensions (2, 3, 4) in a geometry.
void lwgeom_longitude_shift(LWGEOM *lwgeom)
void lwline_free(LWLINE *line)
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
LWGEOM * lwgeom_segmentize2d(LWGEOM *lwgeom, double dist)
void lwgeom_swap_ordinates(LWGEOM *in, LWORD o1, LWORD o2)
Swap ordinate values in every vertex of the geometry.
int lwgeom_count_rings(const LWGEOM *geom)
Count rings in an LWGEOM.
double lwtriangle_perimeter_2d(const LWTRIANGLE *triangle)
#define FLAGS_GET_ZM(flags)
double lwcircstring_length_2d(const LWCIRCSTRING *circ)
LWTRIANGLE * lwtriangle_clone(const LWTRIANGLE *lwgeom)
#define LWDEBUG(level, msg)
double lwline_length_2d(const LWLINE *line)
void lwtriangle_reverse(LWTRIANGLE *triangle)
LWGEOM * lwmpoint_remove_repeated_points(const LWMPOINT *in, double tolerance)
int lwline_is_trajectory(const LWLINE *geom)
LWGEOM * lwmpoint_as_lwgeom(const LWMPOINT *obj)
#define POLYHEDRALSURFACETYPE
int lwgeom_count_vertices(const LWGEOM *geom)
Count points in an LWGEOM.
LWGEOM * lwgeom_simplify(const LWGEOM *igeom, double dist, int preserve_collapsed)
void lwtriangle_force_clockwise(LWTRIANGLE *triangle)
LWLINE * lwline_grid(const LWLINE *line, const gridspec *grid)
LWPOINT * lwpoint_grid(const LWPOINT *point, const gridspec *grid)
int lwcompound_is_closed(const LWCOMPOUND *curve)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
The old function nessecary for ptarray_segmentize2d in ptarray.c.
#define FLAGS_SET_GEODETIC(flags, value)
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
void lwpoly_force_clockwise(LWPOLY *poly)
LWTRIANGLE * lwgeom_as_lwtriangle(const LWGEOM *lwgeom)
double lwtriangle_area(const LWTRIANGLE *triangle)
Find the area of the outer ring.
int lwpoly_is_clockwise(LWPOLY *poly)
int lwgeom_is_closed(const LWGEOM *geom)
Return true or false depending on whether a geometry is a linear feature that closes on itself...
LWGEOM * lwpsurface_as_lwgeom(const LWPSURFACE *obj)
double lwtriangle_perimeter(const LWTRIANGLE *triangle)
char lwgeom_same(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2)
geom1 same as geom2 iff
void lwcircstring_reverse(LWCIRCSTRING *curve)
LWGEOM * lwtin_as_lwgeom(const LWTIN *obj)
char lwcollection_same(const LWCOLLECTION *p1, const LWCOLLECTION *p2)
check for same geometry composition
LWGEOM * lwgeom_remove_repeated_points(const LWGEOM *in, double tolerance)
Remove repeated points!
LWCOMPOUND * lwgeom_as_lwcompound(const LWGEOM *lwgeom)
int lwtriangle_is_empty(const LWTRIANGLE *triangle)
LWCURVEPOLY * lwgeom_as_lwcurvepoly(const LWGEOM *lwgeom)
LWCURVEPOLY * lwcurvepoly_construct_from_lwpoly(LWPOLY *lwpoly)
Construct an equivalent curve polygon from a polygon.
LWGEOM * lwcollection_remove_repeated_points(const LWCOLLECTION *in, double tolerance)
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep-clone an LWGEOM object.
void lwmpoly_free(LWMPOLY *mpoly)
void lwmpoint_free(LWMPOINT *mpt)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
LWGEOM * lwmpoly_as_lwgeom(const LWMPOLY *obj)
double lwgeom_area(const LWGEOM *geom)
char lwcircstring_same(const LWCIRCSTRING *p1, const LWCIRCSTRING *p2)
double lwgeom_perimeter(const LWGEOM *geom)
double lwcompound_length_2d(const LWCOMPOUND *comp)
int lwgeom_is_trajectory(const LWGEOM *geom)
Return LW_TRUE or LW_FALSE depending on whether or not a geometry is a linestring with measure value ...
int lwcollection_is_empty(const LWCOLLECTION *col)
LWCIRCSTRING * lwcircstring_construct_empty(int srid, char hasz, char hasm)
char lwtriangle_same(const LWTRIANGLE *p1, const LWTRIANGLE *p2)
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
LWPOLY * lwpoly_force_dims(const LWPOLY *lwpoly, int hasz, int hasm)
LWGEOM * lwgeom_force_3dz(const LWGEOM *geom)
void ptarray_swap_ordinates(POINTARRAY *pa, LWORD o1, LWORD o2)
Swap ordinate values o1 and o2 on a given POINTARRAY.
void lwpoly_free(LWPOLY *poly)
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
LWPOINT * lwpoint_clone(const LWPOINT *lwgeom)
double lwgeom_perimeter_2d(const LWGEOM *geom)
#define LW_TRUE
Return types for functions with status returns.
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
int lwpoly_is_closed(const LWPOLY *poly)
double lwcompound_length(const LWCOMPOUND *comp)
int lwcircstring_is_closed(const LWCIRCSTRING *curve)
#define SRID_UNKNOWN
Unknown SRID value.
LWCOLLECTION * lwcollection_simplify(const LWCOLLECTION *igeom, double dist, int preserve_collapsed)
void lwgeom_affine(LWGEOM *geom, const AFFINE *affine)
LWMLINE * lwgeom_as_lwmline(const LWGEOM *lwgeom)
LWCIRCSTRING * lwcircstring_clone(const LWCIRCSTRING *curve)
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
LWGEOM * lwcurvepoly_as_lwgeom(const LWCURVEPOLY *obj)
int lwtype_is_collection(uint8_t type)
Return TRUE if the geometry may contain sub-geometries, i.e.
LWGEOM * lwgeom_force_4d(const LWGEOM *geom)
double lwpoly_area(const LWPOLY *poly)
Find the area of the outer ring - sum (area of inner rings).
int lwgeom_dimensionality(LWGEOM *geom)
Return the dimensionality (relating to point/line/poly) of an lwgeom.
int lwpoly_is_empty(const LWPOLY *poly)
LWCURVEPOLY * lwcurvepoly_construct_empty(int srid, char hasz, char hasm)
uint8_t MULTITYPE[NUMTYPES]
Look-up for the correct MULTI* type promotion for singleton types.
double lwcurvepoly_perimeter_2d(const LWCURVEPOLY *poly)
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
#define FP_TOLERANCE
Floating point comparators.
LWGEOM * lwcircstring_as_lwgeom(const LWCIRCSTRING *obj)
LWPOLY * lwpoly_grid(const LWPOLY *poly, const gridspec *grid)
enum LWORD_T LWORD
Ordinate names.
int lwpsurface_is_closed(const LWPSURFACE *psurface)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
int lwcollection_startpoint(const LWCOLLECTION *col, POINT4D *pt)
LWCOMPOUND * lwcompound_construct_from_lwline(const LWLINE *lwpoly)
Construct an equivalent compound curve from a linestring.
LWCOLLECTION * lwcollection_clone_deep(const LWCOLLECTION *lwgeom)
Deep clone LWCOLLECTION object.
int lwpoly_startpoint(const LWPOLY *lwpoly, POINT4D *pt)
double lwpoly_perimeter_2d(const LWPOLY *poly)
Compute the sum of polygon rings length (forcing 2d computation).
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
double lwpoly_perimeter(const LWPOLY *poly)
Compute the sum of polygon rings length.
void lwtriangle_free(LWTRIANGLE *triangle)
LWCOLLECTION * lwcollection_segmentize2d(LWCOLLECTION *coll, double dist)
void lwpsurface_free(LWPSURFACE *psurf)
LWCIRCSTRING * lwgeom_as_lwcircstring(const LWGEOM *lwgeom)
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
LWCOLLECTION * lwcollection_force_dims(const LWCOLLECTION *lwcol, int hasz, int hasm)
LWCOLLECTION * lwgeom_subdivide(const LWGEOM *geom, int maxvertices)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
double lwgeom_length_2d(const LWGEOM *geom)
LWGEOM * lwgeom_force_dims(const LWGEOM *geom, int hasz, int hasm)
void lwpoly_reverse(LWPOLY *poly)
int ptarray_startpoint(const POINTARRAY *pa, POINT4D *pt)
int lwline_is_empty(const LWLINE *line)
LWGEOM * lwline_remove_repeated_points(const LWLINE *in, double tolerance)
LWGEOM * lwgeom_force_2d(const LWGEOM *geom)
Strip out the Z/M components of an LWGEOM.
LWGEOM * lwpoly_remove_repeated_points(const LWPOLY *in, double tolerance)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
LWPOLY * lwpoly_from_lwlines(const LWLINE *shell, uint32_t nholes, const LWLINE **holes)
#define FLAGS_SET_BBOX(flags, value)
int lwpoint_inside_circle(const LWPOINT *p, double cx, double cy, double rad)
double lwcurvepoly_perimeter(const LWCURVEPOLY *poly)
void lwline_reverse(LWLINE *line)
LWLINE * lwline_force_dims(const LWLINE *lwline, int hasz, int hasm)
LWGEOM * lwgeom_force_sfs(LWGEOM *geom, int version)
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
double lwline_length(const LWLINE *line)
int lwgeom_dimension(const LWGEOM *geom)
For an LWGEOM, returns 0 for points, 1 for lines, 2 for polygons, 3 for volume, and the max dimension...
int lwline_is_closed(const LWLINE *line)
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
LWMPOLY * lwgeom_as_lwmpoly(const LWGEOM *lwgeom)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
int lwpoint_is_empty(const LWPOINT *point)
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
LWGEOM * lwmline_as_lwgeom(const LWMLINE *obj)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Ensure there's a box in the LWGEOM.
#define FLAGS_GET_M(flags)
LWCOLLECTION * lwcollection_grid(const LWCOLLECTION *coll, const gridspec *grid)
int lwgeom_needs_bbox(const LWGEOM *geom)
Check whether or not a lwgeom is big enough to warrant a bounding box.
int lwtype_get_collectiontype(uint8_t type)
Given an lwtype number, what homogeneous collection can hold it?
LWCOLLECTION * lwcollection_clone(const LWCOLLECTION *lwgeom)
Clone LWCOLLECTION object.
void lwcollection_free(LWCOLLECTION *col)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
LWGEOM * lwgeom_construct_empty(uint8_t type, int srid, char hasz, char hasm)
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate the gbox for this goemetry, a cartesian box or geodetic box, depending on how it is flagged...
int lwgeom_is_clockwise(LWGEOM *lwgeom)
Check clockwise orientation on LWGEOM polygons.
GBOX * gbox_clone(const GBOX *gbox)
LWTIN * lwgeom_as_lwtin(const LWGEOM *lwgeom)
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
LWPOLY * lwpoly_segmentize2d(LWPOLY *line, double dist)
static int lwgeom_subdivide_recursive(const LWGEOM *geom, int maxvertices, int depth, LWCOLLECTION *col, const GBOX *clip)
void * lwalloc(size_t size)
LWGEOM * lwtriangle_as_lwgeom(const LWTRIANGLE *obj)
void lwgeom_free(LWGEOM *lwgeom)
int lwpoly_count_vertices(LWPOLY *poly)
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
LWPOLY * lwpoly_clone(const LWPOLY *lwgeom)
LWLINE * lwline_clone_deep(const LWLINE *lwgeom)
#define LWDEBUGF(level, msg,...)
#define FLAGS_NDIMS(flags)
double lwcurvepoly_area(const LWCURVEPOLY *curvepoly)
This should be rewritten to make use of the curve itself.
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
LWGEOM * lwgeom_flip_coordinates(LWGEOM *in)
Reverse the X and Y coordinate order.
char lwpoly_same(const LWPOLY *p1, const LWPOLY *p2)
LWGEOM * lwcompound_as_lwgeom(const LWCOMPOUND *obj)
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
char lwline_same(const LWLINE *p1, const LWLINE *p2)
LWLINE * lwline_simplify(const LWLINE *iline, double dist, int preserve_collapsed)
LWGEOM * lwgeom_as_curve(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate CURVE* type.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void ptarray_affine(POINTARRAY *pa, const AFFINE *affine)
Affine transform a pointarray.
void lwgeom_reverse(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
const GBOX * lwgeom_get_bbox(const LWGEOM *lwg)
Get a non-empty geometry bounding box, computing and caching it if not already there.
int lwgeom_calculate_gbox_cartesian(const LWGEOM *lwgeom, GBOX *gbox)
Calculate the 2-4D bounding box of a geometry.