[
https://issues.apache.org/jira/browse/SOLR-2125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912883#action_12912883
]
Bill Bell edited comment on SOLR-2125 at 9/21/10 5:01 AM:
----------------------------------------------------------
/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/DistanceUtils.java -
hsin appears to be okay.
Good print:
System.out.println("x1 = " + x1 + " - " + x1*180/Math.PI + ",y1 = " + y1 + " -
" + x2*180/Math.PI + ",x2 = " + x2 + " - " + x2*180/Math.PI + ",y2 = " + y2 + "
- " + y2*180/Math.PI + ",radius = " + radius + "\n");
System.out.println("result = " + result + " km\n");
My guess: "src/java/org/apache/solr/schema/LatLonType.java
{code}
double[] ur;
double[] ll;
if (options.measStr == null || options.measStr.equals("hsin")) {
ur = DistanceUtils.latLonCornerDegs(point[LAT], point[LONG],
options.distance, null, true, options.radius);
ll = DistanceUtils.latLonCornerDegs(point[LAT], point[LONG],
options.distance, null, false, options.radius);
} else {
ur = DistanceUtils.vectorBoxCorner(point, null, options.distance, true);
ll = DistanceUtils.vectorBoxCorner(point, null, options.distance, false);
}
{code}
was (Author: billnbell):
/lucene/contrib/spatial/src/java/org/apache/lucene/spatial/DistanceUtils.java -
hsin appears to be okay.
Good print:
System.out.println("x1 = " + x1 + " - " + x1*180/Math.PI + ",y1 = " + y1 + " -
" + x2*180/Math.PI + ",x2 = " + x2 + " - " + x2*180/Math.PI + ",y2 = " + y2 + "
- " + y2*180/Math.PI + ",radius = " + radius + "\n");
System.out.println("result = " + result + " km\n");
Where is the boundary calculated?
> Spatial filter is not accurate
> ------------------------------
>
> Key: SOLR-2125
> URL: https://issues.apache.org/jira/browse/SOLR-2125
> Project: Solr
> Issue Type: Bug
> Components: Build
> Affects Versions: 1.5
> Reporter: Bill Bell
>
> The calculations of distance appears to be off.
> Note: "The radius of the sphere to be used when calculating distances on a
> sphere (i.e. haversine). Default is the Earth's mean radius in kilometers
> (see org.apache.solr.search.function.distance.Constants.EARTH_MEAN_RADIUS_KM)
> which is set to 3,958.761458084784856. Most applications will not need to set
> this."
> The radius of the earth in KM is 6371.009 km (≈3958.761 mi).
> Also filtering distance appears to be off - example data:
> 45.17614,-93.87341 to 44.9369054,-91.3929348 Approx 137 miles Google. 169
> miles = 220 kilometers
> http://....../solr/select?fl=*,score&start=0&rows=10&q={!sfilt%20fl=store_lat_lon}&qt=standard&pt=44.9369054,-91.3929348&d=280&sort=dist(2,store,vector(44.9369054,-91.3929348))
> asc
> Nothing shows. d=285 shows results. This is off by a lot.
> Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]