Laut Wiki-Seite https://wiki.openstreetmap.org/wiki/Osmconvert#Modify_Tags sollte osmconvert in der Lage sein, key und value zu ändern. Das habe ich mal ausprobiert mit einem kleinen Windows-Batch-Skript (ich verwende die neueste Version von osmconvert, eben herunter geladen):
SET OSMCONVERT="C:\Program Files (x86)\OpenStreetMap\OSMConvert\osmconvert64-0.8.8p.exe"
SET INPUTFILE=E:\Maps\Development\Chile.OsmAnd\SurChico.osm.pbf
SET TMPFILE=E:\Maps\Development\Chile.OsmAnd\tmp.osm.pbf
SET OUTPUTFILE=E:\Maps\Development\Chile.OsmAnd\Valdivia.osm.pbf
%OSMCONVERT% %INPUTFILE% --drop-author ^
--modify-tags="contour=elevation to =ank contour_ext=elevation_major to =rsw_max contour_ext=elevation_medium to =rsw_int contour_ext=elevation_minor to =rsw_min" ^
-o=%TMPFILE%
%OSMCONVERT% %TMPFILE% ^
--modify-node-tags="contour=ank to ank_type=ank contour_ext=rsw_max to rsw_type=rsw_max contour_ext=rsw_int to rsw_type=rsw_int contour_ext=rsw_min to rsw_type=rsw_min" ^
-o=%OUTPUTFILE%
Der erste Teil, d.h. die Änderung von value, funktioniert: aus contour=elevation wird tatsächlich contour=ank etc.
Aber der zweite Schritt, d.h. von contour=ank nach ank_type=ank scheitert.
Ich habe es zuvor probiert, beides in einem Schritt zu machen, d.h. ohne –modify-tags mit –modify-node-tags="contour=elevation to ank_type=ank etc aber das scheiterte ebenso.
Obwohl mir keine Änderungen auffallen, schrumpft die Dateigröße minimal von 2620 kB bei tmp.osm.pbf zu 2604 kB bei Valdivia.osm.pbf. Die --diff-Funktionalität von osmconvert scheitert leider, da es sich um 2 pbf-Dateien handelt.
Ist das ein Bug in osmconvert, oder mache ich da was flasch?