[GRASS-SVN] r64338 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 27 14:22:43 PST 2015


Author: mmetz
Date: 2015-01-27 14:22:43 -0800 (Tue, 27 Jan 2015)
New Revision: 64338

Modified:
   grass/trunk/lib/vector/Vlib/area.c
Log:
Vlib: sync Vect_point_in_area() to the other Vect_point_in*() fns

Modified: grass/trunk/lib/vector/Vlib/area.c
===================================================================
--- grass/trunk/lib/vector/Vlib/area.c	2015-01-27 20:08:58 UTC (rev 64337)
+++ grass/trunk/lib/vector/Vlib/area.c	2015-01-27 22:22:43 UTC (rev 64338)
@@ -328,8 +328,9 @@
    \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,8 +348,11 @@
 
     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++) {
 	isle = Area->isles[i];



More information about the grass-commit mailing list