[Tile-serving] [openstreetmap/osm2pgsql] Add support for --extra-attributes to Gazetteer output (#905)

Michael Reichert notifications at github.com
Wed Jan 30 16:16:44 UTC 2019


`--extra-attributes` is now supported by Gazetteer output. This pull requests writes all metadata fields to as to the `extratags` column.

If an OSM object lacks a metadata field (empty string or 0 as value) which is/will be common with usual OSM planet dumps and extracts, the field will not be written to the output.

Users can control whether they want all metadata fields or only specific ones. If the Nominatim style file (the new one, see #1277) contains a catch-all rule at the end, that catch-all rule will apply on all available metadata fields and they will be written to the `places` table. If one or many of the metadata fields are mentioned in an `extra` rule and no catch-all rule is present, only that field will be written.

**Example 1: write all tags and all metadata fields to the `extratags` column**

Append this to your style file:

```json
{
    "keys" : [""],
    "values" : {
        "" : "extra"
    }
}
```

**Example 2: write all metadata fields to the `extratags` column**

Append this to your style file:

```json
{
    "keys" : ["osm_version", "osm_timestamp", "osm_user", "osm_uid", "osm_changeset"],
    "values" : {
        "" : "extra"
    }
}
```

**Example 3: write timestamps to the `extratags` column**

Append this to your style file:

```json
{
    "keys" : ["osm_timestamp"],
    "values" : {
        "" : "extra"
    }
}
```
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/905

-- Commit Summary --

  * add support for --extra-attributes to Gazetteer output

-- File Changes --

    M gazetteer-style.cpp (54)
    M gazetteer-style.hpp (12)
    M output-gazetteer.hpp (2)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/905.patch
https://github.com/openstreetmap/osm2pgsql/pull/905.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/905
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20190130/0f2ee41b/attachment.html>


More information about the Tile-serving mailing list