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

imposm3 mapping #124

Open
andrew-aladev opened this issue May 16, 2017 · 15 comments
Open

imposm3 mapping #124

andrew-aladev opened this issue May 16, 2017 · 15 comments

Comments

@andrew-aladev
Copy link

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
Copy link

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

@asmyasnikov
Copy link

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

@andrew-aladev
Copy link
Author

andrew-aladev commented May 25, 2017

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
Copy link
Author

andrew-aladev commented May 25, 2017

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
Copy link
Author

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
Copy link

asimeqi commented Jul 22, 2017

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
Copy link

kaktus40 commented May 3, 2018

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

mapping.txt

@NickStallman
Copy link

@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
Copy link

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

@clementmas
Copy link

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

imposm-mapping.json.txt

@Lokks
Copy link

Lokks commented Feb 18, 2019

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

@clementmas
Copy link

No @Lokks, it's for imposm3.

@Lokks
Copy link

Lokks commented Feb 18, 2019

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
Copy link

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

@omichalek
Copy link

omichalek commented Jul 30, 2020

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

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

No branches or pull requests

8 participants