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

Hi - being new to overpass Turbo, I have found several examples of the use of the length() function.

But it seems not to be working any longer - running this small example gives an error

[out:json][timeout:25];
(
  way["highway"]  ({{bbox}});                                                                                                                                        
);
make stat number=count(ways),length=sum(length());
out body;
>;
out skel qt;

So how do I get a total road length?

asked 08 Jan '22, 10:55

jenspeterhansen's gravatar image

jenspeterhansen
41112
accept rate: 0%

edited 10 Jan '22, 20:51

TZorn's gravatar image

TZorn
12.3k764225


Hi.

you should use the "code" formatting, or the Share function of overpass-turbo, as this website scramble the query otherwise.

Anyway, if I try it, it seems to work alright : http://overpass-turbo.eu/s/1eVq

It is not an error if you get no displayable data, overpass-turbo is meant to display geographic data, on top of the map. But here you get only numbers, which seems right, just check in the data panel.

Regards.

permanent link

answered 08 Jan '22, 12:32

H_mlet's gravatar image

H_mlet
5.4k1781
accept rate: 13%

Hi H_mlet - thanks for responding.

After comparing your example (working) letter by letter with my own example (error message), I found out, that changing from using the server //overpass.openstreetmap.fr/api/ to //overpass-api.de/api/ solved my problem. :-)

permanent link

answered 08 Jan '22, 19:56

jenspeterhansen's gravatar image

jenspeterhansen
41112
accept rate: 0%

Tricky one. I guess OSMFR doesn't have the time to update their overpass instance... Glad you found the problem. Regards.

(09 Jan '22, 13:08) H_mlet

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:

×228
×16

question asked: 08 Jan '22, 10:55

question was seen: 1,483 times

last updated: 10 Jan '22, 20:51

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