-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new endpoint for geometries of cities #1121
Comments
Yes we definitely want this. We've been talking about it for a long time. The entire point of the /v1/place endpoint is to return more details, such as geometry, but we never got around to implementing it. The venicegeo team has been working on importing geometries into Elasticsearch as part of WOF records. I don't know if they've done a full planet import, in which case they have not had to worry about the 100MB New Zealand polygon. I like your idea of not returning countries, since those geometries do get quite large. We could also create simplified geometries for display in larger cases. |
It's an interesting idea and a few people have asked for it. In the past, we've stayed away from providing information for display, visual polygons weren't considered part of the 'core geocoding experience'. An important consideration is that the API would need to be capable of performing The simplification algorithm is CPU-bound and would be a heavy burden on the machines serving it. I personally feel that when these things are considered, another technology such as vector tiles is more suited to this job. We'd need to think a little more about which service features were going to be available and what the scope of the project would be. |
@orangejulius Oh yes, venicegeo is doing it in a simple way. It may be a good idea to integrate it into Elasticsearch instead of having filesystem only like pip-service. @missinglink That's right, this is not really related to geocoding but is a cool feature (and can provide a wow effect). |
I thought of something else, if data are stored in elasticsearch, you have to remember that the geometries should not be sent when we have search/autocomplete queries like this one: |
Yes @Joxit that's a very good point. The overhead of sending the geometry JSON to the API with each request would be huge. Fortunately it looks like it's possible to return only certain fields. It looks like it's different in Elasticsearch 5 vs 2 though, so we should watch out for that. |
That's cool, there is also an exclude source 😄 Here is a preview of this issue using whosonfirst-data/whosonfirst-data repository. |
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohitibive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our different fields. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%!
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohitibive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our different fields. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99 Fixes #99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. Efectively, we were storing a lot of fields on disk twice, which was wasting space. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! _Sidenote:_ If there are other fields we _do_ want to keep out of the `_source` field, [`_source.exclude`](https://github.com/pelias/schema/blob/master/mappings/document.js#L158-L159) in our document mapping is how we can do it. After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. Effectively, we were storing a lot of fields on disk twice, which was wasting space. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! _Sidenote:_ If there are other fields we _do_ want to keep out of the `_source` field, [`_source.exclude`](https://github.com/pelias/schema/blob/master/mappings/document.js#L158-L159) in our document mapping is how we can do it. After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. Effectively, we were storing a lot of fields on disk twice, which was wasting space. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! _Sidenote:_ If there are other fields we _do_ want to keep out of the `_source` field, [`_source.exclude`](https://github.com/pelias/schema/blob/master/mappings/document.js#L158-L159) in our document mapping is how we can do it. After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes pelias#99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. Effectively, we were storing a lot of fields on disk twice, which was wasting space. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! _Sidenote:_ If there are other fields we _do_ want to keep out of the `_source` field, [`_source.exclude`](https://github.com/pelias/schema/blob/master/mappings/document.js#L158-L159) in our document mapping is how we can do it. After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. Effectively, we were storing a lot of fields on disk twice, which was wasting space. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! _Sidenote:_ If there are other fields we _do_ want to keep out of the `_source` field, [`_source.exclude`](https://github.com/pelias/schema/blob/master/mappings/document.js#L158-L159) in our document mapping is how we can do it. After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99
Background ========== I always thought that it was important to use the `store` parameter to specify whether a field should be stored, in addition to indexing, and the default was to not store a field for later retrieval. It turns out this isn't true, and that all fields are [copied to the _source](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/mapping-store.html) field by default. Setting `"store": "yes"` is only needed if, in addition to getting a field back as part of the `_source` (which contains _every_ field in the document), we wanted to be able to return a single field. Pelias doesn't currently do this, we always ask Elasticsearch for the entire `_source` field. In addition, Elasticsearch has a [source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-source-filtering.html) feature, so if we ever wanted to return only some of `_source` (which might someday be the case with something like pelias/api#1121), the only reason we would want to bother with `"store": "yes"` is if the size of the `_source` field was so prohibitive we didn't even want Elasticsearch to fetch all of it from disk. That might be a concern some day, but not today. Changes ========== This PR removes all `"store": "yes"` parameters for all of our fields. Effectively, we were storing a lot of fields on disk twice, which was wasting space. In my testing of the Portland, Oregon Docker project, which has about 1.8 million documents, this change reduces the disk space usage from 551MB to 492MB, or about 10%! _Sidenote:_ If there are other fields we _do_ want to keep out of the `_source` field, [`_source.exclude`](https://github.com/pelias/schema/blob/master/mappings/document.js#L158-L159) in our document mapping is how we can do it. After this change, I'm now pretty confident we are doing the right thing for all our fields when it comes to storing, and analyzers so this closes #99
Hi,
A new endpoint could be interesting.
An endpoint that would send the geometry of a city using Who's On First ID.
Thanks to this we could highlight cities (like Who's On First spelunker or Google).
This could be another microservice (like pip-service or a new one) and should only serve localities/localadmins (because the regions/countries will be too large).
The answer should also be filtered, do not send the raw data from WOF (keep proprieties about geometry and bbox for example).
Example of request with properties:
The text was updated successfully, but these errors were encountered: