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

I'm trying to count how many pistes are there in a given country:

//[out:csv(::count, ::"count:nodes", ::"count:ways", ::"count:relations", ::"count:areas")];
area["ISO3166-1"="EE"];
(
  way(area)["piste:type"];
  node(area)["piste:type"];
  area(area)["piste:type"];
  relation(area)["piste:type"];
);
out;// count;

(link) When I run this commented one, I get an error:

runtime error: Filters too weak in query statement: specify in addition a bbox, a tag filter, or similar.

When I uncomment the rest, I get just the count of ways or whatever is the first statement in parenthesis.

How to do this correctly?

asked 07 Jan '20, 11:03

V0174's gravatar image

V0174
16226
accept rate: 0%

edited 07 Jan '20, 11:04


The area needs to be stored ina variable & passed to each way type:

[out:csv(::count,::"count:nodes",::"count:ways",::"count:relations")];
area["ISO3166-1"="EE"]->.a;
(
  way(area.a)["piste:type"];
  node(area.a)["piste:type"];
  relation(area.a)["piste:type"];
);
out count;

However, it's much easier to amalgamate them to nwr:

[out:csv(::count,::"count:nodes",::"count:ways",::"count:relations")];
area["ISO3166-1"=EE]; // Estonia
nwr(area)["piste:type"];
out count;
permanent link

answered 08 Jan '20, 14:39

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 11 Jan '20, 21:35

Thanks again, this does exactly what I need.

(08 Jan '20, 15:27) V0174

Remove the area type.

permanent link

answered 07 Jan '20, 23:16

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Thanks, that was the reason for the error. However it still doesn't print all the counts separately, only the one that is stated as the first one in the union: https://overpass-turbo.eu/s/PzB Any idea?

(08 Jan '20, 13:43) V0174

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:

×483
×228
×65

question asked: 07 Jan '20, 11:03

question was seen: 1,697 times

last updated: 11 Jan '20, 21:35

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