NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am a volunteer of the cultural public non-commercial project "Тарас шевченко єднає народи" ("Taras Shevchenko unites the people"). I was asked to calculate the total length of objects with the name "Shevchenko" in Ukraine. I need to write a program that:

  1. Make a complete list of settlements in Ukraine and put them in a table.
  2. In each locality will compile a list of linear objects with the name "Shevchenko" (streets, lanes, boulevards, avenues, highways, alleys) and put them in a table.
  3. For each such object will find the nodes of the object and put them in a table.
  4. For each such object, calculate the length of the object and add to the table.
  5. Sum all the resulting lengths.

I would be grateful for an explanation of how to find the necessary data in the OSM file, as well as for explaining the structure of the OSM file. I would be grateful for any help in writing up such a program. I will also be grateful for the help in finding similar programs.

asked 28 Jan '19, 16:45

Anatolii%20Kharchenko's gravatar image

Anatolii Kha...
11112
accept rate: 0%

  1. is "javascript" (your tag) a requirement or just nice or unrelated?
  2. Is a "OSM file" as input (in your text) a requirement or just nice or not needed?
  3. Do you need do follow the 5 steps as outlined by you or would other approaches to the end result of the total length also satisfy your requirements?
(28 Jan '19, 20:11) aseerel4c26 ♦

I suspect the easiest way to do what you want is to actually setup a postgres/postgis database and import an extract of OSM data covering Ukrania with osm2pgsql.

Alternatively you could try to just extract the relevant data with overpass api/overpass turbo and sum it in a tool for example QGIS (maybe that is possible in overpass itself) see https://help.openstreetmap.org/questions/42859/find-total-length-of-ways-within-a-region-in-overpass-turbo

permanent link

answered 29 Jan '19, 09:45

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×126
×60

question asked: 28 Jan '19, 16:45

question was seen: 2,066 times

last updated: 29 Jan '19, 09:45

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum