mapbox / osm-bright

A Carto template for OpenStreetMap data
BSD 3-Clause "New" or "Revised" License
698 stars 225 forks source link

imposm3 mapping #124

Open andrew-aladev opened 7 years ago

andrew-aladev commented 7 years ago

Hello. Is it possible to use imposm3 with osm bright? It looks like imposm3 does not support mapping for imposm2 (example-mapping.yml). How to convert it? Thank you.

asmyasnikov commented 7 years ago

+1 How to use old imposm-mapping.py from osm-bright project for imposm3 util?

asmyasnikov commented 7 years ago

example-mapping.yml create not compatible with osm-brigth tables at postgresql database =(

andrew-aladev commented 7 years ago

imposm 2 does not support updating with osc files, osm2pgsql and imposm 3 does support it. We have to use osm2pgsql with multi-geometry key. It is extremely slow.

andrew-aladev commented 7 years ago

BTW We can import data with imposm 2, but we couldn't update it with osc and osm2pgsql. imposm 2 and osm2pgsql schemas are completely different.

andrew-aladev commented 7 years ago

BTW osm2pgsql in multi polygon mode can throw random segfault while updating world's region. I've received 30% chance to receive a segfault. Please move to imposm 3.

asimeqi commented 7 years ago

It seems there is no support for this project anymore. Meanwhile I see that you guys are much more advanced than me. Would you mind sharing how you generate the tiles? I load the data in postgres with: osm2pgsql.exe -c -G -S .\default.style -U postgres -d gb --hstore -C 32000 great-britain-latest.osm.pbf But when I preview the map in Tilemill the map is mostly wrong. The cities are in correct places but the roads are in the wrong places and most of them appear simply as straight lines. Also other objects like lakes and forests are missing.

kaktus40 commented 6 years ago

Hello, I wrote a mapping for imposm3 that should be compliant with osm-bright (in yaml)

mapping.txt

NickStallman commented 5 years ago

@kaktus40 I gave your mapping a go but it wasn't entirely compatible. Did you have an updated version? If not I might have a go at fixing it up.

kaktus40 commented 5 years ago

Hello, I corrected the file but I can't access the updates version until the next two weeks. Sorry

clementmas commented 5 years ago

I have a compatible imposm3 mapping file (json file) if that's any help:

imposm-mapping.json.txt

Lokks commented 5 years ago

imposm-mapping.json.txt @clementmas Hi! Is that mapping file for osm2pgsql?

clementmas commented 5 years ago

No @Lokks, it's for imposm3.

Lokks commented 5 years ago

No @Lokks, it's for imposm3.

sorry, wrong question. Of course it's for imposm, but does it fits for "osm2pgsql-friendly" style named osmbright?

clementmas commented 5 years ago

I don't know about the compatibility with osm2pgsql, I just needed the imposm3 mapping file.

omichalek commented 4 years ago

Had you please been successful importing to OSM-Bright with imposm3?

Using the .yml mapping by @kaktus40 I cannot import a .pbf, imposm3 complains:

0:00:00 SQL Error: pq: column "name" specified more than once in query 
        CREATE TABLE IF NOT EXISTS "import"."osm_buildings" (
            id SERIAL,
"osm_id" BIGINT,
"name" VARCHAR,
"name" REAL,
"type" VARCHAR,
PRIMARY KEY ("osm_id", "id")
        );

Using the .json by @clementmas, the import goes through but TileMill complains:

Postgis Plugin: ERROR:  relation "osm_landusages_gen0" does not exist
LINE 2:   FROM osm_landusages_gen0
               ^
in executeQuery Full sql was: 'SELECT * FROM ( SELECT geometry, type, area
  FROM osm_landusages_gen0
  ORDER BY area DESC
) AS data LIMIT 0'
  encountered during parsing of layer 'landuse_gen0' in Layer

Is this related to the mapping file, don't you know?

EDIT: Ignore me, I need to learn how to use imposm3, I omitted -deployproduction

This works for me: ~/bin/imposm3 import -config postgis-connection.json --mapping imposm3-mapping.json -read ~/Downloads/extract.osm.pbf -overwritecache -write -deployproduction