Thank you Jukka.
Does this:
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI
Shapefile" -dialect sqlite –sql "select geometry, building as bldg, foo, bar
from multipolygons” output.shp input.osm
replace the part from the osmconfig.ini file:
# keys to report as OGR fields
attributes=building,foo,bar
?
----------------------------
On Friday, November 11, 2016 6:46 PM, Rahkonen Jukka (MML)
<jukka.rahko...@maanmittauslaitos.fi> wrote:
Hi,
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.
-Jukka-
Lähettäjä:Djordje Spasic
Lähetetty:11.11.2016 19:10
Vastaanottaja:Rahkonen Jukka (MML);gdal-dev@lists.osgeo.org
Aihe:Re: [gdal-dev] How to replace an osm key?
Thank you Jukka.
I understand now why I need to repeat the same syntax 4 times (by only changing
multipolygon/multilinestrings/lines/points).
Can you explain this part as well please:
> 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 …”
?
----------------
On Friday, November 11, 2016 4:04 PM, Rahkonen Jukka (MML)
<jukka.rahko...@maanmittauslaitos.fi> wrote:
Hi, “Building” tag can exist in any layer. It is controlled with the
osmconf.ini filehttps://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini 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. -Jukka Rahkonen-
Lähettäjä: Djordje Spasic [mailto:issworld2...@yahoo.com]
Lähetetty: 11. marraskuuta 2016 16:38
Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi>;
gdal-dev@lists.osgeo.org
Aihe: Re: [gdal-dev] How to replace an osm key? 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
frommultipolygons” output.shp input.osm
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI
Shapefile" -dialect sqlite –sql "select geometry, building as bldg frompoints”
output.shp input.osm
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI
Shapefile" -dialect sqlite –sql "select geometry, building as bldg fromlines”
output.shp input.osm
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI
Shapefile" -dialect sqlite –sql "select geometry, building as bldg
frommultilinestrings” 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
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev