<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:13px"><div id="yiv1770884028"><div id="yui_3_16_0_ym19_1_1478886502261_15993"><div style="color:#000;background-color:#fff;font-family:verdana, helvetica, sans-serif;font-size:13px;" id="yui_3_16_0_ym19_1_1478886502261_15992"><div id="yiv1770884028"><div id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_12702"><div id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_12701" style="color:#000;background-color:#fff;font-family:verdana, helvetica, sans-serif;font-size:13px;">Thank you Jukka.<br clear="none"><br clear="none">Does this:<br clear="none"><blockquote id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_12792"><div id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_7083"><div dir="ltr" id="yui_3_16_0_ym19_1_1478886502261_16054">ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" <b id="yui_3_16_0_ym19_1_1478886502261_16103">-dialect sqlite –sql "select geometry, building as bldg, foo, bar from multipolygons”</b> output.shp input.osm</div></div></blockquote>replace the part from the osmconfig.ini file:<br clear="none"><blockquote id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_7061"><div dir="ltr" id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_7008"># keys to report as OGR fields<br id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_7007" clear="none">attributes=building,foo,bar<br clear="none"></div></blockquote><div id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_7060">?<br clear="none"></div><div id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_6951"><span></span></div> <div class="yiv1770884028qtdSeparateBR" id="yiv1770884028yui_3_16_0_ym19_1_1478886502261_12791"><br clear="none">----------------------------<br clear="none"></div><div class="yiv1770884028yqt4430121439" id="yiv1770884028yqt00568"></div></div></div></div><div class="yiv1770884028yqt9896827236" id="yiv1770884028yqt02075"><div id="yui_3_16_0_ym19_1_1478886502261_16019"> <div style="font-family:verdana, helvetica, sans-serif;font-size:13px;" id="yui_3_16_0_ym19_1_1478886502261_16018"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_ym19_1_1478886502261_16017"> <div dir="ltr" id="yui_3_16_0_ym19_1_1478886502261_16057"><font id="yui_3_16_0_ym19_1_1478886502261_16056" size="2" face="Arial"> On Friday, November 11, 2016 6:46 PM, Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv1770884028y_msg_container" id="yui_3_16_0_ym19_1_1478886502261_16061"><div id="yiv1770884028"><div id="yui_3_16_0_ym19_1_1478886502261_16060">
<div id="yui_3_16_0_ym19_1_1478886502261_16059">
<div style="font-family:Calibri, sans-serif;font-size:11pt;" id="yui_3_16_0_ym19_1_1478886502261_16058">Hi,<br clear="none">
<br clear="none">
If you select geometry and attribute "foo" that's all you get. If you want attribute "bar" as well you must do "select geometry,foo,bar from your_table". That is plain SQL, you will find tutorials from the web.<br clear="none">
<br clear="none">
-Jukka-<br clear="none">
</div>
</div>
<div class="yiv1770884028yqt0872194206" id="yiv1770884028yqt50484"><div dir="ltr">
<hr>
<span style="font-family:Calibri, sans-serif;font-size:11pt;font-weight:bold;">Lähettäjä:
</span><span style="font-family:Calibri, sans-serif;font-size:11pt;"><a rel="nofollow" shape="rect" ymailto="mailto:issworld2000@yahoo.com" target="_blank" href="mailto:issworld2000@yahoo.com">Djordje Spasic</a></span><br clear="none">
<span style="font-family:Calibri, sans-serif;font-size:11pt;font-weight:bold;">Lähetetty:
</span><span style="font-family:Calibri, sans-serif;font-size:11pt;">‎11.‎11.‎2016 19:10</span><br clear="none">
<span style="font-family:Calibri, sans-serif;font-size:11pt;font-weight:bold;">Vastaanottaja:
</span><span style="font-family:Calibri, sans-serif;font-size:11pt;"><a rel="nofollow" shape="rect" ymailto="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank" href="mailto:jukka.rahkonen@maanmittauslaitos.fi">Rahkonen Jukka (MML)</a>;
<a rel="nofollow" shape="rect" ymailto="mailto:gdal-dev@lists.osgeo.org" target="_blank" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a></span><br clear="none">
<span style="font-family:Calibri, sans-serif;font-size:11pt;font-weight:bold;">Aihe:
</span><span style="font-family:Calibri, sans-serif;font-size:11pt;">Re: [gdal-dev] How to replace an osm key?</span><br clear="none">
<br clear="none">
</div>
<div id="yui_3_16_0_ym19_1_1478886502261_16082">
<div style="color:#000;background-color:#fff;font-family:verdana, helvetica, sans-serif;font-size:13px;" id="yui_3_16_0_ym19_1_1478886502261_16081">
Thank you Jukka.<br clear="none">
<br clear="none">
I understand now why I need to repeat the same syntax 4 times (by only changing multipolygon/multilinestrings/lines/points).<br clear="none">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10460"><br clear="none">
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10458"><br clear="none">
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10459"><br clear="none">
</div>
Can you explain this part as well please:<br clear="none">
<blockquote id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10455">
<div dir="ltr" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10456"><font id="yiv1770884028yui_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 clear="none">
<div class="yiv1770884028qtdSeparateBR" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10231"><br clear="none">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10480"><br clear="none">
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10481">----------------<br clear="none">
</div>
</div>

