Skip to main content

osm2paths generates car tracks of any small OSM road network, intended to be used in simple traffic simulations. It converts an exported OSM file (eg. map.osm) to a JSON dictionary defining the road network (crossroads and connections), and car tracks (directed traces on commonplace two-way streets).

The tracks’ graph is perfecly smooth - there are no sharp turns and any turn is defined as an infinitely zoomable quadratic Bézier curve - it generates ‘vector’ paths.

=========== USAGE =============

1, place an .osm file inside data folder 2, call generate_rails() to create a .json files, arguments

osm_path (string, required): path to source OSM file (eg. “data/map.osm”) half_gauge (float, default = 2): distance between road’s central line and tracks in meters min_radius (float, default = 4.5): minimum radius of osculating circle of curves in meters drive_right (bool, default = True): regional road specification - True for Germany, False for the UK display (bool, default = True): if set to True, displays generated traces in system window

CODE EXAMPLE:

generate_roads(“data/kjoto.osm”, 1.5, drive_right=False)

Metadata

Release files for osm2paths 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for osm2paths 0.0.3
File Size Uploaded
osm2paths-0.0.3.tar.gz 1.1 MB Details

Release files / osm2paths-0.0.3.tar.gz

Download URL osm2paths-0.0.3.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c0b074c1ea65f5fde0662ab15a100bf436c65972907527fd79b04cb5aa66ba77
BLAKE2b-256 checksum
How to use checksums
8ab28655820e428bd8bbb190fad0faaf45e8f966dafdcbed2031c0c168a0b719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page