<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:13px">Thank you Jukka.<br><br>I understand now why I need to repeat the same syntax 4 times (by only changing multipolygon/multilinestrings/lines/points).<br><div id="yui_3_16_0_ym19_1_1478883721769_10460"><br></div><div id="yui_3_16_0_ym19_1_1478883721769_10458"><br></div><div id="yui_3_16_0_ym19_1_1478883721769_10459"><br></div>Can you explain this part as well please:<br><blockquote id="yui_3_16_0_ym19_1_1478883721769_10455"><div dir="ltr" id="yui_3_16_0_ym19_1_1478883721769_10456"><font id="yui_3_16_0_ym19_1_1478883721769_10457" color="#808080">>
 You must edit the SQL parameter to include all the fields that you want
 to get into the result  "select geometry, building as bldg, 
another_attribute as attr_2 …”</font></div></blockquote>?<br><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1478883721769_10231"><br><div id="yui_3_16_0_ym19_1_1478883721769_10480"><br></div><div id="yui_3_16_0_ym19_1_1478883721769_10481">----------------<br></div></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1478883721769_10145" style="display: block;"> <div style="font-family: verdana, helvetica, sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1478883721769_10144"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1478883721769_10143"> <div dir="ltr" id="yui_3_16_0_ym19_1_1478883721769_10142"><font id="yui_3_16_0_ym19_1_1478883721769_10141" size="2" face="Arial"> On Friday, November 11, 2016 4:04 PM, Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi> wrote:<br></font></div><div id="yui_3_16_0_ym19_1_1478883721769_10482">  <span style="font-size:11.0pt;"><br></span></div><div id="yui_3_16_0_ym19_1_1478883721769_10365"><span style="font-size:11.0pt;">Hi,</span></div><div class="y_msg_container" id="yui_3_16_0_ym19_1_1478883721769_10153"><div id="yiv0648350492"><div id="yui_3_16_0_ym19_1_1478883721769_10152"><div class="yiv0648350492WordSection1" id="yui_3_16_0_ym19_1_1478883721769_10151"> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10366"><span style="font-size:11.0pt;">  </span></div> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10483"><span style="font-size:11.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10485" lang="EN-US">“Building” tag can exist in any layer. It is controlled with the osmconf.ini file
<a rel="nofollow" shape="rect" target="_blank" href="https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini" id="yui_3_16_0_ym19_1_1478883721769_10484">https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini</a></span></div> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10150"><span style="font-size:11.0pt;" lang="EN-US">  </span></div> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10229"><span style="font-size:11.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10230" lang="EN-US">It is true that by default it is selected only for multipolygons. However, I suppose that in the native OSM data the building
 tag is sometimes used also on points and relations (other_relations for GDAL). I also aimed at a general answer that could be useful for all tags and layers in OSM data.</span></div> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10155"><span style="font-size:11.0pt;" lang="EN-US">  </span></div> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10154"><span style="font-size:11.0pt;" lang="EN-US">-Jukka Rahkonen-</span></div> 
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10228"><span style="font-size:11.0pt;" lang="EN-US">  </span></div> 
<div class="yiv0648350492yqt8995803975" id="yiv0648350492yqt16009"><div id="yui_3_16_0_ym19_1_1478883721769_10158">
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm;" id="yui_3_16_0_ym19_1_1478883721769_10157">
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10156"><b><span style="font-size:11.0pt;">Lähettäjä:</span></b><span style="font-size:11.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10159"> Djordje Spasic [mailto:issworld2000@yahoo.com]
<br clear="none">
<b>Lähetetty:</b> 11. marraskuuta 2016 16:38<br clear="none">
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi>; gdal-dev@lists.osgeo.org<br clear="none">
<b>Aihe:</b> Re: [gdal-dev] How to replace an osm key?</span></div> 
</div>
</div>
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10227">  </div> 
<div id="yui_3_16_0_ym19_1_1478883721769_10176">
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_27778">
<div class="yiv0648350492MsoNormal" style="background:white;"><span style="font-size:10.0pt;">Thank you for the reply Jukka.</span></div> 
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_27960">
<div class="yiv0648350492MsoNormal" style="background:white;"><span style="font-size:10.0pt;">  </span></div> 
</div>
<blockquote id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33437" style="margin-top:5.0pt;margin-bottom:5.0pt;">
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_27864">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10501"><span style="font-size:10.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10500" lang="EN-US">> and you must run the query separately for all the layers ( points, lines, multilinestrings, multipolygons).</span><span style="font-size:10.0pt;"></span></div> 
</div>
</blockquote>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_31455">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10175"><span style="font-size:10.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10174">What does this part mean?<br clear="none">
That I need to call ogr2ogr.exe four times:</span></div> 
</div>
<blockquote id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33366" style="margin-top:5.0pt;margin-bottom:5.0pt;">
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33321">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10177"><span style="font-size:10.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10178">ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg
 from <b>multipolygons</b>” output.shp input.osm<br id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33315" clear="none">
<br id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33316" clear="none">
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from
<b>points</b>” output.shp input.osm<br id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33317" clear="none">
<br id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33318" clear="none">
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from
<b>lines</b>” output.shp input.osm<br id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33319" clear="none">
<br id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33320" clear="none">
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from
<b>multilinestrings</b>” output.shp input.osm</span></div> 
</div>
</blockquote>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33341">
<div class="yiv0648350492MsoNormal" style="background:white;"><span style="font-size:10.0pt;">?</span></div> 
</div>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_29719">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10180"><span style="font-size:10.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10367">Doesn't "building:..." key (field) only exist among the multipolygons?</span></div> 
</div>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_29720">
<div class="yiv0648350492MsoNormal" style="background:white;"><span style="font-size:10.0pt;">  </span></div> 
</div>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_29718">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10181"><span style="font-size:10.0pt;">  </span></div> 
</div>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33558">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10370"><span style="font-size:10.0pt;">  </span></div> 
</div>
<blockquote id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33577" style="margin-top:5.0pt;margin-bottom:5.0pt;">
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33478">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10369"><span style="font-size:10.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10368">> You must edit the SQL parameter to include all the fields that you want to get into the result  "select geometry, building as bldg, another_attribute
 as attr_2 …”</span><span style="font-size:10.0pt;"></span></div> 
</div>
</blockquote>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33455">
<div class="yiv0648350492MsoNormal" style="background:white;" id="yui_3_16_0_ym19_1_1478883721769_10183"><span style="font-size:10.0pt;" id="yui_3_16_0_ym19_1_1478883721769_10182">I didn't understand you this part either.<br clear="none">
<br clear="none">
The <i id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33796">"select geometry, building as bldg, another_attribute as attr_2 …”</i> part needs to include only those keys (fields) which I would like to get changed? Not all the others which I would like to have them remain
 the same as in original .osm file?<br clear="none">
<br clear="none">
If I misunderstood you, can you please provide an example syntax?<br clear="none">
<br clear="none">
Thank you, and my apology for further disturbance.<br clear="none">
<br clear="none">
Djordje</span></div> 
</div>
</div></div></div>
</div>
</div></div></div>  </div> </div>  </div></div></body></html>