imposm3 icon indicating copy to clipboard operation
imposm3 copied to clipboard

Multiple keys for column (fallback/coalesce like)

Open Geosynopsis opened this issue 9 years ago • 3 comments

In the mapping file example, each column have one key. Only on the mapping there are options to include for more than one key. Is there any way to include more than one key for one column for example like; ..... }, { "type": "string", "name": "startdate", "key": [ "start_date", "start" ] }, {......

Geosynopsis avatar Sep 08 '15 09:09 Geosynopsis

According to my best knowledge:

  • now - only the "hstore_tags"` column type supported. ( "Stores all tags in a HStore column.")
  • imposm3 documentation: http://imposm.org/docs/imposm3/latest/mapping.html#hstore-tags
  • example single_table_mapping.json
                {
                    "type": "hstore_tags",
                    "name": "tags",
                    "key": null
                }
  • PostgreSQL 9.4 hstore documentation: http://www.postgresql.org/docs/9.4/static/hstore.html
    • ( don't forget to enable PostgreSQL hstore extension: "CREATE EXTENSION hstore;" )

ImreSamu avatar Sep 08 '15 11:09 ImreSamu

@ImreSamu I guess the question in this issue is more focused on providing fallback keys, instead of storing them all. For example:

{
    "type": "string",
    "name": "name",
    "key": ["name:en", "name"]
}

This field should prefer english names to local names. Is it possible?

zakjan avatar May 25 '16 08:05 zakjan

@zakjan

This field should prefer english names to local names. Is it possible?

to the best of my knowledge:

  • if you want postgresql coalesce() functionality - it is not possible yet.
    • I am working on similar mapping type: https://github.com/ImreSamu/imposm3_fieldtypes ( work in progress )

ImreSamu avatar May 25 '16 17:05 ImreSamu