Osm2gexf
converts OSM xml files to a network graph in GEXF format
Install / Use
/learn @stevefaeembra/Osm2gexfREADME
osm2gexf
converts OSM xml files to a network graph in GEXF format
Intro
This is a Python library which allows you to convert an OpenSteetMap (OSM) xml file into a GEXF file for import into Gephi, or other GEXF aware libraries.
The aim is to allow Street Network Analysis of OSM data using Gephi or other tools. This can then allow you to compute centralities, betweenness, eccentricity, etc.
An example can be found in demo.py
For larger OSM files I suggest you enable the 'network simplify', as shown in demo.py. This converts series of edges so that each series of edges between junctions is simplified to a single segment. This helps keep the network size down, at the cost of map aesthetics. For example, roundabouts with lots of line segments will be simplified into diamond shapes.
Dependencies
None on the python side, all libraries are built in
Optional but recommended : a tool or library to process gexf files Gephi - https://gephi.org/
Tips if using Gephi
If using Gephi, you'll want to install the GeoLayout optional plugin. This lets you see the network as a geographic map.
When importing the GEXF,
- change type to 'Undirected'
- uncheck 'add missing nodes'
When running this plugin, I suggest you use the following settings:-
- Latitude - lat
- Longitude - lon
- Scale - somewhere between 500000 and 15000000 (town/city size maps)
Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.4kCommit, push, and open a PR
