1

Is there a way to generate valid graph files like simple-leuven.dot or graphs of other cities available on Rinsim?

We'd like to find a fast way to generate directed cyclic graphs with various geometries.

2 Answers2

0

The Leuven map was downloaded from OpenStreetMap as an XML file and then converted to dot using a script. The code that was used for this has been removed from the main RinSim branch as it is very fragile. You can still find the code in the repository though, see OSM.java in v2.3.3.

A few other city maps have been created using this code and they can be found on this website.

rinde
  • 1,181
  • 1
  • 8
  • 20
0

Apparently, the code in OSM.java has been refactored into a project in this github repo osm-to-dot-converter. All you have to do is to create a main method to convert an XML openstreetmap file (.osm). For instance:

    public static void main(String[] args) {
    OsmConverter myOsmConverter = new OsmConverter();
    myOsmConverter.setOutputDir("/home/username/");
    myOsmConverter.withOutputName("cityname.dot");
    // I am not sure what pruning is used for,
    // you can comment out the next line if you do not understand what it is used for
    myOsmConverter.withPruner(new RoundAboutPruner(1), new CenterPruner());
    // the XML file is to be feed here 
    myOsmConverter.convert("/home/username/cityname.osm");
}
Abdu
  • 487
  • 4
  • 12