Explorar o código

Vlib: sync Vect_point_in_area() to the other Vect_point_in*() fns

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64338 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz %!s(int64=10) %!d(string=hai) anos
pai
achega
d14f460c95
Modificáronse 1 ficheiros con 7 adicións e 3 borrados
  1. 7 3
      lib/vector/Vlib/area.c

+ 7 - 3
lib/vector/Vlib/area.c

@@ -328,8 +328,9 @@ double Vect_get_area_perimeter(const struct Map_info *Map, int area)
    \param area area id
    \param box area bounding box
 
-   \return 1 if point is in area
-   \return 0 if not 
+   \return 0 if point is outside area
+   \return 1 if point is inside area
+   \return 2 if point is on the area's outer ring
  */
 int Vect_point_in_area(double x, double y, const struct Map_info *Map,
                        int area, struct bound_box *box)
@@ -347,7 +348,10 @@ int Vect_point_in_area(double x, double y, const struct Map_info *Map,
 
     poly = Vect_point_in_area_outer_ring(x, y, Map, area, box);
     if (poly == 0)
-	return 0;		/* includes area boundary (poly == 2), OK? */
+	return 0;
+
+    if (poly == 2)		/* includes area boundary, OK? */
+	return 2;
 
     /* check if in islands */
     for (i = 0; i < Area->n_isles; i++) {