lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Helleringer (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-2359) CartesianPolyFilterBuilder doesn't handle edge case around the 180 meridian
Date Sat, 03 Apr 2010 15:59:27 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-2359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nicolas Helleringer updated LUCENE-2359:
----------------------------------------

    Attachment: LUCENE-2359.patch

Here is the re worked patch, sorry for the formatting :s

This patch  :

- handles East AND West tiles when close to the prime meridian (either by 0 or by 180 values)
where yours only catch East ones
- reworks the logic to have algorithm in the code logic instead of in variables values
- gives variavbles full names to better understand the code logic
- separates the logic of handling the prime meridian which stays in getBoxShape from the logic
of add boxes to the shape in addBoxes : addBoxes is called one time in normal case and two
times for search area crossing the prime meridian (half by half)

Hope it better fits your need now

> CartesianPolyFilterBuilder doesn't handle edge case around the 180 meridian
> ---------------------------------------------------------------------------
>
>                 Key: LUCENE-2359
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2359
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/spatial
>    Affects Versions: 2.9, 2.9.1, 2.9.2, 3.0, 3.0.1
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>         Attachments: LUCENE-2359.patch, LUCENE-2359.patch, LUCENE-2359.patch
>
>
> Test case:  
> Points all around the globe, plus two points at 0, 179.9 and 0,-179.9 (on each side of
the meridian).  Then, do a Cartesian Tier filter on a point right near those two.  It will
return all the points when it should just return those two.
> The flawed logic is in the else clause below:
> {code}
> if (longX2 != 0.0) {
> 		//We are around the prime meridian
> 		if (longX == 0.0) {
> 			longX = longX2;
> 			longY = 0.0;
>         	shape = getShapeLoop(shape,ctp,latX,longX,latY,longY);
> 		} else {//we are around the 180th longitude
> 			longX = longX2;
> 			longY = -180.0;
> 			shape = getShapeLoop(shape,ctp,latY,longY,latX,longX);
> 	}
> {code}
> Basically, the Y and X values are transposed.  This currently says go from longY (-180)
all the way around  to longX which is the lower left longitude of the box formed.  Instead,
it should go from the lower left long to -180.

-- 
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


Mime
View raw message