lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (@MITRE.org)" <DSMI...@mitre.org>
Subject Re: Spatial Search
Date Tue, 03 Jan 2012 15:59:08 GMT
I have a couple comments on your code after briefly looking through it.

* If you want to work with miles, initialize SimpleSpatialContext with
DistanceUnits.MILES.  I see you chose KM but your leading statistics are in
miles.  Perhaps that is the reason for the discrepency in your numbers.
* You are not supposed to instantiate Shape instances directly, the spatial
context is a factory for them.  It will also do some important argument
normalization (e.g. ensuring lat-lon is within proper boundaries).
* You are initializing GeohashPrefixTree using the maximum detail possible
(roughly double precision).  I suspect you don't actually need that level of
accuracy.  Look at SpatialPrefixTreeStrategy.initMaxLevels() for code that
chooses a value based on a target fraction of your chosen units (e.g.
miles).  If you want to hard-code a specific value only good for geohashes,
you could alternatively look up a value in a table of precision on geohashes
on wikipedia.

Keep in mind that LSP is subject to change at will; it hasn't been
officially released yet.  The remaining issues I see for a first release are
enumerated here: 
http://code.google.com/p/lucene-spatial-playground/wiki/Tasks  The "Extras /
demo related" part arguably doesn't count.

~ David Smiley

-----
 Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: http://lucene.472066.n3.nabble.com/Spatial-Search-tp3623494p3629480.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

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


Mime
View raw message