[Tile-serving] [openstreetmap/osm2pgsql] member_type in relations and osm_type use different case. (Issue #1778)

Sven Geggus notifications at github.com
Mon Sep 26 08:28:40 UTC 2022


<!-- Please don't use screenshots. Copy and paste the *text* output here if that's needed for context. -->

## What version of osm2pgsql are you using?

```
2022-09-26 10:10:16  osm2pgsql version 1.7.0
Build: None
Compiled using the following library versions:
Libosmium 2.18.0
Proj [API 4] Rel. 7.2.1, January 1st, 2021
Lua 5.3.3
Sie haben Post in /home/sven/Maildir/.
```

## What operating system and PostgreSQL/PostGIS version are you using?

Debian 11 (PostgreSQL 13 and PostGIS 3.1.1 from Debian 11)

## What did you do exactly?

I try to import site relations.

## What did you expect to happen?

I would expect that member_type of relations and regular osm_type would use the same case.

## What did happen instead?

While member_type uses lowercase ('n','w','r') osm_type uses uppercase ('N','W','R').

## What did you do to try analyzing the problem?

The Problem can be reproduced using the following lua script:

```lua
local tables = {}

tables.point = osm2pgsql.define_table{
    name = 'osm_point',
    ids = { type = 'any', id_column = 'osm_id', type_column = 'osm_type' },
    columns = {
        { column = 'tags',  type = 'jsonb' },
        { column = 'geom',  type = 'geometry', projection = 'latlong'  },
    }
}

tables.siterel = osm2pgsql.define_table{
    name = 'osm_siterel',
    ids = { type = 'relation', id_column = 'site_id'},
    columns = {
        { column = 'member_id', type = 'bigint' },
        { column = 'member_type', type = 'text' },
        { column = 'site_tags',  type = 'jsonb' }
    }    
}

function osm2pgsql.process_node(object)

    tables.point:add_row({
        tags = object.tags,
        geom = { create = 'point' }
    })

end

function osm2pgsql.process_relation(object)
    
    if object.tags.type == 'site' then
      for _,member in ipairs(object.members) do
        tables.siterel:insert({
          member_id = member.ref,
          member_type = member.type,
          site_tags = object.tags 
        })
      end
    end
end
```



-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/1778
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/issues/1778 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220926/738ad0c4/attachment.htm>


More information about the Tile-serving mailing list