[jira] [Commented] (LUCENE-7938) Bounds of bounding box are not equal to bounding box

2017-08-22 Thread Ignacio Vera (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16136623#comment-16136623
 ] 

Ignacio Vera commented on LUCENE-7938:
--

Ok, understood!

> Bounds of bounding box are not equal to bounding box
> 
>
> Key: LUCENE-7938
> URL: https://issues.apache.org/jira/browse/LUCENE-7938
> Project: Lucene - Core
>  Issue Type: Bug
>Reporter: Ignacio Vera
>Assignee: Karl Wright
>Priority: Minor
> Attachments: LUCENE-7938-fix.patch, LUCENE-7938-test.patch
>
>
> Hi,
> It seems if I get the bounds of a BBox and I create a new bounding box, 
> sometimes both bounding box are not equal. It is a problem with precision.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7938) Bounds of bounding box are not equal to bounding box

2017-08-22 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16136570#comment-16136570
 ] 

Karl Wright commented on LUCENE-7938:
-

{quote}
As we know, the bounds of this object are the points. No need to add the planes 
as they introduce numerical imprecision.
{quote}

[~ivera], unfortunately that is not true.  This is a complex issue because 
planes that are *almost* but *not quite* coplanar define shapes that actually 
do have points on the opposite side of the world, within the precision limit of 
geo3d.  Random tests picked this up and I had to introduce addIntersection() to 
deal with this situation, since I could not see a better way to handle very 
thin rectangles using planes.  Polygons also have this issue.



> Bounds of bounding box are not equal to bounding box
> 
>
> Key: LUCENE-7938
> URL: https://issues.apache.org/jira/browse/LUCENE-7938
> Project: Lucene - Core
>  Issue Type: Bug
>Reporter: Ignacio Vera
>Assignee: Karl Wright
>Priority: Minor
> Attachments: LUCENE-7938-fix.patch, LUCENE-7938-test.patch
>
>
> Hi,
> It seems if I get the bounds of a BBox and I create a new bounding box, 
> sometimes both bounding box are not equal. It is a problem with precision.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7938) Bounds of bounding box are not equal to bounding box

2017-08-22 Thread Ignacio Vera (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16136374#comment-16136374
 ] 

Ignacio Vera commented on LUCENE-7938:
--

"there are indeed some rare cases where it is difficult to compute the bounding 
box and we return a larger box as a shortcut."

What I disagree is that computing the bounding box of a bounding box should not 
be difficult. There is another "fix"  for that to make sure a bounding box 
generates the same bounds of itself. Currently the method getBounds() for 
GeoRectangle does the following:

  @Override
  public void getBounds(Bounds bounds) {
super.getBounds(bounds);
bounds.addHorizontalPlane(planetModel, topLat, topPlane, bottomPlane, 
leftPlane, rightPlane)
  .addVerticalPlane(planetModel, rightLon, rightPlane, topPlane, 
bottomPlane, leftPlane)
  .addHorizontalPlane(planetModel, bottomLat, bottomPlane, topPlane, 
leftPlane, rightPlane)
  .addVerticalPlane(planetModel, leftLon, leftPlane, topPlane, bottomPlane, 
rightPlane)
  .addIntersection(planetModel, leftPlane, rightPlane, topPlane, 
bottomPlane)
  .addPoint(ULHC).addPoint(URHC).addPoint(LLHC).addPoint(LRHC);
  }

Probably it will be enoughif the method does the following:

  @Override
  public void getBounds(Bounds bounds) {
super.getBounds(bounds);
bounds.addPoint(ULHC).addPoint(URHC).addPoint(LLHC).addPoint(LRHC);
  }

As we know the bounds of this object are the points. No need to add the panes 
as they introduce numerical imprecision.

Cheers,

I. 

> Bounds of bounding box are not equal to bounding box
> 
>
> Key: LUCENE-7938
> URL: https://issues.apache.org/jira/browse/LUCENE-7938
> Project: Lucene - Core
>  Issue Type: Bug
>Reporter: Ignacio Vera
>Assignee: Karl Wright
>Priority: Minor
> Attachments: LUCENE-7938-fix.patch, LUCENE-7938-test.patch
>
>
> Hi,
> It seems if I get the bounds of a BBox and I create a new bounding box, 
> sometimes both bounding box are not equal. It is a problem with precision.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7938) Bounds of bounding box are not equal to bounding box

2017-08-21 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16135482#comment-16135482
 ] 

Karl Wright commented on LUCENE-7938:
-

[~ivera], this is by design.  Bounding boxes are supposed to *contain* the 
objects within; there are indeed some rare cases where it is difficult to 
compute the bounding box and we return a larger box as a shortcut.

Furthermore, you should not modify the "equals" method to allow a match that is 
not a precise object match; that's a violation of the contract of "equals".

I'm going to close this as "not a bug".



> Bounds of bounding box are not equal to bounding box
> 
>
> Key: LUCENE-7938
> URL: https://issues.apache.org/jira/browse/LUCENE-7938
> Project: Lucene - Core
>  Issue Type: Bug
>Reporter: Ignacio Vera
>Assignee: Karl Wright
>Priority: Minor
> Attachments: LUCENE-7938-fix.patch, LUCENE-7938-test.patch
>
>
> Hi,
> It seems if I get the bounds of a BBox and I create a new bounding box, 
> sometimes both bounding box are not equal. It is a problem with precision.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org