You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Chris Male (JIRA)" <ji...@apache.org> on 2009/12/11 14:07:18 UTC
[jira] Created: (LUCENE-2148) Improve Spatial Point2D and Rectangle
Classes
Improve Spatial Point2D and Rectangle Classes
---------------------------------------------
Key: LUCENE-2148
URL: https://issues.apache.org/jira/browse/LUCENE-2148
Project: Lucene - Java
Issue Type: Improvement
Components: contrib/spatial
Affects Versions: 3.1
Reporter: Chris Male
The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Commented: (LUCENE-2148) Improve Spatial Point2D and
Rectangle Classes
Posted by "Chris Male (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789370#action_12789370 ]
Chris Male commented on LUCENE-2148:
------------------------------------
Hi Simon,
Yes I think thats a great idea. Although it does set me back on the issues I have just created, but thats okay I can remake those patches.
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Updated: (LUCENE-2148) Improve Spatial Point2D and Rectangle
Classes
Posted by "Chris Male (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Male updated LUCENE-2148:
-------------------------------
Attachment: LUCENE-2148.patch
Added patch
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Attachments: LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Commented: (LUCENE-2148) Improve Spatial Point2D and
Rectangle Classes
Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789326#action_12789326 ]
Simon Willnauer commented on LUCENE-2148:
-----------------------------------------
Chris, we have to keep in mind that this code has already been released so we should not remove all those methods. We should rather go the deprecation way and mark everything which should go away as deprectaed. I really want to see those Point etc stuff being immutable but I would feel better if we could mark them as deprecated and add some comment like @deprected use foo(int) instead.
Futher I would keep the equals and hashcode method just in case somebody uses them in any datastructure relying on those methods.Remember they could be used as a cache key in a bounding box or something similar.
simon
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Updated: (LUCENE-2148) Improve Spatial Point2D and Rectangle
Classes
Posted by "Chris Male (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Male updated LUCENE-2148:
-------------------------------
Attachment: LUCENE-2148.patch
Patch differs considerably from previous one in that it makes no deletes or renames to the existing code. Instead it contains the following changes:
- Deprecates all classes in geometry.shape
- Adds simpler immutable Point class to geometry package. This will be used instead of Point2D in remaining work
- Adds simpler LatLngRectangle class to geometry package. This will be used instead of LLRect in remaining work
- Deprecates geometry.CartesianPoint
- Changes LatLng to a concrete class (instead of abstract), deprecates most of its methods and cleans up the ones that should remain
- Deprecates FloatLatLng and FixedLatLng since they are replaced by the logic in LatLng.
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch, LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Commented: (LUCENE-2148) Improve Spatial Point2D and
Rectangle Classes
Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794846#action_12794846 ]
Simon Willnauer commented on LUCENE-2148:
-----------------------------------------
Chris, a couple of comments on the latest patch:
We should remove the flux warning from new classes IMO.
In LatLngRectangle we should make 180 and 90 doubles for consistency.
those two local vars are unnecessary and meaningless IMO could move in a bit down in the code, see snippet?!
{code}
private static LatLng boxCorner(LatLng centre, double width, double degrees) {
double a = centre.getLat();
double b = centre.getLng();
...
// could move them into this calc?!
// double lat1 = Math.PI * centre.getLat() / 180d;
// double lng1 = Math.PI * centre.getLng() / 180d;
{code}
We could simplify some conditional statments like the snipped below
{code}
private static LatLng normLat(double lat, double lng) {
...
if (lng < 0) {
lng = lng + 180;
} else {
lng = lng - 180;
}
// simplify those conditionals
lng += lng < 0 ? 180d: -180d; // something like that
{code}
In LatLng should we make those degree constants double instead of int?!
{code}
public class LatLng {
private final static int LONGITUDE_DECIMAL_DEGREE_RANGE = 360;
private final static int LATITUDE_DECIMAL_DEGREE_RANGE = 180;
{code}
The deprecation comments should say something like:
@deprecated this class is unused and will be removed in a future release.
if we have a replacement for the class / method use something like:
@deprecated use Foo#bar(int) instead. This method / class will be removed in a future release
One more thing, I'm not sure if the @Deprecated annotations are necessary though @deprecated in javadoc seems to be the lucene way so far. Not sure about that though.
Except of those very minor things this seems to be very close to be ready!
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch, LUCENE-2148.patch, LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Updated: (LUCENE-2148) Improve Spatial Point2D and Rectangle
Classes
Posted by "Chris Male (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Male updated LUCENE-2148:
-------------------------------
Attachment: LUCENE-2148.patch
Added full deprecation annotations
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch, LUCENE-2148.patch, LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Assigned: (LUCENE-2148) Improve Spatial Point2D and
Rectangle Classes
Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simon Willnauer reassigned LUCENE-2148:
---------------------------------------
Assignee: Simon Willnauer
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Updated: (LUCENE-2148) Improve Spatial Point2D and Rectangle
Classes
Posted by "Chris Male (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Male updated LUCENE-2148:
-------------------------------
Attachment: LUCENE-2148.patch
Attached new patch incorporating Simon's suggestions.
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch, LUCENE-2148.patch, LUCENE-2148.patch, LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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
[jira] Commented: (LUCENE-2148) Improve Spatial Point2D and
Rectangle Classes
Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-2148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789365#action_12789365 ]
Simon Willnauer commented on LUCENE-2148:
-----------------------------------------
Chris, with my BW compat hat on I would say it would make way more sense to deprecate all classes in the geometry/shape package and add your Point.java class from to LUCENE-2139 to geometry. That way we do not break anybodies code, get rid of the shape subpackage in the next release and everybody has a heads up. It is also simpler for us though. As far as I can see the only class use is LLRect which and that is rarely used anyway AND will be replaced by LatLngRectangle anyway which is in LUCENE-2139.
Thoughts?
> Improve Spatial Point2D and Rectangle Classes
> ---------------------------------------------
>
> Key: LUCENE-2148
> URL: https://issues.apache.org/jira/browse/LUCENE-2148
> Project: Lucene - Java
> Issue Type: Improvement
> Components: contrib/spatial
> Affects Versions: 3.1
> Reporter: Chris Male
> Assignee: Simon Willnauer
> Attachments: LUCENE-2148.patch
>
>
> The Point2D and Rectangle classes have alot of duplicate, redundant and used functionality. This issue cleans them both up and simplifies the functionality they provide.
> Subsequent to this, Eclipse and LineSegment, which depend on Point2D, are not used anywhere in the contrib, therefore rather than trying to update them to use the improved Point2D, they will be removed.
--
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