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

I'm trying to find peaks in an area where the elevation contains other characters than numbers and the decimal point. I started with the non-negated regexp to test and got quite far: [out:csv(name,ele)]; area[name="Plzeň"]; node(area)[natural=peak][ele]["ele"~"^[[:digit:]]+$"]; out; But I can't find out how to add the decimal point to the regexp. The obvious thing doesn't work: [out:csv(name,ele)]; area[name="Plzeň"]; node(area)[natural=peak][ele]["ele"~"^[[[:digit:]]\.]+$"]; out; How to do that? Does Overpass QL not support []s? Or am I just missing something? (The area specified does contain peaks with both decimal point and without.) Note: I could probably do this, although imperfect, but I'm still curious about how to do it properly.

Edit - examples of what I want to match: ele=123 ele=1.234

Examples of what I don't want to match: ele=123. ele=123m ele=123.45 m

asked 30 Dec '19, 18:35

V0174's gravatar image

V0174
16226
accept rate: 0%

edited 31 Dec '19, 08:22

2

Can you put a couple examples in your text, of what you do want to match and what you don't want to match? I don't think I fully understand what you want, but I think ["ele"~"[0-9.]+"] does the same thing as your queries.

(30 Dec '19, 23:05) maxerickson

Thanks, that helped me to find the problem - dot should not be escaped inside of square brackets in Overpass QL.

(31 Dec '19, 08:43) V0174

OK, thanks to maxerickson helping me to got to the right path, it seems it was a regex issue - dot inside of [] [doesn't need to be escaped]1. I would expect that it'd work with escaping too, but that's Overpass.


Working example

An improved example of what I wanted to do - list of peaks with potentially wrong elevation in France.

permanent link

answered 31 Dec '19, 08:40

V0174's gravatar image

V0174
16226
accept rate: 0%

edited 31 Dec '19, 08:41

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
×1

question asked: 30 Dec '19, 18:35

question was seen: 1,749 times

last updated: 31 Dec '19, 08:43

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