Neil Ireson created SOLR-12899:
----------------------------------

             Summary: geodist returns polygon with incorrect distance
                 Key: SOLR-12899
                 URL: https://issues.apache.org/jira/browse/SOLR-12899
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: spatial
            Reporter: Neil Ireson


I have an RPT field which contains a mix of points and polygons.

When I perform a geodist query, where the query point is within an indexed 
polygon, the polygon is correctly returned, however it is sorted as being the 
most distant, and the returned distance to the polygon exceeds the maximum 
distance specified in the query.

Obviously some calculation is being performed which puts the polygon within 
100m of the query point, however the distance being calculated for sorting 
or/and response is not the same. It appears from playing with the query that if 
the Polygon is within the query distance then it is always returned as the last 
document, whether or not the documents are sorted.

 

 

This is the query and the final two documents returned...

 

http://localhost:8983/solr/Naptan/select?q=*:*&fl=*,dist:geodist()&rows=100&fq=\{!geofilt}&sfield=location&pt=53.3805565,-1.4645408&d=0.1&sort=geodist()%20asc

...
|35| |
|ATCOCode|"370022835"|
|StopType|"BCT"|
|StopCategory|"Bus"|
|location| |
|0|"53.3813701862,-1.4650627934"|
|_version_|1614979438316880000|
|dist|0.096849374|
|36| |
|ATCOCode|"502432214"|
|StopType|"BCS"|
|StopCategory|"Bus"|
|location| |
|0|"POLYGON ((-1.4646256 53.3796518, -1.4635259 53.3796806, -1.4636171 
53.3805894, -1.4627105 53.3810406, -1.4647973 53.3811781, -1.4646256 
53.3796518))"|
|_version_|1615121382652248000|
|dist|20015.115|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to