You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2009/08/06 12:08:14 UTC

[jira] Commented: (LUCENE-1781) Large distances in Spatial go beyond Prime MEridian

    [ https://issues.apache.org/jira/browse/LUCENE-1781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739974#action_12739974 ] 

Michael McCandless commented on LUCENE-1781:
--------------------------------------------

So, here's one thing that worries me about this change... note that my grasp of geographic math is very tenuous at best, so what follows could be pure folly:

Say the latitude must wrap around, because it's 110.  This means (I think) that the this point has crossed over the north pole.

With this patch, we'll simply map that 110 to 90 - (110 - 90) = 70.

But shouldn't we also be flipping the longitude 180 degrees whenever the latitude crosses the north pole?  Ie, in crossing the north pole, the point has moved to the other side of the earth.  We aren't, with the current patch, which I think means the normalization simply bounces the point back where it came from, which doesn't seem right?

Also, the code has this spooky TODO which looks relevant to this discussion:

{code}
    // TODO: Prob only works in northern hemisphere?
{code}

I'm a little too nervous to commit this patch as is... I'm going to clear it from 2.9 for now.  I'm hoping someone with a strong grasp of lat/long math can step in and bring some clarity here, in time for 2.9...

> Large distances in Spatial go beyond Prime MEridian
> ---------------------------------------------------
>
>                 Key: LUCENE-1781
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1781
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>    Affects Versions: 2.9
>         Environment: All
>            Reporter: Bill Bell
>            Assignee: Michael McCandless
>             Fix For: 3.1
>
>         Attachments: LLRect.java, LUCENE-1781.patch
>
>
> http://amidev.kaango.com/solr/core0/select?fl=*&json.nl=map&wt=json&radius=5000&rows=20&lat=39.5500507&q=honda&qt=geo&long=-105.7820674
> Get an error when using Solr when distance is calculated for the boundary box past 90 degrees.
> Aug 4, 2009 1:54:00 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.IllegalArgumentException: Illegal lattitude value 93.1558669413734
>         at org.apache.lucene.spatial.geometry.FloatLatLng.<init>(FloatLatLng.java:26)
>         at org.apache.lucene.spatial.geometry.shape.LLRect.createBox(LLRect.java:93)
>         at org.apache.lucene.spatial.tier.DistanceUtils.getBoundary(DistanceUtils.java:50)
>         at org.apache.lucene.spatial.tier.CartesianPolyFilterBuilder.getBoxShape(CartesianPolyFilterBuilder.java:47)
>         at org.apache.lucene.spatial.tier.CartesianPolyFilterBuilder.getBoundingArea(CartesianPolyFilterBuilder.java:109)
>         at org.apache.lucene.spatial.tier.DistanceQueryBuilder.<init>(DistanceQueryBuilder.java:61)
>         at com.pjaol.search.solr.component.LocalSolrQueryComponent.prepare(LocalSolrQueryComponent.java:151)
>         at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
>         at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
>         at org.apache.solr.core.SolrCore.execute(SolrCore.java:1328)
>         at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:341)
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:244)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>         at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
>         at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
>         at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
>         at java.lang.Thread.run(Thread.java:619)

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org