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");
151 int winding_number = 0;
154 for ( i = 0; i < comp->
ngeoms; i++ )
192 wn += winding_number;
222 if ( where >= npoints )
224 lwerror(
"%s: index %d is not in range of number of vertices (%d) in input", __func__, where, npoints);
228 for ( i = 0; i < lwcmp->
ngeoms; i++ )
232 if ( where >=
count && where <
count + npoints_part )
238 count += npoints_part;
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
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 lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
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.
int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number)
#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_contains_point(const POINTARRAY *pa, const POINT2D *pt)
Return 1 if the point is inside the POINTARRAY, -1 if it is outside, and 0 if it is on the boundary.
int ptarrayarc_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number)
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)
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
LWCOMPOUND * lwcompound_construct_empty(int srid, char hasz, char hasm)
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.