OSM Rail Filter Batch

Categories: OSM

OSM Filter: Rails Ways

OSM Rail Filter Batch

  • osmconvert
  • osmfilter
  • osmosis

test_osmFilter_01.bat

.\osmconvert.exe arnsberg-regbez-latest.osm.pbf >out.o5m

.\osmfilter.exe --keep="railway" --keep-nodes="railway" --keep-ways="railway" out.o5m >out.osm

test_osmFilter_03.bat

set DEBUG =1
if "%DEBUG%"=="1" (set TRACE=echo) else (set TRACE=rem)

set CMDLINE=%*
%TRACE% About to call PARSECMDLINE with the argument %CMDLINE%
%TRACE% [proc %0 %*]
%TRACE% Arg1: %1 Arg2: %2

rem goto :EOF 
.\osmconvert.exe %2 %1 > %1.o5m

.\osmfilter.exe %2 --keep="railway" --keep-nodes="railway" --keep-ways="railway" --keep-relations="railway" --keep="place=city or ( place=town and population>=10000 )" %1.o5m >%1.osm


:EOF
pause

test4-osmosis-extract-poly.bat


.\osmosis-latest\bin/osmosis --read-xml file="europe-latest.rail.drop.osm" --bounding-box top=50.63467 left=8.4639 bottom=49.46405 right=9.637931 --write-xml file="railmap-latest-extract-poly.osm"

rem  .\osmosis-latest\bin/osmosis --read-xml file="europe-latest.rail.drop.osm" --bounding-box top=49.5138 left=10.9351 bottom=49.3866 right=11.201 --write-xml file="railmap-latest-extract-poly.osm"
rem --bounding-box top=49.46405 left=8.4639 bottom=50.63467 right=9.637931

osm_filter_abandoned.bat

.\osmfilter.exe europe-latest.osm.pbf.o5m.osm -v --drop="railway=abandoned" -o=europe-latest.rail.drop.osm
Written on September 22, 2020