extern POINTARRAY *ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where);
extern POINTARRAY *ptarray_removePoint(POINTARRAY *pa, uint32_t where);
extern POINTARRAY *ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2);
-extern int ptarray_isclosed(const POINTARRAY *pa);
-extern int ptarray_isclosed2d(const POINTARRAY *pa);
-extern int ptarray_isclosed3d(const POINTARRAY *pa);
-extern int ptarray_isclosedz(const POINTARRAY *pa);
+extern int ptarray_is_closed(const POINTARRAY *pa);
+extern int ptarray_is_closed_2d(const POINTARRAY *pa);
+extern int ptarray_is_closed_3d(const POINTARRAY *pa);
+extern int ptarray_is_closed_z(const POINTARRAY *pa);
extern void ptarray_longitude_shift(POINTARRAY *pa);
extern void ptarray_reverse(POINTARRAY *pa);
extern POINTARRAY* ptarray_flip_coordinates(POINTARRAY *pa);
lwcircstring_is_closed(const LWCIRCSTRING *curve)
{
if (FLAGS_GET_Z(curve->flags))
- return ptarray_isclosed3d(curve->points);
+ return ptarray_is_closed_3d(curve->points);
- return ptarray_isclosed2d(curve->points);
+ return ptarray_is_closed_2d(curve->points);
}
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
POINTARRAY* newring;
/* close the ring if not already closed (2d only) */
- if ( ! ptarray_isclosed2d(ring) )
+ if ( ! ptarray_is_closed_2d(ring) )
{
/* close it up */
newring = ptarray_addPoint(ring,
}
/* Check that first and last points are the same. */
- if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed2d(pa) )
+ if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed_2d(pa) )
{
LWDEBUGF(2, "%s must have closed rings", lwtype_name(s->lwtype));
lwerror("%s must have closed rings", lwtype_name(s->lwtype));
return NULL;
}
- if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_isclosed(pa) )
+ if( s->check & LW_PARSER_CHECK_CLOSURE && ! ptarray_is_closed(pa) )
{
lwerror("%s must have closed rings", lwtype_name(s->lwtype));
return NULL;
}
- if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_isclosedz(pa) )
+ if( s->check & LW_PARSER_CHECK_ZCLOSURE && ! ptarray_is_closed_z(pa) )
{
lwerror("%s must have closed rings", lwtype_name(s->lwtype));
return NULL;
}
/* Triangles need closure. */
- if( ! ptarray_isclosed(pa) )
+ if( ! ptarray_is_closed(pa) )
{
ptarray_free(pa);
SET_PARSER_ERROR(PARSER_ERROR_UNCLOSED);
/* Apply check for not closed rings, if requested. */
if( (global_parser_result.parser_check_flags & LW_PARSER_CHECK_CLOSURE) &&
- ! (dimcheck == 'Z' ? ptarray_isclosedz(pa) : ptarray_isclosed2d(pa)) )
+ ! (dimcheck == 'Z' ? ptarray_is_closed_z(pa) : ptarray_is_closed_2d(pa)) )
{
ptarray_free(pa);
lwgeom_free(poly);
lwline_is_closed(const LWLINE *line)
{
if (FLAGS_GET_Z(line->flags))
- return ptarray_isclosed3d(line->points);
+ return ptarray_is_closed_3d(line->points);
- return ptarray_isclosed2d(line->points);
+ return ptarray_is_closed_2d(line->points);
}
if ( shell->points->npoints < 4 )
lwerror("lwpoly_from_lwlines: shell must have at least 4 points");
- if ( ! ptarray_isclosed2d(shell->points) )
+ if ( ! ptarray_is_closed_2d(shell->points) )
lwerror("lwpoly_from_lwlines: shell must be closed");
rings[0] = ptarray_clone_deep(shell->points);
if ( hole->points->npoints < 4 )
lwerror("lwpoly_from_lwlines: holes must have at least 4 points");
- if ( ! ptarray_isclosed2d(hole->points) )
+ if ( ! ptarray_is_closed_2d(hole->points) )
lwerror("lwpoly_from_lwlines: holes must be closed");
rings[nrings] = ptarray_clone_deep(hole->points);
{
if (FLAGS_GET_Z(poly->flags))
{
- if ( ! ptarray_isclosed3d(poly->rings[i]) )
+ if ( ! ptarray_is_closed_3d(poly->rings[i]) )
return LW_FALSE;
}
else
{
- if ( ! ptarray_isclosed2d(poly->rings[i]) )
+ if ( ! ptarray_is_closed_2d(poly->rings[i]) )
return LW_FALSE;
}
}
if ( shell->points->npoints != 4 )
lwerror("lwtriangle_from_lwline: shell must have exactly 4 points");
- if ( (!FLAGS_GET_Z(shell->flags) && !ptarray_isclosed2d(shell->points)) ||
- (FLAGS_GET_Z(shell->flags) && !ptarray_isclosed3d(shell->points)) )
+ if ( (!FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_2d(shell->points)) ||
+ (FLAGS_GET_Z(shell->flags) && !ptarray_is_closed_3d(shell->points)) )
lwerror("lwtriangle_from_lwline: shell must be closed");
pa = ptarray_clone_deep(shell->points);
* pointarray.
*/
int
-ptarray_isclosed(const POINTARRAY *in)
+ptarray_is_closed(const POINTARRAY *in)
{
return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), ptarray_point_size(in));
}
int
-ptarray_isclosed2d(const POINTARRAY *in)
+ptarray_is_closed_2d(const POINTARRAY *in)
{
return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT2D));
}
int
-ptarray_isclosed3d(const POINTARRAY *in)
+ptarray_is_closed_3d(const POINTARRAY *in)
{
return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT3D));
}
int
-ptarray_isclosedz(const POINTARRAY *in)
+ptarray_is_closed_z(const POINTARRAY *in)
{
if ( FLAGS_GET_Z(in->flags) )
- return ptarray_isclosed3d(in);
+ return ptarray_is_closed_3d(in);
else
- return ptarray_isclosed2d(in);
+ return ptarray_is_closed_2d(in);
}
ppa[0] = parse_gml_data(xnode->children, hasz, root_srid);
if (ppa[0]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[0]))
- || (*hasz && !ptarray_isclosed3d(ppa[0])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+ || (*hasz && !ptarray_is_closed_3d(ppa[0])))
gml_lwerror("invalid GML representation", 42);
if (srs.reverse_axis)
ppa[0] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[0]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[0]))
- || (*hasz && !ptarray_isclosed3d(ppa[0])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+ || (*hasz && !ptarray_is_closed_3d(ppa[0])))
gml_lwerror("invalid GML representation", 43);
if (srs.reverse_axis) ppa[0] = ptarray_flip_coordinates(ppa[0]);
ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[ring]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[ring]))
- || (*hasz && !ptarray_isclosed3d(ppa[ring])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
+ || (*hasz && !ptarray_is_closed_3d(ppa[ring])))
gml_lwerror("invalid GML representation", 43);
if (srs.reverse_axis) ppa[ring] = ptarray_flip_coordinates(ppa[ring]);
pa = parse_gml_data(xb->children, hasz, root_srid);
if (pa->npoints != 4
- || (!*hasz && !ptarray_isclosed2d(pa))
- || (*hasz && !ptarray_isclosed3d(pa)))
+ || (!*hasz && !ptarray_is_closed_2d(pa))
+ || (*hasz && !ptarray_is_closed_3d(pa)))
gml_lwerror("invalid GML representation", 46);
if (srs.reverse_axis) pa = ptarray_flip_coordinates(pa);
ppa[0] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[0]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[0]))
- || (*hasz && !ptarray_isclosed3d(ppa[0])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+ || (*hasz && !ptarray_is_closed_3d(ppa[0])))
gml_lwerror("invalid GML representation", 48);
if (srs.reverse_axis)
ppa[ring] = parse_gml_data(xb->children, hasz, root_srid);
if (ppa[ring]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[ring]))
- || ( *hasz && !ptarray_isclosed3d(ppa[ring])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
+ || ( *hasz && !ptarray_is_closed_3d(ppa[ring])))
gml_lwerror("invalid GML representation", 49);
if (srs.reverse_axis)
ppa[0] = parse_kml_coordinates(xb->children, hasz);
if (ppa[0]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[0]))
- || (*hasz && !ptarray_isclosed3d(ppa[0])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[0]))
+ || (*hasz && !ptarray_is_closed_3d(ppa[0])))
lwerror("invalid KML representation");
}
}
ppa[ring] = parse_kml_coordinates(xb->children, hasz);
if (ppa[ring]->npoints < 4
- || (!*hasz && !ptarray_isclosed2d(ppa[ring]))
- || (*hasz && !ptarray_isclosed3d(ppa[ring])))
+ || (!*hasz && !ptarray_is_closed_2d(ppa[ring]))
+ || (*hasz && !ptarray_is_closed_3d(ppa[ring])))
lwerror("invalid KML representation");
ring++;