lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject [16/50] [abbrv] lucene-solr:apiv2: LUCENE-7153: remove extra PIP copy, this is in Polygon.java now
Date Thu, 07 Apr 2016 20:29:48 GMT
LUCENE-7153: remove extra PIP copy, this is in Polygon.java now


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cc75be53
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cc75be53
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cc75be53

Branch: refs/heads/apiv2
Commit: cc75be53f9b3b86ec59cb93896c4fd5a9a5926b2
Parents: 81c83b4
Author: Robert Muir <rmuir@apache.org>
Authored: Fri Apr 1 00:23:22 2016 -0400
Committer: Robert Muir <rmuir@apache.org>
Committed: Fri Apr 1 00:23:22 2016 -0400

----------------------------------------------------------------------
 .../search/GeoPointInPolygonQueryImpl.java      |  2 +-
 .../lucene/spatial/util/GeoRelationUtils.java   | 27 --------------------
 2 files changed, 1 insertion(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cc75be53/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
index d499a47..20c9078 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
@@ -77,7 +77,7 @@ final class GeoPointInPolygonQueryImpl extends GeoPointInBBoxQueryImpl {
      * {@link org.apache.lucene.spatial.geopoint.search.GeoPointTermsEnum#accept} method
is called to match
      * encoded terms that fall within the bounding box of the polygon. Those documents that
pass the initial
      * bounding box filter are then compared to the provided polygon using the
-     * {@link org.apache.lucene.spatial.util.GeoRelationUtils#pointInPolygon} method.
+     * {@link Polygon#contains(Polygon[], double, double)} method.
      */
     @Override
     protected boolean postFilter(final double lat, final double lon) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cc75be53/lucene/spatial/src/java/org/apache/lucene/spatial/util/GeoRelationUtils.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/util/GeoRelationUtils.java
b/lucene/spatial/src/java/org/apache/lucene/spatial/util/GeoRelationUtils.java
index 50f9446..a54a304 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/util/GeoRelationUtils.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/util/GeoRelationUtils.java
@@ -36,33 +36,6 @@ public class GeoRelationUtils {
     return lat >= minLat && lat <= maxLat && lon >= minLon &&
lon <= maxLon;
   }
 
-  /**
-   * simple even-odd point in polygon computation
-   *    1.  Determine if point is contained in the longitudinal range
-   *    2.  Determine whether point crosses the edge by computing the latitudinal delta
-   *        between the end-point of a parallel vector (originating at the point) and the
-   *        y-component of the edge sink
-   *
-   * NOTE: Requires polygon point (x,y) order either clockwise or counter-clockwise
-   */
-  public static boolean pointInPolygon(double[] polyLats, double[] polyLons, double lat,
double lon) {
-    assert polyLats.length == polyLons.length;
-    boolean inPoly = false;
-    /**
-     * Note: This is using a euclidean coordinate system which could result in
-     * upwards of 110KM error at the equator.
-     * TODO convert coordinates to cylindrical projection (e.g. mercator)
-     */
-    for (int i = 1; i < polyLats.length; i++) {
-      if (polyLons[i] <= lon && polyLons[i-1] >= lon || polyLons[i-1] <=
lon && polyLons[i] >= lon) {
-        if (polyLats[i] + (lon - polyLons[i]) / (polyLons[i-1] - polyLons[i]) * (polyLats[i-1]
- polyLats[i]) <= lat) {
-          inPoly = !inPoly;
-        }
-      }
-    }
-    return inPoly;
-  }
-
   /////////////////////////
   // Rectangle relations
   /////////////////////////


Mime
View raw message