convert map data from OpenStreetMap to network files in GMNS format
Project description
osm2gmns
osm2gmns is an open-source Python package that enables users to conveniently obtain and manipulate any networks from OpenStreetMap (OSM). With a single line of Python code, users can obtain and model drivable, bikeable, walkable, railway, and aeroway networks for any region in the world and output networks to CSV files in GMNS format for seamless data sharing and research collaboration. osm2gmns mainly focuses on providing researchers and practitioners with flexible, standard and ready-to-use multi-modal transportation networks, as well as a bunch of customized and practical functions to facilitate various research and applications on traffic modeling.
Publication
Lu, J., & Zhou, X.S. (2023). Virtual track networks: A hierarchical modeling framework and open-source tools for simplified and efficient connected and automated mobility (CAM) system design based on general modeling network specification (GMNS). Transportation Research Part C: Emerging Technologies, 153, 104223. paper link
Main Features
Obtain any networks from OSM. osm2gmns parses map data from OSM and output networks to csv files in GMNS format.
Standard network format. osm2gmns adopts GMNS as the network format for seamless data sharing and research collaboration.
Ready-to-use network. osm2gmns cleans erroneous information from osm map data and is able to fill up critical missing values, i.e., lanes, speed and capacity, to quickly provide ready-to-use networks.
Directed network. two directed road links are generated for each bi-directional osm ways identified by osm2gmns
Multi-module support. five different network types are supported, including auto, bike, walk, railway, and aeroway
Customized and practical functions to facilitate traffic modeling. functions include complex intersection consolidation, moevement generation, traffic zone creation, short link combination, network visualization.
Multi-Resolution modeling. osm2gmns automatically construct the corresponding mesoscopic and microscopic networks for any macroscopic network in GMNS format.
Installation
pip install osm2gmns
If you meet installation issues, please refer to the user’s guide for solutions.
Simple examples
You can find the osm map file used in the examples below at ‘sample networks/Arizona State University, Tempe Campus’
Quickly get the network with point of interest (POI) information from an osm file
>>> import osm2gmns as og
>>> net = og.getNetFromFile('asu.osm', POI=True)
>>> og.outputNetToCSV(net)
Generate multi-resolution networks from an osm file
>>> import osm2gmns as og
>>> net = og.getNetFromFile('asu.osm')
>>> og.consolidateComplexIntersections(net, auto_identify=True)
>>> og.buildMultiResolutionNets(net)
>>> og.outputNetToCSV(net)
Get relation id of a place of interest and download the corresponding osm file
You can use the following code to get the relation id of a place of interest and download the corresponding osm file.
>>> import osm2gmns as og
# get relation id of a place of interest
# For the place of interest, e.g. Arizona State University
# e.g. "Tempe, Arizona, United States"
# e.g. "Arizona, US"
# e.g. "Beijing Jiaotong University, Beijing, China"
>>> rel_id = og.getOSMRelationID('Arizona State University')
>>> rel_id
Info: Found relation id 3444656 from web
Info: location of the place of interest:
{
"place_id": 318528634,
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_type": "relation",
"osm_id": 3444656,
"lat": "33.4213174",
"lon": "-111.93316305413154",
"class": "amenity",
"type": "university",
"place_rank": 30,
"importance": 0.5547365758311374,
"addresstype": "amenity",
"name": "Arizona State University",
"display_name": "Arizona State University, 1151, South Forest Avenue, Tempe Junction, Tempe, Maricopa County, Arizona, 85281, United States",
"boundingbox": [
"33.4102062",
"33.4329786",
"-111.9411651",
"-111.9092447"
]
}
3444656
# download the corresponding osm file
>>> og.downloadOSMData(rel_id, 'asu.osm')
User’s guide
You can check the user’s guide for a detailed introduction of osm2gmns.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for osm2gmns-1.0.0b1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd511a8e29d53516153c14df29f88001ed2d1ab4cc33ccb2d4f1f69a72245ae |
|
MD5 | fbb8b84781ef503e0c16eef51305ae6b |
|
BLAKE2b-256 | 7ddc41f60a6a4d08ef746fa3520ea180c81f3dc3cf844682f6c227c1ccec5821 |
Hashes for osm2gmns-1.0.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87e3b48d9f4ae1d0aa8f989f5735b53076102382f1c2028627e5086d451e6394 |
|
MD5 | a1fe33b842184d0d9f729aa48add2adb |
|
BLAKE2b-256 | 05258ca1c2904b00dcd949c543a7d68ec9602e71ac4cc658bdf79731da9331b5 |
Hashes for osm2gmns-1.0.0b1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a8295671dd9acd8549c7864e121838dbcf493a910e3ea2616bde9d29f174dfc |
|
MD5 | 3a0082c797e492f73e9fe03e1c273d7f |
|
BLAKE2b-256 | 2e4606bffb92c642b15ab7c04956e34128f58107e7201155255270593110cb53 |
Hashes for osm2gmns-1.0.0b1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 904c5c92f45ef780e685786917da8f81432d35be1cf59276f4b0e10b417633fc |
|
MD5 | 31170d731ca09a8a8ea910ca6574faac |
|
BLAKE2b-256 | 746efa17986054db42547b8ef91f7e0de58706187ed264e4092d794a511cef45 |
Hashes for osm2gmns-1.0.0b1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8973092d1454856ab5cac3b3443126265846c0717fb1916d9cd65c996b198d2 |
|
MD5 | 6abc1b8c80d71ccfb3a542de69b15585 |
|
BLAKE2b-256 | 7d8266fa7c2ea0f607e21bfe6ac0042b7731479d2d656691d7ab5cfa81ac8998 |
Hashes for osm2gmns-1.0.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c24fd68e6955ff49bcca716e85701b7e4a96dd668cfb6b63427e8fda073acbec |
|
MD5 | e7efccea9176d2e6f19fbbdfc6f7cf93 |
|
BLAKE2b-256 | c8f2011aac9d54a9d0d6e5c2d9d49cff00fdcfc75bf2466d3f42dc16c2ed21df |
Hashes for osm2gmns-1.0.0b1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2681327c46192fa4c4f13699cdca46b2aae5627d419bbdc9349648cdf79b5dd7 |
|
MD5 | 1df95782be0d43184d3d105b3f9b1f5e |
|
BLAKE2b-256 | 045490daeeab5285b825366486b6aafaae58ca6a774de4fba757b848885573a1 |
Hashes for osm2gmns-1.0.0b1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 921cbe5fe4a15e6a897b49d489bee401607b5adced46530a6ae6f8448f92c8a9 |
|
MD5 | 8e4c0b88adf69756959361226985036c |
|
BLAKE2b-256 | 568b0c963191aaccc4c5f611af3f2f879552c70d0f5b90cf69735532832c25ac |
Hashes for osm2gmns-1.0.0b1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 009b837d0fb23c7d6d3749728a0cd272caf00d9b11ca12fec434c6030a72aee1 |
|
MD5 | 60f928367fbec422af5893edefde466a |
|
BLAKE2b-256 | 2dba5c553959a39ad6f8454c1b01d12302fabca132300e91a0518a92460b4894 |
Hashes for osm2gmns-1.0.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bcf3bf960e62f9f1c46a8c6a382e12e4ab262dcf9a40193b8c267fa9561b05d |
|
MD5 | 7801bb9e1742409d024d217233a970e6 |
|
BLAKE2b-256 | a6066fa570a8c413c60be223d2bcef015fe1eaa4c1a6d5c9ff412b282f925e05 |
Hashes for osm2gmns-1.0.0b1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9419376c0b9557c49c87d2f01cfddb3a3858ed9650a4101bb688bf56c502636a |
|
MD5 | 83f0f7245c75984d04589baa7f4678cf |
|
BLAKE2b-256 | 6587999180f3b48fdb422fc2b825d3331ed249599bdabc3cf2e161544a9e88fd |
Hashes for osm2gmns-1.0.0b1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4f3297f0bd2808ea567ddddfcdea97494a625a9741f56c523e15e6312674a70 |
|
MD5 | 0ebe635ef706626b536ca50f1510d6e0 |
|
BLAKE2b-256 | 325b8110438a8670402b95b827c8faf37250c4a856bc8b9ed64c9696208d4dd4 |
Hashes for osm2gmns-1.0.0b1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1777e8da6663d6ebc798680c243aa437a14d67a08843f3d39ee2be3b7f672078 |
|
MD5 | f1537591bb440bd86acaac54dbd9bc91 |
|
BLAKE2b-256 | bcda1a5f3df3abdc646d3e34f8c00338d41125d3b11379585b248164ef8a31d7 |
Hashes for osm2gmns-1.0.0b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e96f5187b98493a64daa20bb126d9c18732d58ddaf28911433b7d74fd3d37f |
|
MD5 | eecb93b437f72d693735f03c335e0183 |
|
BLAKE2b-256 | b113f969b366fdfd619c7c7426eb76cb8dfe03e2cf294e396f25f66f32784037 |
Hashes for osm2gmns-1.0.0b1-cp39-cp39-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32aef57fc71e2913eb591f50df846a6d100b586f9eda4527f1d09a761873d787 |
|
MD5 | 0828b3d65bbb0c0e295319989c6296c9 |
|
BLAKE2b-256 | c41cef8da6cf8864405d998d3ff1f1f1440174dc866bb3b758b4c80c6bf7d98c |
Hashes for osm2gmns-1.0.0b1-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1dc5b9e82e5043aa5c60d0ab59025cec38b2d745ecdee306fa85168ae3b5a55 |
|
MD5 | 54b1573d95be491d9483117951cd1935 |
|
BLAKE2b-256 | ee97aee2988704622aca9ed4594a31ec7d7fe811b183969309569bdb403e57dc |
Hashes for osm2gmns-1.0.0b1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 304e5c6b07e86b98ddceaa7b9702443c1e73da70decdf16cd1957974659ac057 |
|
MD5 | 969407a2df1c18979974cb8112cb23b5 |
|
BLAKE2b-256 | 362fff84ad90acf6eaf7eeae0d211cbd245022fac8280eb59421bb1065a90b39 |
Hashes for osm2gmns-1.0.0b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6455aa22a540da17123ff160b5a9ea5cc16a436e4301fb85c310d164e27f7696 |
|
MD5 | 6f2e7e866930c9f5a82ac2341343e5bc |
|
BLAKE2b-256 | 1aa3a23894771aa1c247ee57e9f3d1b3d7058cb4187eca13e9d12c7c62458373 |
Hashes for osm2gmns-1.0.0b1-cp38-cp38-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b2f25e04443155e7afc406f5b5d15a057c2346bf565d97c1ebe7e418e68c3da |
|
MD5 | c376760f8ea5bc12b817c63165b1793d |
|
BLAKE2b-256 | ddae7e02d7256e842ee1c20401b5ca45ebe9510c066f93b7da2be98eb1cff193 |
Hashes for osm2gmns-1.0.0b1-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c91c61a7aa755ae9c058fc14224f6f0087341b403c1eb94ad88ec80286e5c0 |
|
MD5 | 6f76c586ebd9b7bcaae6b2e324b14c2a |
|
BLAKE2b-256 | 510799eedd503bcfd40956f54bfe635e70b4499f6e2c52f1d7a5baadf62eecf3 |