polygon self-crossing

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

polygon self-crossing

rgamarra
Hi there all,

I'm using the RPT field type to perform geospatial polygonal searches (e.g.
https://cwiki.apache.org/confluence/display/solr/Spatial+Search)/

How do you recommend with self-crossing polygons (8 figure or bow-tie, for
example)?

Decompose it in a multi polygon? Setting to "none" validation rule: in what
cases the unexpected behavior arises?

or, configure different validation rules at the schema level?

According to https://lucene.apache.org/core/6_2_0/core/org/apache/
lucene/geo/Polygon.html

   1. The polygon must not be self-crossing, otherwise may result in
   unexpected behavior.

The expected behavior of the search is that of searching for points in each
of the lobes of the 8 figure, for the example given.

Best regards


--
Rodolfo Federico Gamarra
Reply | Threaded
Open this post in threaded view
|

Re: polygon self-crossing

rgamarra
Sorry, I'd like to add further information regarding the validation rule.

My question comes because of what's said in the doc link at the bottom.

What kind of unexpected behavior can happen?

none

Geometries will not be validated (because it's kinda expensive to
calculate). You may or may not ultimately get an error at some point;
results are undefined.

https://locationtech.github.io/spatial4j/apidocs/com/
spatial4j/core/context/jts/ValidationRule.html

--
Rodolfo Federico Gamarra

On Sun, Jun 4, 2017 at 9:41 PM, rgamarra <[hidden email]> wrote:

> Hi there all,
>
> I'm using the RPT field type to perform geospatial polygonal searches
> (e.g. https://cwiki.apache.org/confluence/display/solr/Spatial+Search)/
>
> How do you recommend with self-crossing polygons (8 figure or bow-tie, for
> example)?
>
> Decompose it in a multi polygon? Setting to "none" validation rule: in
> what cases the unexpected behavior arises?
>
> or, configure different validation rules at the schema level?
>
> According to https://lucene.apache.org/core/6_2_0/core/org/apache/lucene/
> geo/Polygon.html
>
>    1. The polygon must not be self-crossing, otherwise may result in
>    unexpected behavior.
>
> The expected behavior of the search is that of searching for points in
> each of the lobes of the 8 figure, for the example given.
>
> Best regards
>
>
> --
> Rodolfo Federico Gamarra
>
Reply | Threaded
Open this post in threaded view
|

Re: polygon self-crossing

Nitin Kumar
In reply to this post by rgamarra
Yes, decompose into multi polygon.

On 05-Jun-2017 6:11 AM, "rgamarra" <[hidden email]> wrote:

> Hi there all,
>
> I'm using the RPT field type to perform geospatial polygonal searches (e.g.
> https://cwiki.apache.org/confluence/display/solr/Spatial+Search)/
>
> How do you recommend with self-crossing polygons (8 figure or bow-tie, for
> example)?
>
> Decompose it in a multi polygon? Setting to "none" validation rule: in what
> cases the unexpected behavior arises?
>
> or, configure different validation rules at the schema level?
>
> According to https://lucene.apache.org/core/6_2_0/core/org/apache/
> lucene/geo/Polygon.html
>
>    1. The polygon must not be self-crossing, otherwise may result in
>    unexpected behavior.
>
> The expected behavior of the search is that of searching for points in each
> of the lobes of the 8 figure, for the example given.
>
> Best regards
>
>
> --
> Rodolfo Federico Gamarra
>
Reply | Threaded
Open this post in threaded view
|

Re: polygon self-crossing

rgamarra
Thanks for prompt answer.

Any recommendation to perform that operation in java?

The different simplify @ jst don't work as expected  (eg they lose one of
lobes).

Best

On Jun 4, 2017 9:54 PM, "Nitin Kumar" <[hidden email]> wrote:

> Yes, decompose into multi polygon.
>
> On 05-Jun-2017 6:11 AM, "rgamarra" <[hidden email]> wrote:
>
> > Hi there all,
> >
> > I'm using the RPT field type to perform geospatial polygonal searches
> (e.g.
> > https://cwiki.apache.org/confluence/display/solr/Spatial+Search)/
> >
> > How do you recommend with self-crossing polygons (8 figure or bow-tie,
> for
> > example)?
> >
> > Decompose it in a multi polygon? Setting to "none" validation rule: in
> what
> > cases the unexpected behavior arises?
> >
> > or, configure different validation rules at the schema level?
> >
> > According to https://lucene.apache.org/core/6_2_0/core/org/apache/
> > lucene/geo/Polygon.html
> >
> >    1. The polygon must not be self-crossing, otherwise may result in
> >    unexpected behavior.
> >
> > The expected behavior of the search is that of searching for points in
> each
> > of the lobes of the 8 figure, for the example given.
> >
> > Best regards
> >
> >
> > --
> > Rodolfo Federico Gamarra
> >
>