[gdal-dev] How to replace an osm key?

Djordje Spasic issworld2000 at yahoo.com
Fri Nov 11 06:38:23 PST 2016


 Thank you for the reply Jukka.


> and you must run the query separately for all the layers ( points, lines, multilinestrings, multipolygons).
What does this part mean?
That I need to call ogr2ogr.exe four times:
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from multipolygons” output.shp input.osm

ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from points” output.shp input.osm

ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from lines” output.shp input.osm

ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from multilinestrings” output.shp input.osm
?
Doesn't "building:..." key (field) only exist among the multipolygons?




> 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 …”
I didn't understand you this part either.

The "select geometry, building as bldg, another_attribute as attr_2 …” 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?

If I misunderstood you, can you please provide an example syntax?

Thank you, and my apology for further disturbance.

Djordje


----------------    On Friday, November 11, 2016 3:14 PM, Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi> wrote:
 
 #yiv4201955791 #yiv4201955791 -- _filtered #yiv4201955791 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv4201955791 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv4201955791 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv4201955791 {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv4201955791 #yiv4201955791 p.yiv4201955791MsoNormal, #yiv4201955791 li.yiv4201955791MsoNormal, #yiv4201955791 div.yiv4201955791MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;}#yiv4201955791 a:link, #yiv4201955791 span.yiv4201955791MsoHyperlink {color:blue;text-decoration:underline;}#yiv4201955791 a:visited, #yiv4201955791 span.yiv4201955791MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv4201955791 span.yiv4201955791Shkpostityyli17 {color:#1F497D;}#yiv4201955791 .yiv4201955791MsoChpDefault {font-size:10.0pt;} _filtered #yiv4201955791 {margin:70.85pt 2.0cm 70.85pt 2.0cm;}#yiv4201955791 div.yiv4201955791WordSection1 {}#yiv4201955791 Hi,    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.    You can do the whole thing with one command like this:    ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" -dialect sqlite –sql "select geometry, building as bldg from multipolygons” output.shp input.osm    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).    -Jukka Rahkonen- 

   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161111/fae82303/attachment.html>


More information about the gdal-dev mailing list