Add ptarray_isclosed3d function

git-svn-id: http://svn.osgeo.org/postgis/trunk@4670 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Olivier Courtin 2009-10-22 14:06:45 +00:00
parent 693e9c398e
commit f97acc13d3
2 changed files with 8 additions and 0 deletions

View file

@ -1372,6 +1372,7 @@ extern POINTARRAY *ptarray_addPoint(POINTARRAY *pa, uchar *p, size_t pdims,
extern POINTARRAY *ptarray_removePoint(POINTARRAY *pa, unsigned int where);
extern int ptarray_isclosed2d(const POINTARRAY *pa);
extern int ptarray_isclosed3d(const POINTARRAY *pa);
extern void ptarray_longitude_shift(POINTARRAY *pa);

View file

@ -378,6 +378,13 @@ ptarray_isclosed2d(const POINTARRAY *in)
return 1;
}
int
ptarray_isclosed3d(const POINTARRAY *in)
{
if ( memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT3D)) ) return 0;
return 1;
}
/**
* @brief calculate the #BOX3D bounding box of a set of points
* @return a lwalloced #BOX3D, or NULL on empty array.