I'm interested in calculating some centrality measures on a road network of a city. The geometry of the road network, from Open Street Map, is stored in a postgreSQL / postGIS database and can also be exported as a shapefile or a geojson. What is the best way to import the geometry in graph-tool as a planar graph? Thank you, Duccio
Hi Duccio Aiazzi,
I don't have an answer to your specific question, but I just want to call your attention to the OSMnnx , which makes it incredibly simple to create a road network from OpenStreetMaps data with a single line of code. https://github.com/gboeing/osmnx
OSMnnx also allows one to save the graph as a GraphML file, which I believe can be easily read by graph-tool as a planar graph if I'm not mistaken.
best,
Rafael H M Pereira urbandemographics.blogspot.com
On Sat, Dec 2, 2017 at 7:28 AM, Duccio Aiazzi duccio.aiazzi@gmail.com wrote:
I'm interested in calculating some centrality measures on a road network of a city. The geometry of the road network, from Open Street Map, is stored in a postgreSQL / postGIS database and can also be exported as a shapefile or a geojson. What is the best way to import the geometry in graph-tool as a planar graph? Thank you, Duccio
graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
On 02.12.2017 20:22, Rafael Pereira wrote:
OSMnnx also allows one to save the graph as a GraphML file, which I believe can be easily read by graph-tool as a planar graph if I'm not mistaken.
It seems to me this is by far the easiest choice.
In addition to exporting to graphml, it is also simple to iterate over the edges of the OSMnnx graph and add them to a graph-tool graph.
(Note that road networks need not to be planar; they may contain bridges and tunnels.)
Best, Tiago