0
1

Hi

I hacked at this OverPass Wiki example to find multi-polygon relations with just one member. The resulting routine seems to work but looks like it is running unnecessary steps. I've run out of knowledge. Is there anything I can do to tidy it up & make it run more efficiently?

rel({{bbox}})[type=multipolygon]->.relations;
foreach .relations -> .relation (
  (
   way(r.relation);
  )->.elem_all;

  rel.relation( if:elem_all.count(ways) == 1 );
  out geom;
);

OverpassTurbo Link

asked 19 Mar '18, 21:13

DaveF's gravatar image

DaveF
1.2k526179
accept rate: 0%


There's a count_members evaluator that looks inside of each individual relation:

[bbox:{{bbox}}];
rel[type=multipolygon](if:count_members() == 1);
out geom;

http://overpass-turbo.eu/s/x9L

permanent link

answered 20 Mar '18, 00:32

maxerickson's gravatar image

maxerickson
11.0k1075155
accept rate: 30%

Ah, thank you. my Google search 'overpass count' wasn't specific enough to find it.

(20 Mar '18, 14:45) DaveF
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:

×355
×190
×108
×6

question asked: 19 Mar '18, 21:13

question was seen: 684 times

last updated: 20 Mar '18, 14:46

powered by OSQA