[OSM-dev] osm2pgsql - some polygons not ending up in osm_polygon

Svavar Kjarrval svavar at kjarrval.is
Thu Dec 20 13:58:42 GMT 2012


Yep, another post about osm2pgsql in a short interval.

I've managed to convert the Iceland extract I got from geofabrik into a
postgis database. There's however a snag. It seems like not all of the
data ended up in the correct tables.

The line I used to import the data:
osm2pgsql -d osm --cache-strategy sparse -S
/[workdir]/osm/mapnik-stylesheets/default.style --prefix osm --slim
* Some of the path replaced with [workdir].
* The import log follows as an attachment.

Many municipalities went into osm_rels while the others went into
osm_polygon. The municipalities are all defined with type=boundary and
admin_level=6. I didn't see anything obvious which might cause osm2pgsql
to categories them differently.

Kind of the same thing happens with some of the suburbs in Reykjavík
since most of them ended up in osm_polygon, but not all.

You can see it on
http://osm.is/?zoom=11&lat=64.10315&lon=-21.82199&layers=B000FTF . The
area should mostly be filled with a transparent(ish) blue layer. You can
see the desired effect on

SELECT name, admin_level,boundary FROM osm_polygon WHERE admin_level = '6'
name 	admin_level 	boundary
Álftanes 	6 	administrative
Seltjarnarnes 	6 	administrative
Kópavogur 	6 	administrative
Hrísey 	6 	administrative
Hríseyjarhreppur 	6 	administrative

The top 3 municipalities in the table are in the capital area in
Iceland. The ones that should be there too are Hafnarfjörður, Garðabær,
Reykjavík and Mosfellsbær.

The table parameter in the stylesheet file (in case someone asks):
(select way,name from osm_polygon where boundary='administrative' and
admin_level='6' ) as admin

Is there a osm2pgsql parameter I'm missing in the import or some other
apparent implementation fault of mine?

With regards,
Svavar Kjarrval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20121220/05845155/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osm2pgsql_import.log
Type: text/x-log
Size: 3294 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20121220/05845155/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20121220/05845155/attachment.pgp>

More information about the dev mailing list