[ 
https://issues.apache.org/jira/browse/SOLR-2125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913126#action_12913126
 ] 

Bill Bell edited comment on SOLR-2125 at 9/21/10 9:04 PM:
----------------------------------------------------------

Grant: Can you give a good example using the same measurements for sorting and 
sfilt ?

Will this work? The Spatial Wiki http://wiki.apache.org/solr/SpatialSearch 
shows:

3.Using the "frange" QParser, as in fq={!frange l=0 u=400}hsin(0.57, -1.3, 
lat_rad, lon_rad, 3963.205) 

The Function Wiki Shows:

hsin(radius, true|false, x1,y1,x2,y2)

Here is the correct solution: (UPDATED)

{code}

http://localhost:8983/solr/select/??fl=*,score&start=0&rows=10&q={!sfilt%20fl=store}&qt=standard&pt=44.9369054,-91.3929348&d=285&sort=hsin(6371,true,store,vector(44.9369054,-91.3929348))%20asc

{code}

The Local Solr from Patrick projected the ur, ll using the distance and did a 
range check to see if the points are in the box.It is a close approximation. 


      was (Author: billnbell):
    Grant: Can you give a good example using the same measurements for sorting 
and sfilt ?

Will this work? The Spatial Wiki http://wiki.apache.org/solr/SpatialSearch 
shows:

3.Using the "frange" QParser, as in fq={!frange l=0 u=400}hsin(0.57, -1.3, 
lat_rad, lon_rad, 3963.205) 

The Function Wiki Shows:

hsin(radius, true|false, x1,y1,x2,y2)

Here is the correct solution: (UPDATED)

http://localhost:8983/solr/select/??fl=*,score&start=0&rows=10&q={!sfilt%20fl=store}&qt=standard&pt=44.9369054,-91.3929348&d=285&sort=hsin%286371,true,store,vector%2844.9369054,-91.3929348%29%29%20asc

The Local Solr from Patrick projected the ur, ll using the distance and did a 
range check to see if the points are in the box.It is a close approximation. 

  
> 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
>            Assignee: Grant Ingersoll
>         Attachments: solrspatial.xlsx
>
>
> 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]

Reply via email to