</div>
</div></div>
</div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></div></div></div><div class=".yiv1770884028yahoo_quoted">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10144" style="font-family:verdana, helvetica, sans-serif;font-size:13px;">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10143" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">
<div dir="ltr" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10142"><font id="yiv1770884028yui_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 clear="none">
</font></div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10482"><span style="font-size:11.0pt;"><br clear="none">
</span></div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10365"><span style="font-size:11.0pt;">Hi,</span></div>
<div class="yiv1770884028y_msg_container" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10153">
<div id="yiv1770884028">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10152">
<div class="yiv1770884028WordSection1" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10151">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10366"><span style="font-size:11.0pt;"> </span></div>
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10483"><span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10485" style="font-size:11.0pt;" lang="EN-US">“Building” tag can exist in any layer. It is controlled with the osmconf.ini file
<a rel="nofollow" shape="rect" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10484" target="_blank" href="https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini">
https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini</a></span></div>
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10150"><span style="font-size:11.0pt;" lang="EN-US"> </span></div>
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10229"><span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10230" style="font-size:11.0pt;" 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="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10155"><span style="font-size:11.0pt;" lang="EN-US"> </span></div>
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10154"><span style="font-size:11.0pt;" lang="EN-US">-Jukka Rahkonen-</span></div>
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10228"><span style="font-size:11.0pt;" lang="EN-US"> </span></div>
<div class="yiv1770884028yqt8995803975" id="yiv1770884028yqt16009">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10158">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10157" style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm;">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10156"><b><span style="font-size:11.0pt;">Lähettäjä:</span></b><span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10159" style="font-size:11.0pt;"> 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="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10227"> </div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10176">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_27778">
<div class="yiv1770884028MsoNormal" style="background:white;"><span style="font-size:10.0pt;">Thank you for the reply Jukka.</span></div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_27960">
<div class="yiv1770884028MsoNormal" style="background:white;"><span style="font-size:10.0pt;"> </span></div>
</div>
<blockquote id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33437" style="margin-top:5.0pt;margin-bottom:5.0pt;">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_27864">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10501" style="background:white;">
<span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10500" style="font-size:10.0pt;" 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="yiv1770884028yui_3_16_0_ym19_1_1478869614109_31455">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10175" style="background:white;">
<span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10174" style="font-size:10.0pt;">What does this part mean?<br clear="none">
That I need to call ogr2ogr.exe four times:</span></div>
</div>
<blockquote id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33366" style="margin-top:5.0pt;margin-bottom:5.0pt;">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33321">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10177" style="background:white;">
<span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10178" style="font-size:10.0pt;">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="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33315" clear="none">
<br id="yiv1770884028yui_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="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33317" clear="none">
<br id="yiv1770884028yui_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="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33319" clear="none">
<br id="yiv1770884028yui_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="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33341">
<div class="yiv1770884028MsoNormal" style="background:white;"><span style="font-size:10.0pt;">?</span></div>
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_29719">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10180" style="background:white;">
<span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10367" style="font-size:10.0pt;">Doesn't "building:..." key (field) only exist among the multipolygons?</span></div>
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_29720">
<div class="yiv1770884028MsoNormal" style="background:white;"><span style="font-size:10.0pt;"> </span></div>
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_29718">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10181" style="background:white;">
<span style="font-size:10.0pt;"> </span></div>
</div>
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33558">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10370" style="background:white;">
<span style="font-size:10.0pt;"> </span></div>
</div>
<blockquote id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33577" style="margin-top:5.0pt;margin-bottom:5.0pt;">
<div id="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33478">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10369" style="background:white;">
<span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10368" style="font-size:10.0pt;">> 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="yiv1770884028yui_3_16_0_ym19_1_1478869614109_33455">
<div class="yiv1770884028MsoNormal" id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10183" style="background:white;">
<span id="yiv1770884028yui_3_16_0_ym19_1_1478883721769_10182" style="font-size:10.0pt;">I didn't understand you this part either.<br clear="none">
<br clear="none">
The <i id="yiv1770884028yui_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>