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, 11:03

V0174's gravatar image

V0174
16226
accept rate: 0%

edited 07 Jan, 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, 14:39

DaveF's gravatar image

DaveF
1.6k596889
accept rate: 5%

edited 11 Jan, 21:35

Thanks again, this does exactly what I need.

(08 Jan, 15:27) V0174

Remove the area type.

permanent link

answered 07 Jan, 23:16

DaveF's gravatar image

DaveF
1.6k596889
accept rate: 5%

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, 13:43) V0174
Your answer
toggle preview

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:

×389
×145
×52

question asked: 07 Jan, 11:03

question was seen: 454 times

last updated: 11 Jan, 21:35

powered by OSQA