PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ ptarray_is_closed_2d()

int ptarray_is_closed_2d ( const POINTARRAY pa)

Definition at line 710 of file ptarray.c.

711 {
712  if (!in)
713  {
714  lwerror("ptarray_is_closed_2d: called with null point array");
715  return 0;
716  }
717  if (in->npoints <= 1 ) return in->npoints; /* single-point are closed, empty not closed */
718 
719  return 0 == memcmp(getPoint_internal(in, 0), getPoint_internal(in, in->npoints-1), sizeof(POINT2D) );
720 }
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition: lwinline.h:75

References getPoint_internal(), lwerror(), and POINTARRAY::npoints.

Referenced by _lwt_AddFaceSplit(), lwcircstring_is_closed(), lwline_is_closed(), lwpoly_from_lwlines(), lwpoly_from_twkb_state(), lwpoly_from_wkb_state(), lwpoly_is_closed(), lwt_ChangeEdgeGeom(), lwtriangle_from_lwline(), parse_gml_linearring(), parse_gml_patch(), parse_gml_polygon(), parse_gml_triangle(), parse_kml_polygon(), ptarray_close2d(), ptarray_is_closed_z(), ptarray_scroll_in_place(), ptarray_to_GEOSCoordSeq(), and wkt_parser_polygon_add_ring().

Here is the call graph for this function:
Here is the caller graph for this function: