diff --git a/vtm/src/org/oscim/utils/GeometryUtils.java b/vtm/src/org/oscim/utils/GeometryUtils.java index 92a57084..222cc3ce 100644 --- a/vtm/src/org/oscim/utils/GeometryUtils.java +++ b/vtm/src/org/oscim/utils/GeometryUtils.java @@ -19,10 +19,30 @@ public final class GeometryUtils { private GeometryUtils() { } - // from www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html /** - * test if point x/y is in polygon defined by vertices[offset ... + * Test if point x/y is in polygon defined by vertices[offset ... * offset+length] + *
+ * -- from www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html + *
+ * If there is only one connected component, then it is optional to repeat + * the first vertex at the end. It's also optional to surround the component + * with zero vertices. + *
+ * The polygon may contain multiple separate components, and/or holes, + * provided that you separate the components and holes with a (0,0) vertex, + * as follows. + *
+ * Each component or hole's vertices may be listed either clockwise or + * counter-clockwise. */ public static boolean pointInPoly(float x, float y, float[] vertices, int length, int offset) {