lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gsing...@apache.org
Subject svn commit: r929698 - /lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
Date Wed, 31 Mar 2010 19:54:41 GMT
Author: gsingers
Date: Wed Mar 31 19:54:41 2010
New Revision: 929698

URL: http://svn.apache.org/viewvc?rev=929698&view=rev
Log:
added some comments, removed an extra, useless if check

Modified:
    lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java

Modified: lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java?rev=929698&r1=929697&r2=929698&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
(original)
+++ lucene/dev/trunk/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/tier/CartesianPolyFilterBuilder.java
Wed Mar 31 19:54:41 2010
@@ -72,11 +72,12 @@ public class CartesianPolyFilterBuilder 
     double longY = ur.getLng();
     double longX = ll.getLng();
     double longX2 = 0.0;
-
+	//Are we crossing the 180 deg. longitude, if so, we need to do some special things
     if (ur.getLng() < 0.0 && ll.getLng() > 0.0) {
 	longX2 = ll.getLng();
  	longX = -180.0;	
     }
+	//are we crossing the prime meridian (0 degrees)?  If so, we need to account for it and
boxes on both sides
     if (ur.getLng() > 0.0 && ll.getLng() < 0.0) {
 	longX2 = ll.getLng();
  	longX = 0.0;	
@@ -101,18 +102,19 @@ public class CartesianPolyFilterBuilder 
     //      shape.add(currentLat.currentLong);
 
     shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
-    if (longX2 != 0.0) {
+
 	if (longX2 != 0.0) {
+		//We are around the prime meridian
 		if (longX == 0.0) {
 			longX = longX2;
 			longY = 0.0;
-        		shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
-		} else {
+        	shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
+		} else {//we are around the 180th longitude
 			longX = longX2;
 			longY = -180.0;
-        		shape = getShapeLoop(shape,ctp,latY,longY,latX,longX);
-		}
+			shape = getShapeLoop(shape,ctp,latY,longY,latX,longX);
 	}
+
         //System.err.println("getBoxShape2:"+latY+"," + longY);
         //System.err.println("getBoxShape2:"+latX+"," + longX);
     }



Mime
View raw message