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

I've got a list of relations of power plants and would like to query the "plant:output:electricity" tag.

Is there any generic tool (for Linux commandline) which queries the content of an arbitrary tag from Overpass?

So e.g. I would like to do:

./querytool -relation 368946 -tag "plant:output:electricity"

and get out "150 MW".

Thanks for any help!

asked 29 Apr '18, 11:34

landuse's gravatar image

landuse
1165511
accept rate: 0%

Why are you not answering?

(01 May '18, 11:43) landuse
1

I’m still trying to find an answer for you.

(01 May '18, 12:00) nevw
2

@landuse please be polite. All answers are provided by volunteers in their free time and you have no "right" to an answer in any form.

(01 May '18, 15:35) SimonPoole ♦

It's not a ready made tool, but you can pipe curl into something like jq:

curl -s -g http://overpass-api.de/api/interpreter --data-urlencode 'data=[out:json];rel(368946);out;' | jq '.elements[0].tags."plant:output:electricity"'

I guess that won't work well if you want a lot of flexibility, but for simple queries it should be fine.

permanent link

answered 01 May '18, 14:27

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

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

question asked: 29 Apr '18, 11:34

question was seen: 1,353 times

last updated: 02 May '18, 12:05

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