PostGIS script to calculate total road length per highway type + lanes info, maxpseed attributes, etc
Posted by baditaflorin on 30 August 2016 in English.Hello dear OSM community.
It was been a while since i posted in the diary.
I had made a new script that i had put in the OSM postGIS scripts repo https://github.com/baditaflorin/osm-postgis-scripts
You can find it in the statistics folder, under the name highway_length_per_type_different_attr.sql
How can you do the same for your country or region ?
First, download and run the scope.sh (linux) or the scope.bat (win) utility that you will use to load the file into postGIS.
After you load the file in postGIS, you just have to connect to the database either in PgAdmin or via Qgis Dbmanager and copy and paste the code.
It took 20 seconds to generate this result for the map of Romania (~150 MB pbf file)

Please help me with ideas of what other scripts would there be interesting for you. Thanks and see you at SOTM in 3 weeks
Discussion
Comment from Xapitoun on 31 August 2016 at 03:15
Nice. I don’t see the crs ? which crs did you take ? Xavier
Comment from baditaflorin on 2 September 2016 at 15:32
Hi, i am casting the geometry as geography for accurate results. So this is why i don`t specify the CRS
You can read a better explanation then mine here http://gis.stackexchange.com/a/6683/12422