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

Ignacio Vera commented on LUCENE-7906:
--------------------------------------

Hi [~daddywri],

The problem with convex polygons is that the whole plane is within the shape 
and therefore if you try to bound the intersection with the convex polygon you 
get OVERLAP when the shape is actually WITHIN. What it holds true is that the 
bounds for an intersection for convex polygons are the ones defined by the 
convex counter part. Therefore I need to invert the shape to bound the 
intersection. The class variable is to cash the object so it is only created 
once. Does it make sense?

I will try to implement randomized tests as well but it will take a bit longer 
because I have never used the framework and I am actually having problems 
running those tests (environment issues).

Finally, I want to go back to the idea of moving GeoArea down to GeoShape. If 
the implementation for polygons is valid, it means that any shape that can 
implement the new interface method intersects(GeoShape geoShape) can implement 
GeoArea. You were concerned about circle intersection but I think it is a 
trivial implementation. We only need to add the interface GeoOutsideDistance to 
GeoShape which is free as all shapes already implement the interface. Then 
intersection is trivial by calculating the distance of the shape to the center 
of the circle. What do you think?

Cheers,

Ignacio

  



> Spatial relationship between Geoshapes
> --------------------------------------
>
>                 Key: LUCENE-7906
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7906
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/spatial3d
>            Reporter: Ignacio Vera
>            Assignee: Karl Wright
>         Attachments: LUCENE-7906.patch
>
>
> Hi,
> Working with geosahpes and trying to resolve spatial relationships between 
> them I came accross a big limitation when trying to solve the relationship 
> between two geopolygons. This object does not expose the internal structure. 
> In particular at some point, it is necessary to check if one polygon 
> intersects the edges of the other polygon which currently is not possible as 
> edges are not exposed.
> To be able to perform such operation it can be several options. The ones I 
> can think of are:
> 1) Expose the edges of the polygon ( and probably the notable points for the 
> edges) adding getters in the GeoPolygon interface. Easy to implement and 
> leave users the responsability of coding the spatial relationship.
> 2) Extends GeoPolygon interface to extends geoarea and leave the object make 
> the spatial relationship. 
> 3) Extends GeoShape  interface so all shapes can infer the spatial 
> relationship with other GeoShapes.
> I might be bias as my interest is in 2d Shapes in the unit sphere and there 
> might be some cases which what I propose cannot be implemented or are againts 
> the aim of the library.
> What do you think?
> Cheers,
> Ignacio



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to