You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Steven Bower <sm...@alcyon.net> on 2014/03/10 21:21:30 UTC
Issue with spatial search
I am seeing a "error" when doing a spatial search where a particular point
is showing up within a polygon, but by all methods I've tried that point is
not within the polygon..
First the point is: 41.2299,29.1345 (lat/lon)
The polygon is:
31.2719,32.283
31.2179,32.3681
31.1333,32.3407
30.9356,32.6318
31.0707,34.5196
35.2053,36.9415
37.2959,36.6339
40.8334,30.4273
41.1622,29.1421
41.6484,27.4832
47.0255,13.6342
43.9457,3.17525
37.0029,-5.7017
35.7741,-5.57719
34.801,-4.66201
33.345,10.0157
29.6745,18.9366
30.6592,29.1683
31.2719,32.283
The geo field we are using has this config:
<fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
distErrPct="0.025"
maxDistErr="0.000009"
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
units="degrees"/>
The config is basically the same as the one from the docs...
They query I am issuing is this:
location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283 31.2719)))"
and it brings back a result where the "location" field is 41.2299,29.1345
I've attached a KML with the polygon and the point and you can see from
that, visually, that the point is not within the polygon. I also tried in
google maps API but after playing around realize that the polygons in maps
are draw in Euclidian space while the map itself is a Mercator projection..
Loading the kml in earth fixes this issue but the point still lays outside
the polygon.. The distance between the edge of the polygon closes to the
point and the point itself is ~1.2 miles which is much larger than the
1meter accuracy given by the maxDistErr (per the docs).
Any thoughts on this?
Thanks,
Steve
Re: Issue with spatial search
Posted by Steven Bower <sm...@alcyon.net>.
Weirdly that same point shows up in the polygon below as well, which in the
area around the point doesn't intersect with the polygon in my first msg...
29.0454,41.2198
29.2349,41.1826
31.1107,40.9956
38.437,40.7991
41.1616,40.8988
42.1284,42.2141
40.0919,47.8482
30.4169,47.5783
26.9892,43.6459
27.2095,41.5676
29.0454,41.2198
On Mon, Mar 10, 2014 at 4:23 PM, Steven Bower <sm...@alcyon.net> wrote:
> Minor edit to the KML to adjust color of polygon
>
>
> On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <sm...@alcyon.net>wrote:
>
>> I am seeing a "error" when doing a spatial search where a particular
>> point is showing up within a polygon, but by all methods I've tried that
>> point is not within the polygon..
>>
>> First the point is: 41.2299,29.1345 (lat/lon)
>>
>> The polygon is:
>>
>> 31.2719,32.283
>> 31.2179,32.3681
>> 31.1333,32.3407
>> 30.9356,32.6318
>> 31.0707,34.5196
>> 35.2053,36.9415
>> 37.2959,36.6339
>> 40.8334,30.4273
>> 41.1622,29.1421
>> 41.6484,27.4832
>> 47.0255,13.6342
>> 43.9457,3.17525
>> 37.0029,-5.7017
>> 35.7741,-5.57719
>> 34.801,-4.66201
>> 33.345,10.0157
>> 29.6745,18.9366
>> 30.6592,29.1683
>> 31.2719,32.283
>>
>> The geo field we are using has this config:
>>
>> <fieldType name="location_rpt"
>> class="solr.SpatialRecursivePrefixTreeFieldType"
>> distErrPct="0.025"
>> maxDistErr="0.000009"
>>
>> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
>> units="degrees"/>
>>
>> The config is basically the same as the one from the docs...
>>
>> They query I am issuing is this:
>>
>> location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
>> 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
>> 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
>> 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
>> 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283 31.2719)))"
>>
>> and it brings back a result where the "location" field is 41.2299,29.1345
>>
>> I've attached a KML with the polygon and the point and you can see from
>> that, visually, that the point is not within the polygon. I also tried in
>> google maps API but after playing around realize that the polygons in maps
>> are draw in Euclidian space while the map itself is a Mercator projection..
>> Loading the kml in earth fixes this issue but the point still lays outside
>> the polygon.. The distance between the edge of the polygon closes to the
>> point and the point itself is ~1.2 miles which is much larger than the
>> 1meter accuracy given by the maxDistErr (per the docs).
>>
>> Any thoughts on this?
>>
>> Thanks,
>>
>> Steve
>>
>
>
Re: Issue with spatial search
Posted by "David Smiley (@MITRE.org)" <DS...@mitre.org>.
It controls accuracy of non-point shapes. The more accurate you want it, the more work Lucene must do to achieve it. For query shapes, the impact is not much the last time I checked. For indexed shapes (again, non-point shapes we’re talking about), however, it has an exponential curve trade-off where it’s increasingly painful to get close to distErrPct=0 if the shapes cover a large area. I have near-term plans to address the index-time non-point shape accuracy but at least you don’t have that case from the scenario you gave.
~ David
From: "Steven Bower-2 [via Lucene]" <ml...@n3.nabble.com>>
Date: Tuesday, March 11, 2014 at 9:45 AM
To: "Smiley, David W." <ds...@mitre.org>>
Subject: Re: Issue with spatial search
great.. that worked!
What does distErrPct actually control, besides controlling the error
percentage? or maybe better put how does it impact perf?
steve
On Mon, Mar 10, 2014 at 11:17 PM, David Smiley (@MITRE.org) <
[hidden email]</user/SendEmail.jtp?type=node&node=4122855&i=0>> wrote:
> Correct, Steve. Alternatively you can also put this option in your query
> after the end of the last parenthesis, as in this example from the wiki:
>
> fq=geo:"IsWithin(POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30)))
> distErrPct=0"
>
> ~ David
>
>
> Steven Bower wrote
> > Only points in the index.. Am I correct this won't require a reindex?
> >
> > On Monday, March 10, 2014, Smiley, David W. <
>
> > dsmiley@
>
> > > wrote:
> >
> >> Hi Steven,
> >>
> >> Set distErrPct to 0 in order to get non-point shapes to always be as
> >> accurate as maxDistErr. Point shapes are always that accurate. As long
> >> as
> >> you only index points, not other shapes (you don't index polygons, etc.)
> >> then distErrPct of 0 should be fine. In fact, perhaps a future Solr
> >> version should simply use 0 as the default; the last time I did
> >> benchmarks
> >> it was pretty marginal impact of higher distErrPct.
> >>
> >> It's a fairly different story if you are indexing non-point shapes.
> >>
> >> ~ David
> >>
> >> From: Steven Bower <
>
> > smb-apache@
>
> > <javascript:;>
> > <mailto:
> >>
> >
>
> > smb-apache@
>
> > <javascript:;>>>
> >> Reply-To: "
>
> > solr-user@.apache
>
> > <javascript:;>
> > <mailto:
> >>
> >
>
> > solr-user@.apache
>
> > <javascript:;>>" <
>
> > solr-user@.apache
>
> > <javascript:;>
> >> <mailto:
>
> > solr-user@.apache
>
> > <javascript:;>>>
> >> Date: Monday, March 10, 2014 at 4:23 PM
> >> To: "
>
> > solr-user@.apache
>
> > <javascript:;>
> > <mailto:
> >>
> >
>
> > solr-user@.apache
>
> > <javascript:;>>" <
>
> > solr-user@.apache
>
> > <javascript:;>
> >> <mailto:
>
> > solr-user@.apache
>
> > <javascript:;>>>
> >> Subject: Re: Issue with spatial search
> >>
> >> Minor edit to the KML to adjust color of polygon
> >>
> >>
> >> On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <
>
> > smb-apache@
>
> > <javascript:;>
> >> <mailto:
>
> > smb-apache@
>
> > <javascript:;>>> wrote:
> >> I am seeing a "error" when doing a spatial search where a particular
> >> point
> >> is showing up within a polygon, but by all methods I've tried that point
> >> is
> >> not within the polygon..
> >>
> >> First the point is: 41.2299,29.1345 (lat/lon)
> >>
> >> The polygon is:
> >>
> >> 31.2719,32.283
> >> 31.2179,32.3681
> >> 31.1333,32.3407
> >> 30.9356,32.6318
> >> 31.0707,34.5196
> >> 35.2053,36.9415
> >> 37.2959,36.6339
> >> 40.8334,30.4273
> >> 41.1622,29.1421
> >> 41.6484,27.4832
> >> 47.0255,13.6342
> >> 43.9457,3.17525
> >> 37.0029,-5.7017
> >> 35.7741,-5.57719
> >> 34.801,-4.66201
> >> 33.345,10.0157
> >> 29.6745,18.9366
> >> 30.6592,29.1683
> >> 31.2719,32.283
> >>
> >> The geo field we are using has this config:
> >>
> >>
> > <fieldType name="location_rpt"
> >>
> > class="solr.SpatialRecursivePrefixTreeFieldType"
> >> distErrPct="0.025"
> >> maxDistErr="0.000009"
> >>
> >>
> >>
> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
> >> units="degrees"/>
> >>
> >> The config is basically the same as the one from the docs...
> >>
> >> They query I am issuing is this:
> >>
> >> location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
> >> 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
> >> 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
> >> 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
> >> 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283
> >> 31.2719)))"
> >>
> >> and it brings back a result where the "location" field is
> 41.2299,29.1345
> >>
> >> I've attached a KML with the polygon and the point and you can see from
> >> that, visually, that the point is not within the polygon. I also tried
> in
> >> google maps API but after playing around realize that the polygons in
> >> maps
> >> are draw in Euclidian space while the map itself is a Mercator
> >> projection..
> >> Loading the kml in earth fixes this issue but the point still lays
> >> outside
> >> the polygon.. The distance between the edge of the polygon closes to the
> >> point and the point itself is ~1.2 miles which is much larger than the
> >> 1meter accuracy given by the maxDistErr (per the docs).
> >>
> >> Any thoughts on this?
> >>
> >> Thanks,
> >>
> >> Steve
> >>
> >>
>
>
>
>
>
> -----
> Author:
> http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Issue-with-spatial-search-tp4122690p4122744.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
________________________________
If you reply to this email, your message will be added to the discussion below:
http://lucene.472066.n3.nabble.com/Issue-with-spatial-search-tp4122690p4122855.html
To unsubscribe from Issue with spatial search, click here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4122690&code=RFNNSUxFWUBtaXRyZS5vcmd8NDEyMjY5MHwxMDE2NDI2OTUw>.
NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-----
Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: http://lucene.472066.n3.nabble.com/Issue-with-spatial-search-tp4122690p4122860.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Issue with spatial search
Posted by Steven Bower <sb...@alcyon.net>.
great.. that worked!
What does distErrPct actually control, besides controlling the error
percentage? or maybe better put how does it impact perf?
steve
On Mon, Mar 10, 2014 at 11:17 PM, David Smiley (@MITRE.org) <
DSMILEY@mitre.org> wrote:
> Correct, Steve. Alternatively you can also put this option in your query
> after the end of the last parenthesis, as in this example from the wiki:
>
> fq=geo:"IsWithin(POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30)))
> distErrPct=0"
>
> ~ David
>
>
> Steven Bower wrote
> > Only points in the index.. Am I correct this won't require a reindex?
> >
> > On Monday, March 10, 2014, Smiley, David W. <
>
> > dsmiley@
>
> > > wrote:
> >
> >> Hi Steven,
> >>
> >> Set distErrPct to 0 in order to get non-point shapes to always be as
> >> accurate as maxDistErr. Point shapes are always that accurate. As long
> >> as
> >> you only index points, not other shapes (you don't index polygons, etc.)
> >> then distErrPct of 0 should be fine. In fact, perhaps a future Solr
> >> version should simply use 0 as the default; the last time I did
> >> benchmarks
> >> it was pretty marginal impact of higher distErrPct.
> >>
> >> It's a fairly different story if you are indexing non-point shapes.
> >>
> >> ~ David
> >>
> >> From: Steven Bower <
>
> > smb-apache@
>
> > <javascript:;>
> > <mailto:
> >>
> >
>
> > smb-apache@
>
> > <javascript:;>>>
> >> Reply-To: "
>
> > solr-user@.apache
>
> > <javascript:;>
> > <mailto:
> >>
> >
>
> > solr-user@.apache
>
> > <javascript:;>>" <
>
> > solr-user@.apache
>
> > <javascript:;>
> >> <mailto:
>
> > solr-user@.apache
>
> > <javascript:;>>>
> >> Date: Monday, March 10, 2014 at 4:23 PM
> >> To: "
>
> > solr-user@.apache
>
> > <javascript:;>
> > <mailto:
> >>
> >
>
> > solr-user@.apache
>
> > <javascript:;>>" <
>
> > solr-user@.apache
>
> > <javascript:;>
> >> <mailto:
>
> > solr-user@.apache
>
> > <javascript:;>>>
> >> Subject: Re: Issue with spatial search
> >>
> >> Minor edit to the KML to adjust color of polygon
> >>
> >>
> >> On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <
>
> > smb-apache@
>
> > <javascript:;>
> >> <mailto:
>
> > smb-apache@
>
> > <javascript:;>>> wrote:
> >> I am seeing a "error" when doing a spatial search where a particular
> >> point
> >> is showing up within a polygon, but by all methods I've tried that point
> >> is
> >> not within the polygon..
> >>
> >> First the point is: 41.2299,29.1345 (lat/lon)
> >>
> >> The polygon is:
> >>
> >> 31.2719,32.283
> >> 31.2179,32.3681
> >> 31.1333,32.3407
> >> 30.9356,32.6318
> >> 31.0707,34.5196
> >> 35.2053,36.9415
> >> 37.2959,36.6339
> >> 40.8334,30.4273
> >> 41.1622,29.1421
> >> 41.6484,27.4832
> >> 47.0255,13.6342
> >> 43.9457,3.17525
> >> 37.0029,-5.7017
> >> 35.7741,-5.57719
> >> 34.801,-4.66201
> >> 33.345,10.0157
> >> 29.6745,18.9366
> >> 30.6592,29.1683
> >> 31.2719,32.283
> >>
> >> The geo field we are using has this config:
> >>
> >>
> > <fieldType name="location_rpt"
> >>
> > class="solr.SpatialRecursivePrefixTreeFieldType"
> >> distErrPct="0.025"
> >> maxDistErr="0.000009"
> >>
> >>
> >>
> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
> >> units="degrees"/>
> >>
> >> The config is basically the same as the one from the docs...
> >>
> >> They query I am issuing is this:
> >>
> >> location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
> >> 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
> >> 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
> >> 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
> >> 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283
> >> 31.2719)))"
> >>
> >> and it brings back a result where the "location" field is
> 41.2299,29.1345
> >>
> >> I've attached a KML with the polygon and the point and you can see from
> >> that, visually, that the point is not within the polygon. I also tried
> in
> >> google maps API but after playing around realize that the polygons in
> >> maps
> >> are draw in Euclidian space while the map itself is a Mercator
> >> projection..
> >> Loading the kml in earth fixes this issue but the point still lays
> >> outside
> >> the polygon.. The distance between the edge of the polygon closes to the
> >> point and the point itself is ~1.2 miles which is much larger than the
> >> 1meter accuracy given by the maxDistErr (per the docs).
> >>
> >> Any thoughts on this?
> >>
> >> Thanks,
> >>
> >> Steve
> >>
> >>
>
>
>
>
>
> -----
> Author:
> http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Issue-with-spatial-search-tp4122690p4122744.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Re: Issue with spatial search
Posted by "David Smiley (@MITRE.org)" <DS...@mitre.org>.
Correct, Steve. Alternatively you can also put this option in your query
after the end of the last parenthesis, as in this example from the wiki:
fq=geo:"IsWithin(POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30)))
distErrPct=0"
~ David
Steven Bower wrote
> Only points in the index.. Am I correct this won't require a reindex?
>
> On Monday, March 10, 2014, Smiley, David W. <
> dsmiley@
> > wrote:
>
>> Hi Steven,
>>
>> Set distErrPct to 0 in order to get non-point shapes to always be as
>> accurate as maxDistErr. Point shapes are always that accurate. As long
>> as
>> you only index points, not other shapes (you don't index polygons, etc.)
>> then distErrPct of 0 should be fine. In fact, perhaps a future Solr
>> version should simply use 0 as the default; the last time I did
>> benchmarks
>> it was pretty marginal impact of higher distErrPct.
>>
>> It's a fairly different story if you are indexing non-point shapes.
>>
>> ~ David
>>
>> From: Steven Bower <
> smb-apache@
> <javascript:;>
> <mailto:
>>
>
> smb-apache@
> <javascript:;>>>
>> Reply-To: "
> solr-user@.apache
> <javascript:;>
> <mailto:
>>
>
> solr-user@.apache
> <javascript:;>>" <
> solr-user@.apache
> <javascript:;>
>> <mailto:
> solr-user@.apache
> <javascript:;>>>
>> Date: Monday, March 10, 2014 at 4:23 PM
>> To: "
> solr-user@.apache
> <javascript:;>
> <mailto:
>>
>
> solr-user@.apache
> <javascript:;>>" <
> solr-user@.apache
> <javascript:;>
>> <mailto:
> solr-user@.apache
> <javascript:;>>>
>> Subject: Re: Issue with spatial search
>>
>> Minor edit to the KML to adjust color of polygon
>>
>>
>> On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <
> smb-apache@
> <javascript:;>
>> <mailto:
> smb-apache@
> <javascript:;>>> wrote:
>> I am seeing a "error" when doing a spatial search where a particular
>> point
>> is showing up within a polygon, but by all methods I've tried that point
>> is
>> not within the polygon..
>>
>> First the point is: 41.2299,29.1345 (lat/lon)
>>
>> The polygon is:
>>
>> 31.2719,32.283
>> 31.2179,32.3681
>> 31.1333,32.3407
>> 30.9356,32.6318
>> 31.0707,34.5196
>> 35.2053,36.9415
>> 37.2959,36.6339
>> 40.8334,30.4273
>> 41.1622,29.1421
>> 41.6484,27.4832
>> 47.0255,13.6342
>> 43.9457,3.17525
>> 37.0029,-5.7017
>> 35.7741,-5.57719
>> 34.801,-4.66201
>> 33.345,10.0157
>> 29.6745,18.9366
>> 30.6592,29.1683
>> 31.2719,32.283
>>
>> The geo field we are using has this config:
>>
>>
> <fieldType name="location_rpt"
>>
> class="solr.SpatialRecursivePrefixTreeFieldType"
>> distErrPct="0.025"
>> maxDistErr="0.000009"
>>
>>
>> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
>> units="degrees"/>
>>
>> The config is basically the same as the one from the docs...
>>
>> They query I am issuing is this:
>>
>> location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
>> 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
>> 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
>> 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
>> 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283
>> 31.2719)))"
>>
>> and it brings back a result where the "location" field is 41.2299,29.1345
>>
>> I've attached a KML with the polygon and the point and you can see from
>> that, visually, that the point is not within the polygon. I also tried in
>> google maps API but after playing around realize that the polygons in
>> maps
>> are draw in Euclidian space while the map itself is a Mercator
>> projection..
>> Loading the kml in earth fixes this issue but the point still lays
>> outside
>> the polygon.. The distance between the edge of the polygon closes to the
>> point and the point itself is ~1.2 miles which is much larger than the
>> 1meter accuracy given by the maxDistErr (per the docs).
>>
>> Any thoughts on this?
>>
>> Thanks,
>>
>> Steve
>>
>>
-----
Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: http://lucene.472066.n3.nabble.com/Issue-with-spatial-search-tp4122690p4122744.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Issue with spatial search
Posted by Steven Bower <sm...@alcyon.net>.
Only points in the index.. Am I correct this won't require a reindex?
On Monday, March 10, 2014, Smiley, David W. <ds...@mitre.org> wrote:
> Hi Steven,
>
> Set distErrPct to 0 in order to get non-point shapes to always be as
> accurate as maxDistErr. Point shapes are always that accurate. As long as
> you only index points, not other shapes (you don't index polygons, etc.)
> then distErrPct of 0 should be fine. In fact, perhaps a future Solr
> version should simply use 0 as the default; the last time I did benchmarks
> it was pretty marginal impact of higher distErrPct.
>
> It's a fairly different story if you are indexing non-point shapes.
>
> ~ David
>
> From: Steven Bower <smb-apache@alcyon.net <javascript:;><mailto:
> smb-apache@alcyon.net <javascript:;>>>
> Reply-To: "solr-user@lucene.apache.org <javascript:;><mailto:
> solr-user@lucene.apache.org <javascript:;>>" <solr-user@lucene.apache.org<javascript:;>
> <mailto:solr-user@lucene.apache.org <javascript:;>>>
> Date: Monday, March 10, 2014 at 4:23 PM
> To: "solr-user@lucene.apache.org <javascript:;><mailto:
> solr-user@lucene.apache.org <javascript:;>>" <solr-user@lucene.apache.org<javascript:;>
> <mailto:solr-user@lucene.apache.org <javascript:;>>>
> Subject: Re: Issue with spatial search
>
> Minor edit to the KML to adjust color of polygon
>
>
> On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <smb-apache@alcyon.net<javascript:;>
> <mailto:smb-apache@alcyon.net <javascript:;>>> wrote:
> I am seeing a "error" when doing a spatial search where a particular point
> is showing up within a polygon, but by all methods I've tried that point is
> not within the polygon..
>
> First the point is: 41.2299,29.1345 (lat/lon)
>
> The polygon is:
>
> 31.2719,32.283
> 31.2179,32.3681
> 31.1333,32.3407
> 30.9356,32.6318
> 31.0707,34.5196
> 35.2053,36.9415
> 37.2959,36.6339
> 40.8334,30.4273
> 41.1622,29.1421
> 41.6484,27.4832
> 47.0255,13.6342
> 43.9457,3.17525
> 37.0029,-5.7017
> 35.7741,-5.57719
> 34.801,-4.66201
> 33.345,10.0157
> 29.6745,18.9366
> 30.6592,29.1683
> 31.2719,32.283
>
> The geo field we are using has this config:
>
> <fieldType name="location_rpt"
> class="solr.SpatialRecursivePrefixTreeFieldType"
> distErrPct="0.025"
> maxDistErr="0.000009"
>
> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
> units="degrees"/>
>
> The config is basically the same as the one from the docs...
>
> They query I am issuing is this:
>
> location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
> 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
> 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
> 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
> 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283 31.2719)))"
>
> and it brings back a result where the "location" field is 41.2299,29.1345
>
> I've attached a KML with the polygon and the point and you can see from
> that, visually, that the point is not within the polygon. I also tried in
> google maps API but after playing around realize that the polygons in maps
> are draw in Euclidian space while the map itself is a Mercator projection..
> Loading the kml in earth fixes this issue but the point still lays outside
> the polygon.. The distance between the edge of the polygon closes to the
> point and the point itself is ~1.2 miles which is much larger than the
> 1meter accuracy given by the maxDistErr (per the docs).
>
> Any thoughts on this?
>
> Thanks,
>
> Steve
>
>
Re: Issue with spatial search
Posted by "Smiley, David W." <ds...@mitre.org>.
Hi Steven,
Set distErrPct to 0 in order to get non-point shapes to always be as accurate as maxDistErr. Point shapes are always that accurate. As long as you only index points, not other shapes (you don’t index polygons, etc.) then distErrPct of 0 should be fine. In fact, perhaps a future Solr version should simply use 0 as the default; the last time I did benchmarks it was pretty marginal impact of higher distErrPct.
It’s a fairly different story if you are indexing non-point shapes.
~ David
From: Steven Bower <sm...@alcyon.net>>
Reply-To: "solr-user@lucene.apache.org<ma...@lucene.apache.org>" <so...@lucene.apache.org>>
Date: Monday, March 10, 2014 at 4:23 PM
To: "solr-user@lucene.apache.org<ma...@lucene.apache.org>" <so...@lucene.apache.org>>
Subject: Re: Issue with spatial search
Minor edit to the KML to adjust color of polygon
On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <sm...@alcyon.net>> wrote:
I am seeing a "error" when doing a spatial search where a particular point is showing up within a polygon, but by all methods I've tried that point is not within the polygon..
First the point is: 41.2299,29.1345 (lat/lon)
The polygon is:
31.2719,32.283
31.2179,32.3681
31.1333,32.3407
30.9356,32.6318
31.0707,34.5196
35.2053,36.9415
37.2959,36.6339
40.8334,30.4273
41.1622,29.1421
41.6484,27.4832
47.0255,13.6342
43.9457,3.17525
37.0029,-5.7017
35.7741,-5.57719
34.801,-4.66201
33.345,10.0157
29.6745,18.9366
30.6592,29.1683
31.2719,32.283
The geo field we are using has this config:
<fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
distErrPct="0.025"
maxDistErr="0.000009"
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
units="degrees"/>
The config is basically the same as the one from the docs...
They query I am issuing is this:
location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283 31.2719)))"
and it brings back a result where the "location" field is 41.2299,29.1345
I've attached a KML with the polygon and the point and you can see from that, visually, that the point is not within the polygon. I also tried in google maps API but after playing around realize that the polygons in maps are draw in Euclidian space while the map itself is a Mercator projection.. Loading the kml in earth fixes this issue but the point still lays outside the polygon.. The distance between the edge of the polygon closes to the point and the point itself is ~1.2 miles which is much larger than the 1meter accuracy given by the maxDistErr (per the docs).
Any thoughts on this?
Thanks,
Steve
Re: Issue with spatial search
Posted by Steven Bower <sm...@alcyon.net>.
Minor edit to the KML to adjust color of polygon
On Mon, Mar 10, 2014 at 4:21 PM, Steven Bower <sm...@alcyon.net> wrote:
> I am seeing a "error" when doing a spatial search where a particular point
> is showing up within a polygon, but by all methods I've tried that point is
> not within the polygon..
>
> First the point is: 41.2299,29.1345 (lat/lon)
>
> The polygon is:
>
> 31.2719,32.283
> 31.2179,32.3681
> 31.1333,32.3407
> 30.9356,32.6318
> 31.0707,34.5196
> 35.2053,36.9415
> 37.2959,36.6339
> 40.8334,30.4273
> 41.1622,29.1421
> 41.6484,27.4832
> 47.0255,13.6342
> 43.9457,3.17525
> 37.0029,-5.7017
> 35.7741,-5.57719
> 34.801,-4.66201
> 33.345,10.0157
> 29.6745,18.9366
> 30.6592,29.1683
> 31.2719,32.283
>
> The geo field we are using has this config:
>
> <fieldType name="location_rpt"
> class="solr.SpatialRecursivePrefixTreeFieldType"
> distErrPct="0.025"
> maxDistErr="0.000009"
>
> spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
> units="degrees"/>
>
> The config is basically the same as the one from the docs...
>
> They query I am issuing is this:
>
> location:"Intersects(POLYGON((32.283 31.2719, 32.3681 31.2179, 32.3407
> 31.1333, 32.6318 30.9356, 34.5196 31.0707, 36.9415 35.2053, 36.6339
> 37.2959, 30.4273 40.8334, 29.1421 41.1622, 27.4832 41.6484, 13.6342
> 47.0255, 3.17525 43.9457, -5.7017 37.0029, -5.57719 35.7741, -4.66201
> 34.801, 10.0157 33.345, 18.9366 29.6745, 29.1683 30.6592, 32.283 31.2719)))"
>
> and it brings back a result where the "location" field is 41.2299,29.1345
>
> I've attached a KML with the polygon and the point and you can see from
> that, visually, that the point is not within the polygon. I also tried in
> google maps API but after playing around realize that the polygons in maps
> are draw in Euclidian space while the map itself is a Mercator projection..
> Loading the kml in earth fixes this issue but the point still lays outside
> the polygon.. The distance between the edge of the polygon closes to the
> point and the point itself is ~1.2 miles which is much larger than the
> 1meter accuracy given by the maxDistErr (per the docs).
>
> Any thoughts on this?
>
> Thanks,
>
> Steve
>