Skip to content
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

Add new import option '-extra-tags' #576

Merged
merged 3 commits into from
May 7, 2021
Merged

Conversation

lonvia
Copy link
Collaborator

@lonvia lonvia commented May 4, 2021

Implements #574.

The '-extra-tags' command line option takes a comma-separated list of OSM keys to be copied over from the Nominatim database.

When running updates, the user currently has to take care to include the '-extra-tags' again in the command line. We could probably scan the ES mapping instead to retrieve the configured list but I'll leave that for another PR.

@lonvia
Copy link
Collaborator Author

lonvia commented May 4, 2021

This is the wrong way to go about adding the mapping for the 'extra' field. We should be using dynamic templates to simply add the required mappings on the fly. With such a template it is possible to ensure that the field is not indexed.

@leonardehrenfried
Copy link
Contributor

For this to work do you need the Nomatim extratags import style?
And do you need a specific version of Nominatim?

@lonvia
Copy link
Collaborator Author

lonvia commented May 4, 2021

Well, you need to make sure that the tags you are interested in have been previously imported into Nominatim. Using the extratags import style is one option. That style will ensure that most of the tags of an OSM object can be found in the extratags column. You can also start with one of the other styles and edit it to copy only the tags you need. Something like that:

{
    "keys" : ["cuisine", "takeaway", "website"],
    "values" : {
        "" : "extra"
    }
}

The new options works with all Nominatim versions that are usable with Photon.

lonvia added 3 commits May 4, 2021 16:21
This option tags a comma separated list of OSM keys. When the given
keys are available in the Nominatim database as 'extratags', then
they are copied into the Photon database as unindexed fields.

When using updates, the same option must currently supplied as
during import time.
If any extra fields are found in the response from ES then they
will be returned as properties->extra->`key` with the JSON
response.
@lonvia lonvia merged commit 1c52419 into komoot:master May 7, 2021
@lonvia lonvia deleted the extra-attributes branch May 7, 2021 14:06
@FaFre
Copy link

FaFre commented Jul 5, 2021

@lonvia this is a great feature! Helps me a lot, thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants