Python packages for talking to the Who's On First (spelunker) Elasticsearch index
This library is provided as-is, right now. It lacks proper documentation which will probably make it hard for you to use unless you are willing to poke and around and investigate things on your own.
There is a whosonfirst mappings schema, and a simple utility for preparing the ElasticSearch mappings. Running this will ensure that the automatic mappings from ES don't try to get to clever about things like EDTF dates.
cd /usr/local/mapzen/es-whosonfirst-schema
./bin/reload-schema.sh
import mapzen.whosonfirst.search
import mapzen.whosonfirst.utils
idx = whosonfirst.mapzen.search.index()
source = os.path.abspath(options.source)
crawl = mapzen.whosonfirst.utils.crawl(source)
for path in crawl:
try:
idx.index_file(path)
except Exception, e:
logging.error("failed to index %s, because %s" % (path, e))
# Or this:
# rsp = idx.index_files(crawl)
$> cd /usr/local/mapzen/whosonfirst-venue/
$> git pull origin master
$> /usr/local/bin/wof-es-index -s /usr/local/mapzen/whosonfirst-venue/data/ -b
GeoJSON geometry
elements are not included in any responses by default. This is by design for performance reasons.
This is not meant for doing spatial queries. No. There is a separate py-mapzen-whosonfirst-spatial
package that will makes happy with PostGIS and together they make beautiful spatial lookup. This is not that package.