<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi.<br>
<br>
Yep, another post about osm2pgsql in a short interval.<br>
<br>
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.<br>
<br>
The line I used to import the data:<br>
osm2pgsql -d osm --cache-strategy sparse -S
/[workdir]/osm/mapnik-stylesheets/default.style --prefix osm --slim
iceland.osm<br>
* Some of the path replaced with [workdir].<br>
* The import log follows as an attachment.<br>
<br>
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.<br>
<br>
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.<br>
<br>
You can see it on
<a class="moz-txt-link-freetext" href="http://osm.is/?zoom=11&lat=64.10315&lon=-21.82199&layers=B000FTF">http://osm.is/?zoom=11&lat=64.10315&lon=-21.82199&layers=B000FTF</a>
. The area should mostly be filled with a transparent(ish) blue
layer. You can see the desired effect on
<a class="moz-txt-link-freetext" href="http://layers.openstreetmap.fr/?zoom=11&lat=64.10315&lon=-21.82199&layers=B00FFFFFFFFFFTFFFFFFFFF">http://layers.openstreetmap.fr/?zoom=11&lat=64.10315&lon=-21.82199&layers=B00FFFFFFFFFFTFFFFFFFFF</a>
.<br>
<br>
SELECT name, admin_level,boundary FROM osm_polygon WHERE admin_level
= '6'<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<table style="color: rgb(0, 0, 0); font-family: arial, tahoma,
verdana, helvetica, sans-serif, serif; font-size: 13px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
<tbody>
<tr>
<th class="data" style="color: rgb(0, 0, 0); background-color:
rgb(230, 230, 204); font-family: arial, tahoma, verdana,
helvetica, sans-serif, serif; font-size: smaller;">name</th>
<th class="data" style="color: rgb(0, 0, 0); background-color:
rgb(230, 230, 204); font-family: arial, tahoma, verdana,
helvetica, sans-serif, serif; font-size: smaller;">admin_level</th>
<th class="data" style="color: rgb(0, 0, 0); background-color:
rgb(230, 230, 204); font-family: arial, tahoma, verdana,
helvetica, sans-serif, serif; font-size: smaller;">boundary</th>
</tr>
<tr class="data1" style="background-color: rgb(243, 243, 233);
text-align: left; color: rgb(0, 0, 0); font-family: arial,
tahoma, verdana, helvetica, sans-serif, serif; font-size:
smaller;">
<td style="white-space: nowrap;">Álftanes</td>
<td style="white-space: nowrap;">6</td>
<td style="white-space: nowrap;">administrative</td>
</tr>
<tr class="data2" style="background-color: rgb(230, 230, 204);
text-align: left; color: rgb(0, 0, 0); font-family: arial,
tahoma, verdana, helvetica, sans-serif, serif; font-size:
smaller;">
<td style="white-space: nowrap;">Seltjarnarnes</td>
<td style="white-space: nowrap;">6</td>
<td style="white-space: nowrap;">administrative</td>
</tr>
<tr class="data1" style="background-color: rgb(243, 243, 233);
text-align: left; color: rgb(0, 0, 0); font-family: arial,
tahoma, verdana, helvetica, sans-serif, serif; font-size:
smaller;">
<td style="white-space: nowrap;">Kópavogur</td>
<td style="white-space: nowrap;">6</td>
<td style="white-space: nowrap;">administrative</td>
</tr>
<tr class="data2" style="background-color: rgb(230, 230, 204);
text-align: left; color: rgb(0, 0, 0); font-family: arial,
tahoma, verdana, helvetica, sans-serif, serif; font-size:
smaller;">
<td style="white-space: nowrap;">Hrísey</td>
<td style="white-space: nowrap;">6</td>
<td style="white-space: nowrap;">administrative</td>
</tr>
<tr class="data1" style="background-color: rgb(243, 243, 233);
text-align: left; color: rgb(0, 0, 0); font-family: arial,
tahoma, verdana, helvetica, sans-serif, serif; font-size:
smaller;">
<td style="white-space: nowrap;">Hríseyjarhreppur</td>
<td style="white-space: nowrap;">6</td>
<td style="white-space: nowrap;">administrative</td>
</tr>
</tbody>
</table>
<br>
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.<br>
<br>
The table parameter in the stylesheet file (in case someone asks):<br>
(select way,name from osm_polygon where boundary='administrative'
and admin_level='6' ) as admin<br>
<br>
Is there a osm2pgsql parameter I'm missing in the import or some
other apparent implementation fault of mine?<br>
<br>
With regards,<br>
Svavar Kjarrval<br>
</body>
</html>