You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by regina <re...@ayende.com> on 2014/05/22 14:45:24 UTC

relationships between shapes in Lucene-Spatial

Hi,
I am looking into how Lucene-Spatial handles relationships between shapes,
and seeing some weird (or at least I think that they are weird) results. 
I am trying to work out how the relationships are calculated and I believe I
understand the theory behind it.
The results I am seeing, does not fit into the theory I've read up to now.
For example:
I am trying to test whether POLYGON ((4.5 4.5, 6.5 4.5, 6.5 6.5, 4.5 6.5,
4.5 4.5)) is within POLYGON ((6 6, 7 6, 7 7, 6 7, 6 6)). Surprisingly, I am
seeing that it is "within". 
I am trying this with GeohashPrefixTree strategy and max tree level 8. 

Is this the answer that should be getting, or am I doing something wrong?

It should be noted that I am using .Net port of Lucene-Spatial to query
this.




--
View this message in context: http://lucene.472066.n3.nabble.com/relationships-between-shapes-in-Lucene-Spatial-tp4137641.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: relationships between shapes in Lucene-Spatial

Posted by Itamar Syn-Hershko <it...@code972.com>.
You have to remember there is a margin error of about 2.5%. The Lucene.NET
port is in par with spatial4j 0.3.

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Author of RavenDB in Action <http://manning.com/synhershko/>


On Thu, May 22, 2014 at 3:45 PM, regina <re...@ayende.com> wrote:

> Hi,
> I am looking into how Lucene-Spatial handles relationships between shapes,
> and seeing some weird (or at least I think that they are weird) results.
> I am trying to work out how the relationships are calculated and I believe
> I
> understand the theory behind it.
> The results I am seeing, does not fit into the theory I've read up to now.
> For example:
> I am trying to test whether POLYGON ((4.5 4.5, 6.5 4.5, 6.5 6.5, 4.5 6.5,
> 4.5 4.5)) is within POLYGON ((6 6, 7 6, 7 7, 6 7, 6 6)). Surprisingly, I am
> seeing that it is "within".
> I am trying this with GeohashPrefixTree strategy and max tree level 8.
>
> Is this the answer that should be getting, or am I doing something wrong?
>
> It should be noted that I am using .Net port of Lucene-Spatial to query
> this.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/relationships-between-shapes-in-Lucene-Spatial-tp4137641.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>

Re: relationships between shapes in Lucene-Spatial

Posted by "david.w.smiley@gmail.com" <da...@gmail.com>.
Hi,

Itamar’s comment should be helpful to you.  Try setting a query-time
distErrPct of 0 (exact to the grid), keeping the default index time of
2.5%.  When I dig into problems like this, I often bring up
SpatialSolrSandbox, the “Playground” page, and put in the WKT to generate a
KML that I view in Google Earth.

Note that as of Lucene-spatial v4.7 there is the new SerializedDVStrategy
which, when used in conjunction with the grid, should eliminate any
inexactness introduced by the grid.  See my blog post on this subject:
http://www.opensourceconnections.com/blog/2014/04/11/indexing-polygons-in-lucene-with-accuracy/

~ David Smiley
Freelance Apache Lucene/Solr Search Consultant/Developer
http://www.linkedin.com/in/davidwsmiley


On Thu, May 22, 2014 at 8:45 AM, regina <re...@ayende.com> wrote:

> Hi,
> I am looking into how Lucene-Spatial handles relationships between shapes,
> and seeing some weird (or at least I think that they are weird) results.
> I am trying to work out how the relationships are calculated and I believe
> I
> understand the theory behind it.
> The results I am seeing, does not fit into the theory I've read up to now.
> For example:
> I am trying to test whether POLYGON ((4.5 4.5, 6.5 4.5, 6.5 6.5, 4.5 6.5,
> 4.5 4.5)) is within POLYGON ((6 6, 7 6, 7 7, 6 7, 6 6)). Surprisingly, I am
> seeing that it is "within".
> I am trying this with GeohashPrefixTree strategy and max tree level 8.
>
> Is this the answer that should be getting, or am I doing something wrong?
>
> It should be noted that I am using .Net port of Lucene-Spatial to query
> this.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/relationships-between-shapes-in-Lucene-Spatial-tp4137641.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>