Notes: The following notes are learned from the user guide for osm2gmns found at osm2gmns — osm2gmns 0.2.0 documentation.
Input: map.osm
Output: link.csv, node.csv, poi.csv
Quick Start
Step1: Download map.osm file from OpenStreetMap (OpenStreetMap)
- Search the location of interest and click on the “Export” button on the top.
- Obtain the latitude and longitude coordinates (users can “manually select a different area”).
- Click on the “Export” button found in the middle of the navigator to download an OSM data file.
- For a very large area of interest, users need to click the link of “Overpass API” to obtain a map file.
Step2: Execute OSM2GMNS to get network files in GMNS format
Use OSM2GMNS to convert the map.osm file in OSM format into a network file in GMNS format.
import osm2gmns as og
net = og.getNetFromOSMFile('./Tempe/map.osm', network_type=('auto', 'bike', 'walk'), POIs=True, default_lanes=True, default_speed=True)
og.connectPOIWithNet(net)
og.consolidateComplexIntersections(net)
og.outputNetToCSV(net, 'Tempe')