Open subrina0013 opened 3 years ago
To generate MATSIM file you can use SUMO tool called netconvert
- as they can load .osm/.sumo format and export MATSIM one.
To generate Population it is nice to use PopulationUtils
and just create 1 million Persons using regular for loop. There is a lot of those ...Utils
class - for example, PlansUtils, RouteUtils etc.
When you will have Population generated, use org.matsim.core.population.ioPopulationWriter
to write it to the file.
ConfigUtils
will allow you to create a config that can be run by the MatSim simulator.
Regarding the OSM to Network conversion. There are a few options:
MATSim core contains OsmNetworkReader
which allows you to convert an OSM (xml) file to a MATSim network. But as of MATSim 12, it is deprecated...
The replacement is the osm
-contrib: https://github.com/matsim-org/matsim-libs/tree/master/contribs/osm
It provides the SupersonicOsmNetworkReader
, which allows to convert *.osm.pbf files:
Network network = new SupersonicOsmNetworkReader.Builder()
.setCoordinateTransformation(coordinateTransformation)
.build()
.read("path/to/osm-data.osm.pbf");
It also provides some options to customize the network, see the builder methods. But you need to add the contrib as a Maven dependency to your pom.xml
.
there is also pt2matsim, which can convert OSM data and create multimodal networks, see the wiki for usage.
and last, there is the JOSM plugin that you already found and used.
but it does not have the attributes (origid, type)
those two attributes are deprecated and thus likely no longer generated by the JOSM plugin.
Dear RydAlex and mrieser, it has been a while since I created the network with pt2matsim. Now, for another project, I need to understand how MATSim assigns speed limit. So, I went back to the network and found strange speeds. For example, this one has freespeed 101 & 6.9. The speeds are in meter/s right? How come the same osm id has different speeds? And isn't 101 look wrong? I checked and this road is unclassified with no speed limit. So, pt2matsim assigns 'tertiary' as type but why it has 101 as speed?
double post, see https://github.com/matsim-org/pt2matsim/issues/196
Dear all I have my data that has around 1 million origin-destinations that I want to simulate. As I am new to Matsim, I am struggling to find ways to do this. Is there any example code snippet that I can use to convert OSM pbf/shapefile to Matsim network? I used Josm to convert an .osm file to matsim network file but it does not have the attributes (origid, type). I saw 'matsim/core/network/NetworkUtils' to create the attributes and relationship but how to use this class? Do I need to use .osm file or after JOSM output?
Also, how to create population and plan files for these 1 million agents with home and work locations? Any suggestion how I can create these files would be very helpful. Can anyone please share how to create a network, plan or population file?
Thank you so much.