I am trying to use OGR2OGR to convert an .osm file to a .shp file:
ogr2ogr.exe --config OSM_USE_CUSTOM_INDEXING NO -skipfailures -f "ESRI Shapefile" output.shp input.osm
OGR2OGR does this pretty nicely, and converts the .osm file to four .shp files in the "output.shp" folder: lines.shp, multilinestrings.shp, multipolygons.shp, points.shp.
What I would like to do, is to force all four resulting .shp files to have equal number of attributes (or "keys" in openstreetmap terminology).
For example, a polygon would certainly not have an attribute highway
. While a line could have. But I still want to force the multipolygons.shp file to have the highway
attribute.
To make it clear, I am not interested in specific attributes.
I would just want all of the upper 4 .shp files to have the same attributes, and the same number of attributes.
Can this be done somehow by editing the upper command?
Or is this exclusively done by editing the osmconf.ini
file? If yes, then how?
Best Answer
The osmconf.ini file has a separate sections for defining the attributes for each layer (points, lines, multipolygons, multilinestrings, other_relations). This is the default setting for the "points" layer.
If you copy-paste and use the same settings for all layer sections in osmconf.ini you will get the same set of attributes for all the layers.