81 for (i = 0; i < comp->
ngeoms; i++)
95 LWDEBUG(4,
"Got an empty component for a compound curve!");
112 LWDEBUG(4,
"Components don't join up end-to-end!");
113 LWDEBUGF(4,
"first pt (%g %g %g %g) last pt (%g %g %g %g)", first.
x, first.
y, first.
z, first.
m, last.
x, last.
y, last.
z, last.
m);
140 lwerror(
"lwgeom_contains_point failed");
155 int intersections = 0;
160 for (uint32_t j = 0; j < comp->
ngeoms; j++)
203 uint32_t npoints = 0;
208 if ( where >= npoints )
210 lwerror(
"%s: index %d is not in range of number of vertices (%d) in input", __func__, where, npoints);
214 for ( i = 0; i < lwcmp->
ngeoms; i++ )
218 if ( where >=
count && where <
count + npoints_part )
224 count += npoints_part;
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWGEOM * lwcompound_as_lwgeom(const LWCOMPOUND *obj)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define FLAGS_GET_Z(flags)
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
double lwgeom_length_2d(const LWGEOM *geom)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define FLAGS_GET_M(flags)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
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.
LWCIRCSTRING * lwgeom_as_lwcircstring(const LWGEOM *lwgeom)
#define LW_TRUE
Return types for functions with status returns.
LWPOINT * lwline_get_lwpoint(const LWLINE *line, uint32_t where)
Returns freshly allocated LWPOINT that corresponds to the index where.
#define LW_INSIDE
Constants for point-in-polygon return values.
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
int ptarray_raycast_intersections(const POINTARRAY *pa, const POINT2D *p, int *on_boundary)
int ptarrayarc_raycast_intersections(const POINTARRAY *pa, const POINT2D *p, int *on_boundary)
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
The following is based on the "Fast Winding Number Inclusion of a Point in a Polygon" algorithm by Da...
double lwcompound_length_2d(const LWCOMPOUND *comp)
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
LWPOINT * lwcompound_get_lwpoint(const LWCOMPOUND *lwcmp, uint32_t where)
int lwcompound_is_closed(const LWCOMPOUND *compound)
LWCOMPOUND * lwcompound_construct_from_lwline(const LWLINE *lwline)
Construct an equivalent compound curve from a linestring.
LWPOINT * lwcompound_get_startpoint(const LWCOMPOUND *lwcmp)
double lwcompound_length(const LWCOMPOUND *comp)
int lwgeom_contains_point(const LWGEOM *geom, const POINT2D *pt)
LWCOMPOUND * lwcompound_construct_empty(int32_t srid, char hasz, char hasm)
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
LWPOINT * lwcompound_get_endpoint(const LWCOMPOUND *lwcmp)
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
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)