1003{
1004 uint32_t i;
1005 int result, in_ring;
1007
1008 POSTGIS_DEBUG(2, "point_in_polygon called.");
1009
1011
1012
1013
1014 if ( polygon->
nrings == 0 )
return -1;
1015
1017 if ( in_ring == -1)
1018 {
1019 POSTGIS_DEBUG(3, "point_in_polygon: outside exterior ring.");
1020 return -1;
1021 }
1022 result = in_ring;
1023
1024 for (i=1; i<polygon->
nrings; i++)
1025 {
1027 if (in_ring == 1)
1028 {
1029 POSTGIS_DEBUGF(3, "point_in_polygon: within hole %d.", i);
1030 return -1;
1031 }
1032 if (in_ring == 0)
1033 {
1034 POSTGIS_DEBUGF(3, "point_in_polygon: on edge of hole %d.", i);
1035 return 0;
1036 }
1037 }
1038 return result;
1039}
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
static int point_in_ring(POINTARRAY *pts, const POINT2D *point)