sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r1032828 - in /incubator/sis/trunk: ./ sis-core/src/main/java/org/apache/sis/storage/ sis-webapp/src/main/java/org/apache/sis/services/
Date Tue, 09 Nov 2010 03:04:13 GMT
Author: mattmann
Date: Tue Nov  9 03:04:13 2010
New Revision: 1032828

URL: http://svn.apache.org/viewvc?rev=1032828&view=rev
Log:
- fix for SIS-14 Use LatLon class instead of plain double points in QuadTreeData interface

Modified:
    incubator/sis/trunk/CHANGES.txt
    incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java
    incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java
    incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeData.java
    incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
    incubator/sis/trunk/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java

Modified: incubator/sis/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/CHANGES.txt?rev=1032828&r1=1032827&r2=1032828&view=diff
==============================================================================
--- incubator/sis/trunk/CHANGES.txt (original)
+++ incubator/sis/trunk/CHANGES.txt Tue Nov  9 03:04:13 2010
@@ -2,6 +2,8 @@ Apache SIS Change Log
 ======================
 Release 0.1-incubating (Current Development)
 
+* SIS-14 Use LatLon class instead of plain double points in QuadTreeData interface (greddin,
mattmann)
+
 * SIS-15 Bake in Demo JSP page for initial release (mattmann, nchung)
 
 * SIS-3 Refactor SIS (Nga Chung, mattmann)

Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java?rev=1032828&r1=1032827&r2=1032828&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/GeoRSSData.java Tue
Nov  9 03:04:13 2010
@@ -75,23 +75,14 @@ public class GeoRSSData implements QuadT
 		return latLon.getShiftedLat();
 	}
 
-	/**
-	 * Returns the latitude.
-	 * 
-	 * @return the latitude
-	 */
-	public double getLat() {
-		return this.latLon.getLat();
-	}
 
-	/**
-	 * Returns the longitude.
-	 * 
-	 * @return the longitude
-	 */
-	public double getLon() {
-		return this.latLon.getLon();
-	}
+  /* (non-Javadoc)
+   * @see org.apache.sis.storage.QuadTreeData#getLatLon()
+   */
+  @Override
+  public LatLon getLatLon() {
+    return this.latLon;
+  }
 
 	/**
 	 * Returns the name of the file where the entry's info is saved.
@@ -184,4 +175,5 @@ public class GeoRSSData implements QuadT
 		return map;
 
 	}
+	
 }

Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java?rev=1032828&r1=1032827&r2=1032828&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTree.java Tue Nov
 9 03:04:13 2010
@@ -342,8 +342,8 @@ public class QuadTree {
       else {
         QuadTreeData[] data = node.getData();
         for (int i = 0; i < node.getCount(); i++) {
-          if (DistanceUtils.getHaversineDistance(data[i].getLat(), data[i]
-              .getLon(), point.getLat(), point.getLon()) <= radiusKM) {
+          if (DistanceUtils.getHaversineDistance(data[i].getLatLon().getLat(), data[i]
+              .getLatLon().getLon(), point.getLat(), point.getLon()) <= radiusKM) {
             matches.add(data[i]);
           }
         }

Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeData.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeData.java?rev=1032828&r1=1032827&r2=1032828&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeData.java (original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeData.java Tue
Nov  9 03:04:13 2010
@@ -17,6 +17,9 @@
 
 package org.apache.sis.storage;
 
+//SIS imports
+import org.apache.sis.core.LatLon;
+
 /**
  * Interface representing data stored in quad tree. All data to be stored in
  * quad tree must implement this interface, so that quad tree can access
@@ -39,18 +42,11 @@ public interface QuadTreeData {
   public double getY();
 
   /**
-   * Returns the latitude.
-   * 
-   * @return the latitude
-   */
-  public double getLat();
-
-  /**
-   * Returns the longitude.
+   * Returns the latitude/longitude pair.
    * 
-   * @return the longitude
+   * @return the latitude/longitude pair.
    */
-  public double getLon();
+  public LatLon getLatLon();
 
   /**
    * Returns the name of the file where the entry's info is saved.

Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java?rev=1032828&r1=1032827&r2=1032828&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
(original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
Tue Nov  9 03:04:13 2010
@@ -125,9 +125,9 @@ public class QuadTreeWriter {
     str.append(':');
     QuadTreeData[] data = node.getData();
     for (int i = 0; i < node.getCount(); i++) {
-      str.append(data[i].getLat());
+      str.append(data[i].getLatLon().getLat());
       str.append(';');
-      str.append(data[i].getLon());
+      str.append(data[i].getLatLon().getLon());
       str.append(';');
       str.append(data[i].getFileName());
       str.append(':');

Modified: incubator/sis/trunk/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java?rev=1032828&r1=1032827&r2=1032828&view=diff
==============================================================================
--- incubator/sis/trunk/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java
(original)
+++ incubator/sis/trunk/sis-webapp/src/main/java/org/apache/sis/services/LocationServlet.java
Tue Nov  9 03:04:13 2010
@@ -174,7 +174,7 @@ public class LocationServlet extends Htt
                       + File.separator);
                 } else {
                   System.out.println("[INFO] Unable to store data at location "
-                      + data.getLat() + ", " + data.getLon()
+                      + data.getLatLon().getLat() + ", " + data.getLatLon().getLon()
                       + " under filename " + data.getFileName());
                 }
               }
@@ -371,12 +371,12 @@ public class LocationServlet extends Htt
         item.appendChild(id);
 
         Element lat = doc.createElement("lat");
-        Text latText = doc.createTextNode(Double.toString(geo.getLat()));
+        Text latText = doc.createTextNode(Double.toString(geo.getLatLon().getLat()));
         lat.appendChild(latText);
         item.appendChild(lat);
 
         Element lon = doc.createElement("lon");
-        Text lonText = doc.createTextNode(Double.toString(geo.getLon()));
+        Text lonText = doc.createTextNode(Double.toString(geo.getLatLon().getLon()));
         lon.appendChild(lonText);
         item.appendChild(lon);
 



Mime
View raw message