[
https://issues.apache.org/jira/browse/LUCENE-7951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16164316#comment-16164316
]
ASF GitHub Bot commented on LUCENE-7951:
----------------------------------------
Github user iverase commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/246#discussion_r138555768
--- Diff:
lucene/spatial-extras/src/java/org/apache/lucene/spatial/spatial4j/Geo3dShape.java
---
@@ -96,45 +95,25 @@ else if (relationship == GeoArea.DISJOINT)
}
protected SpatialRelation relate(Point p) {
- // Create a GeoPoint
- GeoPoint point = new GeoPoint(planetModel, p.getY()*
DistanceUtils.DEGREES_TO_RADIANS, p.getX()* DistanceUtils.DEGREES_TO_RADIANS);
+ GeoPoint point = new GeoPoint(shape.getPlanetModel(), p.getY()*
DistanceUtils.DEGREES_TO_RADIANS, p.getX()* DistanceUtils.DEGREES_TO_RADIANS);
if (shape.isWithin(point)) {
- // Point within shape
return SpatialRelation.CONTAINS;
}
return SpatialRelation.DISJOINT;
}
-
-
@Override
public Rectangle getBoundingBox() {
Rectangle bbox = this.boundingBox;//volatile read once
if (bbox == null) {
LatLonBounds bounds = new LatLonBounds();
shape.getBounds(bounds);
- double leftLon;
- double rightLon;
- if (bounds.checkNoLongitudeBound()) {
- leftLon = -180.0;
- rightLon = 180.0;
- } else {
- leftLon = bounds.getLeftLongitude().doubleValue() *
DistanceUtils.RADIANS_TO_DEGREES;
- rightLon = bounds.getRightLongitude().doubleValue() *
DistanceUtils.RADIANS_TO_DEGREES;
- }
- double minLat;
- if (bounds.checkNoBottomLatitudeBound()) {
- minLat = -90.0;
- } else {
- minLat = bounds.getMinLatitude().doubleValue() *
DistanceUtils.RADIANS_TO_DEGREES;
- }
- double maxLat;
- if (bounds.checkNoTopLatitudeBound()) {
- maxLat = 90.0;
- } else {
- maxLat = bounds.getMaxLatitude().doubleValue() *
DistanceUtils.RADIANS_TO_DEGREES;
- }
- bbox = new RectangleImpl(leftLon, rightLon, minLat, maxLat,
ctx).getBuffered(ROUNDOFF_ADJUSTMENT, ctx);
--- End diff --
Yes, it seems not necessary. Not sure what was needed before but I am glad
that we can hopefully get rid of that.
> New wrapper classes for Geo3d
> -----------------------------
>
> Key: LUCENE-7951
> URL: https://issues.apache.org/jira/browse/LUCENE-7951
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/spatial-extras
> Reporter: Ignacio Vera
> Assignee: David Smiley
> Priority: Minor
> Attachments: LUCENE_7951_build.patch, LUCENE_7951_build.patch,
> LUCENE-7951.patch, LUCENE-7951.patch
>
>
> Hi,
> After the latest developments in the Geo3d library, in particular:
> [https://issues.apache.org/jira/browse/LUCENE-7906] : Spatial relationships
> between GeoShapes
> [https://issues.apache.org/jira/browse/LUCENE-7936]: Serialization of
> GeoShapes.
> I propose a new set of wrapper classes which can be for example linked to
> Solr as they implement their own SpatialContextFactory. It provides the
> capability of indexing shapes with
> spherical geometry.
> Thanks!
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]