<p>I'm hitting an issue with some tags that are not correctly imported in table planet_osm_polygons, and I think it might be because of the tags order in the .osm source.</p>
<p>For example, these two osm files only differ on the tag ordering of type=boundary:<br><a href="http://osm7.openstreetmap.fr/%7Eosm2pgsql/alsace.osm.gz">http://osm7.openstreetmap.fr/~osm2pgsql/alsace.osm.gz</a><br><a href="http://osm7.openstreetmap.fr/%7Eosm2pgsql/alsace-fail.osm.gz">http://osm7.openstreetmap.fr/~osm2pgsql/alsace-fail.osm.gz</a></p>
<div class="highlight"><pre><span class="gd">--- alsace.osm 2013-06-01 00:38:25.182404624 +0200</span>
<span class="gi">+++ alsace-fail.osm 2013-06-01 01:29:07.841660538 +0200</span>
<span class="gu">@@ -31910,6 +31910,7 @@</span>
<member type="way" ref="48683073" role="outer"/>
<member type="way" ref="48565263" role="outer"/>
<member type="way" ref="23301554" role="outer"/>
<span class="gi">+ <tag k="type" v="boundary"/></span>
<tag k="admin_level" v="4"/>
<tag k="alt_name:la" v="Elisatia"/>
<tag k="boundary" v="administrative"/>
<span class="gu">@@ -31933,7 +31934,6 @@</span>
<tag k="ref:INSEE" v="42"/>
<tag k="ref:ISO 3166-2" v="A"/>
<tag k="ref:NUTS" v="FR42"/>
<span class="gd">- <tag k="type" v="boundary"/></span>
<tag k="wikipedia" v="fr:Alsace"/>
</relation>
</pre></div>
<p>With the second file, admin_level column of planet_osm_polygon is not filled with value 4.</p>
<p>Must the tags be sorted before importing with osm2pgsql ?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/osm2pgsql/issues/35'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/g8smGCFOcVLF28Q-xX3zcWTpl64m4ZJf83iwD5itR4HUC916gAzbtuLTVhP3k4EK.gif' height='1' width='1'></p>