lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1781) Large distances in Spatial go beyond Prime MEridian
Date Sat, 08 Aug 2009 09:21:14 GMT


Michael McCandless commented on LUCENE-1781:

OK the new normLat looks like it handles crossing the pole now, by flipping the lng; thanks.

Can you add a unit test that confirms this was a problem before, and that the new lng-flipping
resolves it?  Probably if you just modify TestCartesian, to add a new point, and then add
a new test cast that starts from a lat/lng that's near the pole, you could get the issue to
happen & be resolved.

Also, can use "svn diff" and post the resulting output (instead of the whole copy of each
source file)?  Thanks.

bq. The current Spatial ONLY works for one hemisphere at a time.

Actually, shouldn't LLRect work fine if a rect crosses the equator?   Or, a pole?  What I
think it cannot handle is crossing the anti-meridian?  (Because, when that projects out, you'll
need 2 rectangles, on opposite sides, to handle it?).  I'm not sure what LLRect should even
do if it finds it "needs" to cross the anti-meridian.  If it had the ability to return 2 rectangles
I think it could be fixed.

Or are you saying there are further limitations in contrib/spatial (ie, not caused by LLRect)
that cause it to only work within one hemisphere?

As for the "we get no results when radius is very large" bug, I like the theory that the corners
need to be flipped.  Or, it could be the rect tried to cross the anti-meridian, and once we
fix that, this case will also be fixed.  Finally, it could also be we simply have to floor
the the lat after normalizing.  Ie before normalizing we get a ridiculous lat, say 1000.0,
which normLat cannot handle since it can only "undo" at most "off by 90".  I think normLat
may need to be changed so that if it still sees lat/lng out of bounds after doing it's normalization,
it simply floors the resulting lat?  Can you add a test case for this case as well?  We may
as well get test cases for all the problems we're uncovering... then as we iterate on the
patches we can see if they are fixed.

> Large distances in Spatial go beyond Prime MEridian
> ---------------------------------------------------
>                 Key: LUCENE-1781
>                 URL:
>             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:,, LUCENE-1781.patch
> Get an error when using Solr when distance is calculated for the boundary box past 90
> 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>(
>         at org.apache.lucene.spatial.geometry.shape.LLRect.createBox(
>         at org.apache.lucene.spatial.tier.DistanceUtils.getBoundary(
>         at org.apache.lucene.spatial.tier.CartesianPolyFilterBuilder.getBoxShape(
>         at org.apache.lucene.spatial.tier.CartesianPolyFilterBuilder.getBoundingArea(
>         at org.apache.lucene.spatial.tier.DistanceQueryBuilder.<init>(
>         at
>         at org.apache.solr.handler.component.SearchHandler.handleRequestBody(
>         at org.apache.solr.handler.RequestHandlerBase.handleRequest(
>         at org.apache.solr.core.SolrCore.execute(
>         at org.apache.solr.servlet.SolrDispatchFilter.execute(
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(
>         at org.apache.catalina.core.StandardWrapperValve.invoke(
>         at org.apache.catalina.core.StandardContextValve.invoke(
>         at org.apache.catalina.core.StandardHostValve.invoke(
>         at org.apache.catalina.valves.ErrorReportValve.invoke(
>         at org.apache.catalina.core.StandardEngineValve.invoke(
>         at org.apache.catalina.connector.CoyoteAdapter.service(
>         at org.apache.coyote.http11.Http11AprProcessor.process(
>         at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(
>         at$
>         at

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:
For additional commands, e-mail:

View raw message