There's a perl script in SVN http://svn.openstreetmap.org/applications/utils/filter/osm-length/osm-length-2.pl that does it. answered 23 Mar '11, 19:20 Frederik Ramm ♦ amritkarma |
you can do this by loading the planetfile (all osm-data) or an extract of it into a database. In OSM we use PostgreSQL with the PostGIS extension. Then you can make queries on the database to get the answers to your questions. To get the downloaded data into your database, there are different solutions available, e.g. osmosis (allowing for a full copy) or osm2pgsql (used to create extracts with only a part of the data according to tags you choose). If you want to analyze the data and obtain real lengths and areas you should not use the spherical mercator projection (900913) we generally use to render maps, because the results are not real world units in this projection. answered 23 Mar '11, 18:47 dieterdreist |
Okay. Lets try this again. I am not familiar with the systems you reference. I am downloading county and state date on crimes, and need to calculate the total length of the streets/ roads in the area for certian calculations. I am not a programmer, atleast not since 1975, and am not famikliar with more recent systems. Is ther a simle wat to get this information? answered 23 Mar '11, 20:11 ajackson 1
I linked you to several OSM-tools which are described on the pages. If you already have an extract covering exactly the area you want to analyze you can directly use the script Frederik linked above. Otherwise you will have to cut the desired area out of a bigger extract (if it is not very small and you can download it via JOSM). Cutting out of OSM data is usually done with Osmosis. You can download it from svn ( http://svn.openstreetmap.org/applications/utils/osmosis/trunk/ ). Examples and explanations (also for installing/compiling) are in the wiki: http://wiki.openstreetmap.org/wiki/Osmosis
(23 Mar '11, 20:16)
dieterdreist
2
There is no simpler way to get this information. If you happen to have some GIS software at hand that can compute road lengths then you might download a matching shape file for your area of interest from download.geofabrik.de but even that requires that you know your GIS program and invest some time. If you are lucky then you can find someone to do this work for you - but they will have to perform the exact steps we have outlined above and which you are unable or unwilling to perform. A polite request to the mailing list or forum, with details about the areas of interest, 'might' work.
(23 Mar '11, 21:38)
Frederik Ramm ♦
5
Yes, there's a simpler way -- pay a consultant to produce the data for you. You could try the companies listed at http://wiki.openstreetmap.org/wiki/Commercial_OSM_Software_and_Services for a start.
(23 Mar '11, 21:43)
Jonathan Ben...
|
There is a python package that does exactly that: https://github.com/JoaoCarabetta/osm-road-length It is super easy, Install it: And run:
answered 30 Apr, 22:27 JOAO LUIZ |