<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="text/html; charset=utf-8">
</head>
<body>
<div>
<div style="font-family:Calibri,sans-serif; font-size:11pt">Hi,<br>
<br>
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>
<br>
-Jukka-<br>
</div>
</div>
<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 href="mailto:issworld2000@yahoo.com">Djordje Spasic</a></span><br>
<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>
<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 href="mailto:jukka.rahkonen@maanmittauslaitos.fi">Rahkonen Jukka (MML)</a>;
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a></span><br>
<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>
<br>
</div>
<div>
<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 id="yui_3_16_0_ym19_1_1478883721769_10144" style="font-family:verdana,helvetica,sans-serif; font-size:13px">
<div id="yui_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="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 id="yui_3_16_0_ym19_1_1478883721769_10485" lang="EN-US" style="font-size:11.0pt">“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 lang="EN-US" style="font-size:11.0pt"> </span></div>
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10229"><span id="yui_3_16_0_ym19_1_1478883721769_10230" lang="EN-US" style="font-size:11.0pt">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 lang="EN-US" style="font-size:11.0pt"> </span></div>
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10154"><span lang="EN-US" style="font-size:11.0pt">-Jukka Rahkonen-</span></div>
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10228"><span lang="EN-US" style="font-size:11.0pt"> </span></div>
<div class="yiv0648350492yqt8995803975" id="yiv0648350492yqt16009">
<div id="yui_3_16_0_ym19_1_1478883721769_10158">
<div id="yui_3_16_0_ym19_1_1478883721769_10157" style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<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 id="yui_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="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" id="yui_3_16_0_ym19_1_1478883721769_10501" style="background:white">
<span id="yui_3_16_0_ym19_1_1478883721769_10500" lang="EN-US" style="font-size:10.0pt">> 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" id="yui_3_16_0_ym19_1_1478883721769_10175" style="background:white">
<span id="yui_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="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" id="yui_3_16_0_ym19_1_1478883721769_10177" style="background:white">
<span id="yui_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="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" id="yui_3_16_0_ym19_1_1478883721769_10180" style="background:white">
<span id="yui_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="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" id="yui_3_16_0_ym19_1_1478883721769_10181" style="background:white">
<span style="font-size:10.0pt"> </span></div>
</div>
<div id="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33558">
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10370" style="background:white">
<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" id="yui_3_16_0_ym19_1_1478883721769_10369" style="background:white">
<span id="yui_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="yiv0648350492yui_3_16_0_ym19_1_1478869614109_33455">
<div class="yiv0648350492MsoNormal" id="yui_3_16_0_ym19_1_1478883721769_10183" style="background:white">
<span id="yui_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="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>
</div>
</body>
</html>