lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Bower <smb-apa...@alcyon.net>
Subject Issue with spatial search
Date Mon, 10 Mar 2014 20:21:30 GMT
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

Mime
View raw message