Issue 15392

Points found outside polygon passed to geometry parameter

15392
Reporter: feedback bot
Assignee: fmendez
Type: Bug
Summary: Points found outside polygon passed to geometry parameter
Priority: Blocker
Resolution: Fixed
Status: Resolved
Created: 2014-03-17 22:08:12.017
Updated: 2014-04-23 17:17:06.233
Resolved: 2014-04-23 17:17:06.201
        
        
Description: Hello!

The following query returns a point that is outside of the polygon passed to the geometry parameter. Do you know why this may happen?

http://api.gbif.org/v0.9/occurrence/search?taxonKey=7249709&georeferenced=true&spatialIssues=false&limit=15&geometry=POLYGON((-90 -23.0, 90 -23.0, 90 23.0, -90 23.0, -90 -23.0))

{
...
longitude: 29.875,
latitude: -23.875,
...
}

Thanks! Scott Chamberlain

*Reporter*: Scott Chamberlain
*E-mail*: [mailto:scott@ropensci.org]]]>
    


Author: fmendez@gbif.org
Created: 2014-04-23 16:49:09.09
Updated: 2014-04-23 17:03:03.527
        
This bug looks very strange:
http://api.gbif.org/v0.9/occurrence/search?taxonKey=7249709&georeferenced=true&spatialIssues=false&geometry=POLYGON%28%28-90%20-23.0,%2090%20-23.0,%2090%2023.0,%20-90%2023.0,%20-90%20-23.0%29%29 returns the suspicious record (occ key 453247681)
 also returns 14 results


but Solr doesn't return that record:

http://apps.gbif.org:8081/occurrence-solr/select?q=*:*&fq=taxon_key:7249709%20AND%20has_coordinate:true%20AND%20spatial_issues:false%20AND%20coordinate:%22Intersects%28POLYGON%28%28-90%20-23,%2090%20-23,%2090%2023,%20-90%2023,%20-90%20-23%29%29%29+distErrPct=0%22

returns 13 results (occurrence 453247681 is not in the result)


the bounding box query returns 14 results:

http://apps.gbif.org:8081/occurrence-solr/select?q=*%3A*&rows=20&start=0&fq=%28spatial_issues%3Afalse%29+AND+%28taxon_key%3A7249709%29+AND+%28coordinate%3A[-23.0%2C-90.0+TO+23.0%2C90.0]%29&sort=year+desc%2Cmonth+asc


seems that the problem is the bounding box query....maybe is better to use polygon searches always
    


Author: fmendez@gbif.org
Created: 2014-04-23 17:17:06.231
Updated: 2014-04-23 17:17:06.231
        
Bounding boxes in range format were not performing accurate searches in 1 meter distance:
https://github.com/gbif/occurrence/commit/84411e79ca8ab98812d0cc003978c40c0bb9933f