Created
March 20, 2015 16:17
-
-
Save jwass/ea3ef0f96858e8f6b174 to your computer and use it in GitHub Desktop.
Quick thoughts on representing a road network in JSON. Basically TopoJSON for OSM nodes/ways.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "network", | |
"nodes": [ | |
{"coordinates": [-71.13568, 42.38196], "properties": {}}, | |
{"coordinates": [-71.13555, 42.382523], "properties": {"highway": "traffic_signals"}}, | |
{"coordinates": [-71.134087, 42.38384], "properties": {"railway": "level_crossing"}}, | |
{"coordinates": [-71.141007, 42.386862], "properties": {"highway": "crossing"}} | |
], | |
"geometries": [ | |
{"type": "LineString", "nodes": [0, 1, 2], "properties": {"highway": "primary", "name": "Main Street"}}, | |
{"type": "LineString", "nodes": [2, 3], "properties": {"highway": "motorway_link"}} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not much different from just GeoJSON with points and lines, but finding intersections would be an explicit integer (or maybe some ID) comparison rather than doing the floating point match on the coordinates. And modifications to any coordinates update all references.