<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1480932384126_17288" dir="ltr"><span id="yui_3_16_0_ym19_1_1480932384126_17351">Thank you Jukka!<br id="yui_3_16_0_ym19_1_1480932384126_17331"><br id="yui_3_16_0_ym19_1_1480932384126_17332">I wasn't precise enough: particular closed way is not sent to both multipolygons.shp and lines.shp. It is sent to the lines.shp, and I am wondering why hasn't it been sent to the multipolygons.shp.<br id="yui_3_16_0_ym19_1_1480932384126_17333"><br id="yui_3_16_0_ym19_1_1480932384126_17334">But your detailed explanation helped me realize that this building footprint does not have the "building" key, only "building:levels". And as "building:levels" is not included in osmconf.ini file's line:</span></div><blockquote id="yui_3_16_0_ym19_1_1480932384126_17799"><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_17859"><span id="yui_3_16_0_ym19_1_1480932384126_17351">closed_ways_are_polygons=<br id="yui_3_16_0_ym19_1_1480932384126_17337"></span></div></blockquote><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_17785"><span id="yui_3_16_0_ym19_1_1480932384126_17351">it seems that this is why OSM driver sent it to the lines.shp.<br id="yui_3_16_0_ym19_1_1480932384126_17339"></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_19113"><br><span id="yui_3_16_0_ym19_1_1480932384126_17351"></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_19112"><span id="yui_3_16_0_ym19_1_1480932384126_17351"><br></span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_19114"><span id="yui_3_16_0_ym19_1_1480932384126_17351">I will definitively read through the links you gave me Jukka. Thank you.<br id="yui_3_16_0_ym19_1_1480932384126_17341"><br id="yui_3_16_0_ym19_1_1480932384126_17342">Until then, do you mind if I ask just for a tiny clarification?<br id="yui_3_16_0_ym19_1_1480932384126_17343"></span></div><blockquote id="yui_3_16_0_ym19_1_1480932384126_17587"><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_17581"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_17471"><font id="yui_3_16_0_ym19_1_1480932384126_17786" color="#808080">> The default rendering style file has such a list<br id="yui_3_16_0_ym19_1_1480932384126_17571">https://github.com/openstreetmap/osm2pgsql/blob/master/default.style </font><br></div></blockquote><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_17503"><span id="yui_3_16_0_ym19_1_1480932384126_17351">Is this the part of that file that I need to take a look at:<br id="yui_3_16_0_ym19_1_1480932384126_17350"><a href="https://github.com/openstreetmap/osm2pgsql/blob/master/default.style#L83-L152" class="" id="yui_3_16_0_ym19_1_1480932384126_17360">https://github.com/openstreetmap/osm2pgsql/blob/master/default.style#L83-L152</a></span></div><div id="yui_3_16_0_ym19_1_1480932384126_17387"><br></div><div id="yui_3_16_0_ym19_1_1480932384126_17791"><br></div><blockquote id="yui_3_16_0_ym19_1_1480932384126_18733"><div id="yui_3_16_0_ym19_1_1480932384126_18724" dir="ltr"><font id="yui_3_16_0_ym19_1_1480932384126_18902" color="#808080">> and you can find it also from the osmconf.ini file</font><br></div></blockquote><div id="yui_3_16_0_ym19_1_1480932384126_17451" dir="ltr">But osmconf.ini file only defines the polygons keys, not linear ones?<br>This is the line in osmconf.ini which defines polygon keys:<br></div><blockquote id="yui_3_16_0_ym19_1_1480932384126_19036"><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_18977">closed_ways_are_polygons=</div></blockquote><div dir="ltr" id="yui_3_16_0_ym19_1_1480932384126_18948"><span id="yui_3_16_0_ym19_1_1480932384126_18905">?</span><br></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: verdana, helvetica, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Monday, December 5, 2016 10:36 AM, jratike80 <jukka.rahkonen@maanmittauslaitos.fi> wrote:<br></font></div>  <br><br> <div class="y_msg_container">In OSM it is a bit fuzzy what closed linestrings mean. Partly it is based on<br clear="none">known and agreed semantics which may be documented in<br clear="none">wiki.openstreetmap.org/wiki/Map_Features. So a closed linestring is a<br clear="none">polygon if is has any building tag, but a closed linestring<br clear="none">"junction=roundabout" is a closed linestring. One can try to make a list<br clear="none">about which closed linestrings are always polygons by sorting the wiki page,<br clear="none">or then you can rely on the previous work. The default rendering style file<br clear="none">has such a list<br clear="none"><a shape="rect" href="https://github.com/openstreetmap/osm2pgsql/blob/master/default.style" target="_blank">https://github.com/openstreetmap/osm2pgsql/blob/master/default.style </a>and you<br clear="none">can find it also from the osmconf.ini file<br clear="none"><br clear="none"><br clear="none"><br clear="none">However, users can use the override tag "area=yes/no" for changing the<br clear="none">interpretation. A way with tags highway=service, area=yes means polygon.<br clear="none">Also, as you can read from <a shape="rect" href="http://wiki.openstreetmap.org/wiki/Key:area," target="_blank">http://wiki.openstreetmap.org/wiki/Key:area, </a>a<br clear="none">way can have one tag that makes it into polygon and another tag that means a<br clear="none">closed linestring at the same time.<br clear="none"><br clear="none">For analyzing why you have now some way in both multipolygons and lines<br clear="none">tables you must take the osm_id from the lines or osm_way_id from the<br clear="none">multipolygons and check the data from the native OSM data. I can't show such<br clear="none">example right ahead but you will find examples from your own data. Take the<br clear="none">id and make a query like this<br clear="none"><br clear="none"><br clear="none"><br clear="none">Check all the tags of the feature. If you still do not find a reason why it<br clear="none">goes into both polygon and linestring tables you can mail us the link.<br clear="none">However, the OSM data model differs so much from the traditional GIS model<br clear="none">with simple features and fixed schema that conversion from OSM to GIS tends<br clear="none">to be lossy.<br clear="none"><br clear="none">-Jukka Rahkonen-<br clear="none"><br clear="none"><br clear="none"><br clear="none">--<br clear="none">View this message in context: <a shape="rect" href="http://osgeo-org.1560.x6.nabble.com/gdal-dev-How-does-GDAL-OSM-driver-deal-with-closed-ways-tp5298544p5298582.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/gdal-dev-How-does-GDAL-OSM-driver-deal-with-closed-ways-tp5298544p5298582.html</a><br clear="none">Sent from the GDAL - Dev mailing list archive at Nabble.com.<br clear="none">_______________________________________________<br clear="none">gdal-dev mailing list<br clear="none"><a shape="rect" ymailto="mailto:gdal-dev@lists.osgeo.org" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br clear="none"><a shape="rect" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br><br></div>  </div> </div>  </div></div></body></html>