-
-
Notifications
You must be signed in to change notification settings - Fork 40
Examples and Resources
- Home
- Examples and Resources (this page)
- Installation
- Usage
Project website: roadcurvature.com
Below are links to some example KML files generated with Curvature.
Prepossessed files for the entire world can be downloaded at kml.roadcurvature.com/.
Pre-processing the vermont-latest.osm.pbf file.
bin/curvature-collect -v --highway_types 'motorway,trunk,primary,secondary,tertiary,unclassified,residential,service,motorway_link,trunk_link,primary_link,secondary_link,service' vermont-latest.osm.pbf \
| bin/curvature-collect $verbose $input_file \
| bin/curvature-pp filter_out_ways_with_tag --tag surface --values 'unpaved,dirt,gravel,fine_gravel,sand,grass,ground,pebblestone,mud,clay,dirt/sand,soil' \
| bin/curvature-pp filter_out_ways_with_tag --tag service --values 'driveway,parking_aisle,drive-through,parking,bus,emergency_access' \
| bin/curvature-pp add_segments \
| bin/curvature-pp add_segment_length_and_radius \
| bin/curvature-pp add_segment_curvature \
| bin/curvature-pp filter_segment_deflections \
| bin/curvature-pp split_collections_on_straight_segments --length 2414 \
| bin/curvature-pp roll_up_length \
| bin/curvature-pp roll_up_curvature \
| bin/curvature-pp filter_collections_by_curvature --min 300 \
| bin/curvature-pp sort_collections_by_sum --key curvature --direction DESC \
> vermont.msgpack
A basic KML file generated with a minimum curvature of 300 using the pre-processed vermont-latest.osm.pbf file (above).
This file includes all ways in the input file that have a curvature value greater than 300 and are not marked as unpaved. As mentioned above, a curvature of 300 this means that these ways have at least 150 meters of tight curves with a radius of less than 30 meters, 300 meters of gentle curves with a radius less than 175 meters, or a combination thereof.
In practice, a curvature of 300 is useful for finding roads that might be a bit fun in a sea of otherwise bland options. While more curvy roads will also be included, roads in the 300-600 range tend to be pleasant rather than exciting.
cat vermont.msgpack \
| bin/curvature-pp filter_collections_by_curvature --min 300 \
| bin/curvature-output-kml --min_curvature 300 --max_curvature 20000 \
> vermont.c_300.kml
An additional note: Vermont has approximately 8,000 miles of dirt roads and only 6,000 miles of paved roads. At the time of this writing most of the dirt roads were not tagged as such in Open Street Map, leading to the inclusion of many dirt roads in the KML file above. I have tagged many of the roads in my region with appropriate 'surface' tags, but there is more to be done. Head to openstreetmap.org and help tag roads with appropriate surfaces so that we can better filter our results.
A basic KML file generated with a minimum curvature of 1000 using the pre-processed vermont-latest.osm.pbf file (above).
This file includes all ways in the input file that have a curvature value greater than 1000 and are not marked as unpaved. As mentioned above, a curvature of 1000 this means that these ways have at least 500 meters of tight curves with a radius of less than 30 meters, 1000 meters of gentle curves with a radius less than 175 meters, or a combination thereof.
In practice a minimum curvature of 1000 is useful for finding the best roads in a region. There will be many roads that are quite fun but don't quite make the cut, but all of the roads listed will be very curvy.
cat vermont.msgpack \
| bin/curvature-pp filter_collections_by_curvature --min 1000 \
| bin/curvature-output-kml --min_curvature 1000 --max_curvature 20000 \
> vermont.c_1000.kml
Multi-colored KML files generated with a minimum curvature of 1000 using the pre-processed vermont-latest.osm.pbf file (above).
This file colors the ways listed in the second example based on curve radius. Zoom on corners to see the shading. Green segments do not contribute to the 'curvature' value while yellow, orange, and red segments do.
cat vermont.msgpack \
| bin/curvature-pp filter_collections_by_curvature --min 1000 \
| bin/curvature-output-kml-curve-radius \
> vermont.c_1000.curves.kml
All of the commands above, combined into a single script processing_chains/adams_defaults.sh
:
mv vermont-latest.osm.pbf vermont.osm.pbf
processing_chains/adams_defaults.sh -v vermont.osm.pbf
While I encourage everyone to install Curvature and generate maps that fit their own particular needs, I provide prepossessed files for the entire world updated about every two weeks that can be downloaded at kml.roadcurvature.com.