omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
719 stars 157 forks source link

cannot import relation "Schladming" #97

Closed prozessor13 closed 8 years ago

prozessor13 commented 8 years ago

hallo,

i want to import the administrative-area Schladming without success. here is my mappingfile:

tags:
  load_all: true

tables:
  schladming:
    type: polygon
    fields:
    - name: osm_id
      type: id
    - name: geometry
      type: geometry
    - key: name
      name: name
      type: string

and here an osm extract with only "Schladming":

schladming.osm.gz

when i do a

imposm3 import -overwritecache -mapping test.yml -read schladming.osm.pbf
imposm3 import -deployproduction -mapping test.yml -write -connection postgis://localhost/test

the table osm_schladming is empty.

here are the outputs of the read and write processes:

[Apr 14 13:04:43] [INFO] removing existing cache /tmp/imposm3
[Apr 14 13:04:43] [INFO] [     0] C:       0/s (1133) N:       0/s (5) W:       0/s (13) R:      0/s (1)
[Apr 14 13:04:43] [INFO] Reading OSM data took: 9.439982ms
[Apr 14 13:04:43] [INFO] Imposm took: 9.570248ms
[Apr 14 13:04:46] [INFO] Writing OSM data took: 91.927441ms
[Apr 14 13:04:46] [INFO] [     0] C:       0/s (0) N:       0/s (5) W:       0/s (13) R:      0/s (1)
[Apr 14 13:04:46] [INFO] [PostGIS] Creating generalized tables took: 74.521µs
[Apr 14 13:04:46] [INFO] [PostGIS] Creating OSM id index on osm_schladming took: 7.336589ms
[Apr 14 13:04:46] [INFO] [PostGIS] Creating geometry index on osm_schladming took: 3.194152ms
[Apr 14 13:04:46] [INFO] [PostGIS] Creating geometry indices took: 10.752049ms
[Apr 14 13:04:46] [INFO] Importing OSM data took: 103.03963ms
[Apr 14 13:04:46] [INFO] [PostGIS] Rotating osm_schladming from import -> public -> backup
[Apr 14 13:04:46] [INFO] [PostGIS] Rotating tables took: 7.162074ms
[Apr 14 13:04:46] [INFO] Imposm took: 110.591765ms

thx for your help. max.

ImreSamu commented 8 years ago

Hi @prozessor13 !

for me , with the example mapping is working :

imposm3dev=> select name, type, admin_level from osm_admin;
;
    name    |      type      | admin_level 
------------+----------------+-------------
 Schladming | administrative |           8
(1 row)

Probably the 'mapping' definition is missing in your yml.

    mapping:
      boundary:
      - administrative

try this

tables:
  admin:
    fields:
    - name: osm_id
      type: id
    - name: geometry
      type: geometry
    - key: name
      name: name
      type: string
    - name: type
      type: mapping_value
    - key: admin_level
      name: admin_level
      type: integer
    mapping:
      boundary:
      - administrative
    type: polygon

or the /example-mapping.yml

prozessor13 commented 8 years ago

oh, thx for your quick response, this did the trick!

cheers. max.