<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.yiv4201955791msonormal, li.yiv4201955791msonormal, div.yiv4201955791msonormal
        {mso-style-name:yiv4201955791msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.yiv4201955791msochpdefault, li.yiv4201955791msochpdefault, div.yiv4201955791msochpdefault
        {mso-style-name:yiv4201955791msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.yiv4201955791msohyperlink
        {mso-style-name:yiv4201955791msohyperlink;}
span.yiv4201955791msohyperlinkfollowed
        {mso-style-name:yiv4201955791msohyperlinkfollowed;}
span.yiv4201955791shkpostityyli17
        {mso-style-name:yiv4201955791shkpostityyli17;}
p.yiv4201955791msonormal1, li.yiv4201955791msonormal1, div.yiv4201955791msonormal1
        {mso-style-name:yiv4201955791msonormal1;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.yiv4201955791msohyperlink1
        {mso-style-name:yiv4201955791msohyperlink1;
        color:blue;
        text-decoration:underline;}
span.yiv4201955791msohyperlinkfollowed1
        {mso-style-name:yiv4201955791msohyperlinkfollowed1;
        color:purple;
        text-decoration:underline;}
span.yiv4201955791shkpostityyli171
        {mso-style-name:yiv4201955791shkpostityyli171;
        color:#1F497D;}
p.yiv4201955791msochpdefault1, li.yiv4201955791msochpdefault1, div.yiv4201955791msochpdefault1
        {mso-style-name:yiv4201955791msochpdefault1;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Times New Roman",serif;}
span.Shkpostityyli27
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">“Building” tag can exist in any layer. It is controlled with the osmconf.ini file
<a href="https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini">https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language: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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Lähettäjä:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Djordje Spasic [mailto:issworld2000@yahoo.com]
<br>
<b>Lähetetty:</b> 11. marraskuuta 2016 16:38<br>
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi>; gdal-dev@lists.osgeo.org<br>
<b>Aihe:</b> Re: [gdal-dev] How to replace an osm key?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div id="yui_3_16_0_ym19_1_1478869614109_27778">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Thank you for the reply Jukka.<o:p></o:p></span></p>
<div id="yui_3_16_0_ym19_1_1478869614109_27960">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" id="yui_3_16_0_ym19_1_1478869614109_33437">
<div id="yui_3_16_0_ym19_1_1478869614109_27864">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:gray">> and you must run the query separately for all the layers ( points, lines, multilinestrings, multipolygons).</span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p></o:p></span></p>
</div>
</blockquote>
<div id="yui_3_16_0_ym19_1_1478869614109_31455">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">What does this part mean?<br>
That I need to call ogr2ogr.exe four times:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" id="yui_3_16_0_ym19_1_1478869614109_33366">
<div id="yui_3_16_0_ym19_1_1478869614109_33321">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">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="yui_3_16_0_ym19_1_1478869614109_33315">
<br id="yui_3_16_0_ym19_1_1478869614109_33316">
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="yui_3_16_0_ym19_1_1478869614109_33317">
<br id="yui_3_16_0_ym19_1_1478869614109_33318">
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="yui_3_16_0_ym19_1_1478869614109_33319">
<br id="yui_3_16_0_ym19_1_1478869614109_33320">
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<o:p></o:p></span></p>
</div>
</blockquote>
<div id="yui_3_16_0_ym19_1_1478869614109_33341">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">?<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_29719">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">Doesn't "building:..." key (field) only exist among the multipolygons?<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_29720">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_29718">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_33558">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt" id="yui_3_16_0_ym19_1_1478869614109_33577">
<div id="yui_3_16_0_ym19_1_1478869614109_33478">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:gray">> 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;font-family:"Verdana",sans-serif;color:black"><o:p></o:p></span></p>
</div>
</blockquote>
<div id="yui_3_16_0_ym19_1_1478869614109_33455">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">I didn't understand you this part either.<br>
<br>
The <i id="yui_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>
<br>
If I misunderstood you, can you please provide an example syntax?<br>
<br>
Thank you, and my apology for further disturbance.<br>
<br>
Djordje<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_33496">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_33842">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_29666">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">----------------<o:p></o:p></span></p>
</div>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27777">
<div id="yui_3_16_0_ym19_1_1478869614109_27776">
<div id="yui_3_16_0_ym19_1_1478869614109_27775">
<div id="yui_3_16_0_ym19_1_1478869614109_27774">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">On Friday, November 11, 2016 3:14 PM, Rahkonen Jukka (MML) <</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><a href="mailto:jukka.rahkonen@maanmittauslaitos.fi"><span lang="EN-US">jukka.rahkonen@maanmittauslaitos.fi</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">>
 wrote:</span><span lang="EN-US" style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
<div id="yui_3_16_0_ym19_1_1478869614109_27783">
<div id="yiv4201955791">
<div id="yui_3_16_0_ym19_1_1478869614109_27782">
<div id="yui_3_16_0_ym19_1_1478869614109_27781">
<div id="yui_3_16_0_ym19_1_1478869614109_29717">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Helvetica",sans-serif;color:black">Hi,</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27925">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Helvetica",sans-serif;color:black"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27780">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Helvetica",sans-serif;color:black">Ogrinfo and ogr2ogr usually accept the same syntax and therefore I gave the ogrinfo example. I apologize, it can’t be self-evident
 for all GDAL users.</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_31470">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Helvetica",sans-serif;color:black"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_31457">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Helvetica",sans-serif;color:black">You can do the whole thing with one command like this:
</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_29716">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:11.0pt;font-family:"Helvetica",sans-serif;color:black"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27927">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile"
</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_31459">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">-dialect sqlite –sql "select geometry, building as bldg from multipolygons” output.shp input.osm</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_31460">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27785">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">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 …” and you must run the query separately for all the layers ( points, lines, multilinestrings, multipolygons).</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27827">
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1478869614109_27828">
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:black">-Jukka Rahkonen-</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>