First, if you can simply attach country and state codes to your data set,
that would be your best option really. That would enable you to use simple
term queries to do your searches which are about as fast as it gets in ES.
If you can't, you may want to look into getting your hands on a decent data
set with actual polygons for the areas you are interested in. Your best bet
for good shapes is quatroshapes. This is a curated dataset by Foursquare
with polygons for neighborhoods, cities, states, countries. A bit of a
warning though: this is a very messy dataset. Expect inconsistency, errors,
and worse.
It comes in the form of shape files; which elasticsearch does not handle
currently.
To fix that, use a tool called ogr2ogr to convert shape files to geojson.
Ogr2ogr is part of gdal, which is a set of gis commandline tools.
For example this command converts the quatroshapes neighborhood file while
also applying a simplification algorithm. You need the latter because ES
does not handle e.g. self intersecting polygons and several other common
problems with polygons.
ogr2ogr -wrapdateline -simplify 0.0005 -f geoJSON qs_neighborhoods.json
qs_neighborhoods.shp
Jilles
On Thursday, September 5, 2013 9:08:51 PM UTC+2, mfri...@afilias.info wrote:
I'm new to elasticsearch. Thank you for this great product.
Our client would like to search within a region (continent), or within a
country, or even near a city.
I have been reading about geo shapes etc. I'm trying to find out if there
are any predefined shapes.
Are there predefined shapes for countries and continents within which we
would search?
What strategies would one use to find all of the 'X' within North America
for instance? (where X is something like 'Widget shops' and we have all the
pins indexed for those shops)
Many thanks.
Matt
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.