Issue 13443

Occurrence search breaks on some bounding boxes

13443
Reporter: omeyn
Assignee: fmendez
Type: Bug
Summary: Occurrence search breaks on some bounding boxes
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2013-07-03 10:00:40.497
Updated: 2013-12-17 15:16:47.391
Resolved: 2013-07-29 13:44:40.932
        
Description: From occurrence search, adding a location filter sometimes produces the following exception in the occurrence-ws:

ERROR [2013-07-03 09:48:52,146+0200] [http-8080-4] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/occurrence-ws].[default]: Servlet.service() for servlet default threw exception
org.apache.solr.common.SolrException: com.spatial4j.core.exception.InvalidShapeException: Too few distinct points in geometry component at or near point (-115.312, 33.724, NaN)
        at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:404) ~[solr-solrj-4.1.0.jar:4.1.0 1434440 - sarowe - 2013-01-16 17:23:10]
        at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:181) ~[solr-solrj-4.1.0.jar:4.1.0 1434440 - sarowe - 2013-01-16 17:23:10]
        at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90) ~[solr-solrj-4.1.0.jar:4.1.0 1434440 - sarowe - 2013-01-16 17:23:10]
        at org.apache.solr.client.solrj.SolrServer.query(SolrServer.java:301) ~[solr-solrj-4.1.0.jar:4.1.0 1434440 - sarowe - 2013-01-16 17:23:10]
        at org.gbif.occurrencestore.search.OccurrenceSearchImpl.search(OccurrenceSearchImpl.java:106) ~[occurrence-search-0.6-SNAPSHOT.jar:0.6-SNAPSHOT]
        at org.gbif.occurrencestore.search.OccurrenceSearchImpl.search(OccurrenceSearchImpl.java:43) ~[occurrence-search-0.6-SNAPSHOT.jar:0.6-SNAPSHOT]

And example url that causes it is: http://uat.gbif.org/occurrence/search?GEOMETRY=-115.312+33.724%2C-115.312+33.724%2C-115.312+33.724%2C-115.312+33.724%2C-115.312+33.724

On closer inspection, this url is attempting to make a bounding box of the same point 4 times, which explains the solr error. But it was created from the normal Location filter interface and produced a rectangle originally, so it looks like sometimes the closing point of a rectangle is not captured?]]>
    


Author: fmendez@gbif.org
Created: 2013-07-29 13:44:40.96
Updated: 2013-07-29 13:44:40.96
        
Bounding box search failed when the polygon submitted were either too small, a point or a line.

http://code.google.com/p/gbif-portal/source/detail?r=1742
http://code.google.com/p/gbif-common-resources/source/detail?r=1587
http://code.google.com/p/gbif-occurrencestore/source/detail?r=2081
http://code.google.com/p/gbif-portal/source/detail?r=1743