This is just wonderful, Peter—thank you. (Providing a complete, tested, working example is probably more than I’ve ever done for anybody seeking debugging help!) It looks like I went and made the indexed location data more complicated than it needed to be, ginning up an object / geo_point structure, when all I really needed was "type: point” and “coordinates: -78, 38”. This has been a blocker on a project for so long, I scarcely remember how to proceed from here. My thanks to you and the Elasticsearch community for your help!
And, yes, I’d be happy to talk about US polygon data and sources of open address data. My organization is keenly interested in improving the state of open geodata in the US, and I’m eager to talk to anybody about how U.S. Open Data could help to improve things.
Best,
Waldo
Waldo Jaquith
Director
U.S. Open Data
http://usopendata.org/
202-719-5315
On Jan 6, 2015, at 10:15 AM, Peter Johnson peter@missinglink.co.nz wrote:
Hey Waldo,
I had a look over some of the code we have for Pelias and I managed to get it to work, the trick being that you need to index the business location as a 'geo-shape' 'point' type:
Pre-indexed shapes using geo_shape filter (working) · GitHub
Pre-indexed shapes using geo_shape filter (working) · GitHub
Working example: Pre-indexed shapes using geo_shape filter (working) · GitHub
Visual representation: map.geojson · GitHub
When we index openstreetmap data in elasticsearch, we first find the intersection of the lat/lon within multiple indeces containing polygon information sourced from the quattroshapes project.
The results are then stored as 'admin' properties against each record before indexing the POI, which means doing a lookup for all places inside polygon becomes a simple string match rather than a complex query-time computation.
Would love to have a chat some time about collaborating on US polygon data and sources of open address data.
All the best,
-P
On Tuesday, 6 January 2015 02:52:05 UTC, Waldo Jaquith wrote:
This is fascinating—it hadn't crossed my mind that I might be doing something that simply wasn't supported by Elasticsearch. As many times as I read the documentation, I think I was reading for what I wanted it to do, rather than as a blank slate. Perhaps I'm trying to do something that is supported, but I'm doing it wrong?
This is for all businesses registered in a U.S. state (Virginia), to identify which ones are registered in a given county or city (a sub-unit of a state). The UK equivalent of this would be a list of all businesses registered in the East Midlands, and wanting to identify all of the businesses in Nottingham. I want somebody running a search for a business name to be able to limit that search to a given county or city. Perhaps I'm doing that all wrong, in terms of how Elasticsearch works. (At present, I'm doing this by including the shapes in my HTML, rather than pre-indexing them.) Is there a more Elasticsearch-y way to accomplish this, or is it really best for me to open an issue proposing such a new feature?
My apologies for the errors in my gist! Thank you for forking it and fixing them. This is my first time putting together a complete test case of a problem for a mailing list, so when the test case failed, it only served to (wrongly) reinforce that I'd correctly reproduced the problem!
Best,
Waldo
Waldo Jaquith
Director
U.S. Open Data
http://usopendata.org/
202-719-5315
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/E4F6AC07-3A57-404C-B73D-2DBA3266207C%40usodi.org.
For more options, visit https://groups.google.com/d/optout.