51 npoints = ((
LWCIRCSTRING *)compound->geoms[compound->ngeoms - 1])->points->npoints;
53 else if (compound->geoms[compound->ngeoms - 1]->
type ==
LINETYPE)
55 npoints = ((
LWLINE *)compound->geoms[compound->ngeoms - 1])->points->npoints;
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 < 0 || 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++ )
230 LWGEOM* part = lwcmp->geoms[i];
232 if ( where >= count && where < count + npoints_part )
238 count += npoints_part;
int lwgeom_contains_point(const LWGEOM *geom, const POINT2D *pt)
LWCOMPOUND * lwcompound_construct_from_lwline(const LWLINE *lwline)
Construct an equivalent compound curve from a linestring.
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
#define LWDEBUG(level, msg)
double lwgeom_length_2d(const LWGEOM *geom)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
double lwcompound_length(const LWCOMPOUND *comp)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define LW_TRUE
Return types for functions with status returns.
int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number)
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
#define LW_INSIDE
Constants for point-in-polygon return values.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
int lwcompound_is_closed(const LWCOMPOUND *compound)
LWPOINT * lwcompound_get_lwpoint(const LWCOMPOUND *lwcmp, int where)
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)
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWCIRCSTRING * lwgeom_as_lwcircstring(const LWGEOM *lwgeom)
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
LWPOINT * lwcompound_get_startpoint(const LWCOMPOUND *lwcmp)
#define FLAGS_GET_M(flags)
LWPOINT * lwline_get_lwpoint(const LWLINE *line, int where)
Returns freshly allocated LWPOINT that corresponds to the index where.
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 lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
int lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
LWPOINT * lwcompound_get_endpoint(const LWCOMPOUND *lwcmp)
#define LWDEBUGF(level, msg,...)
int ptarrayarc_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number)
double lwcompound_length_2d(const LWCOMPOUND *comp)
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)