Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] How to easily clean bus stops referencing missing edges after trimming OSM Web Wizard network?

Hi All,
I generated a scenario with the OSM Web Wizard that includes public transport data (bus stops, ferry stops, ptlines). In the original network, everything builds correctly.
However, after trimming the network in NetEdit (to focus on a smaller area), when I run build.bat, I get errors like (sumo 1.23.1, windows 11): 

Error: The lane -198924785#6_0 to use within the busStop '-10891908704' is not known.
Error: Could not add access outside a stopping place.
Error: Could not end a stopping place that is not opened.
Quitting (on error).

It seems that some stops in osm_stops.add.xml are no longer valid because their edges were removed during trimming. The issue is that the build process stops as soon as it encounters one of these errors, and I cannot know in advance which other stops are invalid.

I tried running with --ignore-errors, but the process still quits.

The relevant part of my build.bat looks like this:
python "%SUMO_HOME%\tools\ptlines2flows.py" -n osm.net.xml.gz -b 0 -e 3600 -p 600 --random-begin --seed 42 --ptstops osm_stops.add.xml --ptlines osm_ptlines.xml -o osm_pt.rou.xml --ignore-errors --vtype-prefix pt_ --stopinfos-file stopinfos.xml --routes-file vehroutes.xml --trips-file trips.trips.xml --min-stops 0 --extend-to-fringe --verbose

python "%SUMO_HOME%\tools\randomTrips.py" -n osm.net.xml.gz --fringe-factor 5 --insertion-density 4 -o osm.bus.trips.xml -r osm.bus.rou.xml -b 0 -e 3600 --trip-attributes "departLane=\"best\"" --fringe-start-attributes "departSpeed=\"max\"" --validate --remove-loops --via-edge-types highway.motorway,highway.motorway_link,highway.trunk_link,highway.primary_link,highway.secondary_link,highway.tertiary_link --vehicle-class bus --vclass bus --prefix bus --min-distance 600 --min-distance.fringe 10

python "%SUMO_HOME%\tools\randomTrips.py" -n osm.net.xml.gz --fringe-factor 5 --insertion-density 12 -o osm.passenger.trips.xml -r osm.passenger.rou.xml -b 0 -e 3600 --trip-attributes "departLane=\"best\"" --fringe-start-attributes "departSpeed=\"max\"" --validate --remove-loops --via-edge-types highway.motorway,highway.motorway_link,highway.trunk_link,highway.primary_link,highway.secondary_link,highway.tertiary_link --vehicle-class passenger --vclass passenger --prefix veh --min-distance 300 --min-distance.fringe 10 --allow-fringe.min-length 1000 --lanes

python "%SUMO_HOME%\tools\randomTrips.py" -n osm.net.xml.gz --fringe-factor 1 --insertion-density 10 -o osm.pedestrian.trips.xml -r osm.pedestrian.rou.xml -b 0 -e 3600 --vehicle-class pedestrian --prefix ped --persontrips --trip-attributes "modes=\"public\"" --additional-files osm_stops.add.xml,osm_pt.rou.xml --persontrip.walk-opposite-factor 0.8 --duarouter-weights.tls-penalty 20


Is there an easy way to automatically clean or filter out those invalid bus stops (and their lines) instead of manually editing the XML?

To be honest, I also tried importing GTFS data myself (instead of using OSM Web Wizard), but ran into other difficulties there as well. So I wonder if there is a practical solution or recommended workflow for this case.

Thanks in advance!
Aslan

Back to the top