You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Philippe Guillard <pg...@citycita.net> on 2005/10/28 11:34:12 UTC

geographical search

Hello here,

I'd like to do some geographical searches. Can somebody can tell me 
where to go ?

At the moment i put the longitude and latitude in the index as i would 
put some text. Then i did some range queries like this :
queryString=foo AND country:United States AND 
coordinates@lon:[-74.04047986086957 TO -73.95352333913044] AND 
coordinates@lat:[40.70662093913044 TO 40.793577460869564]
It worked well with positive coordinates in Europe, not in the US so i 
planned to put N/S before latitude, E/O before longitudes to replace 
negative values.
But something tells me this is not the way to do things with Lucene and 
not use the range query:-)
So i red :
- http://wiki.apache.org/nutch/GeoPosition
- and this from the Boss :-) 
http://www.opensubscriber.com/message/lucene-dev@jakarta.apache.org/184558.html 

- http://photospace.sourceforge.net/codecon/codecon-2005.html
, but all this seems complicated to me!

Regards,

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: geographical search

Posted by Chris Hostetter <ho...@fucit.org>.
: put some text. Then i did some range queries like this :
: queryString=foo AND country:United States AND
: coordinates@lon:[-74.04047986086957 TO -73.95352333913044] AND
: coordinates@lat:[40.70662093913044 TO 40.793577460869564]
: It worked well with positive coordinates in Europe, not in the US so i
: planned to put N/S before latitude, E/O before longitudes to replace
: negative values.
: But something tells me this is not the way to do things with Lucene and
: not use the range query:-)

There's nothing inheriently wrong with your appraoch .. but a RangeFilter
will have less performance problems then a RangeQuery as the size of your
data set gets larger.

: - http://wiki.apache.org/nutch/GeoPosition
: - and this from the Boss :-)
: http://www.opensubscriber.com/message/lucene-dev@jakarta.apache.org/184558.html

I've never looked at these URLs before, but hte basic gist of the Nutch
code seems to be that at index time, it's translating the lat/lon coords
into x/y/z coords to simplify the range claculations -- ie: the math to
find the upper/lower bounds of x/y/z at search time when when you want a
distance of 100km then it is to find the the upper/lower bounds on
lat/lon.  if you're happy to have your users input ranges of lat/lon then
you don't really need to worry about it.

The previous thread seemed to mainly be about designing a new special
query type to specifically deal with Geographic based queries ... nad by
the looks of it to score results by distance ... Doug's comment about the
FieldCache is applicable if you were trying to do that, but if you simply
want a way to restrict results to a particular grid of lat/lon, your
current appraoch should be fine.




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org