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

Is there a way to calculate the area of a polygon (i.e. a relation) based on the results I receive from a query?

I have a query that finds the "landuse" of the area around a certain radius. I planned to calculate the area of the of each type of landuse that was returned by the API. But I am unable to find any resource for something like this.

This is my query: relation(around:600,28.595262,77.240308)["landuse"];

overpass turbo screenshot

So how can I calculate those areas, if its possible?

asked 23 Nov '18, 07:44

imsubkrishd's gravatar image

imsubkrishd
16112
accept rate: 0%

edited 25 Nov '18, 14:56

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

2

Hi. I don't think this is something you can get directly as an output from Overpass. You can run your Overpass query through JOSM or QGIS where it is easy to measure the area once you get your data in.

(24 Nov '18, 08:52) Privatemajory

Is there a way to extract that data given by the plugin? I see values, but I don't see a way to export them.

(28 Nov '18, 08:26) imsubkrishd

Which plugin? overpass turbo has an export button.

(28 Nov '18, 08:38) scai ♦

As @Privatemajory suggested I ran the query through JOSM using the measurement plugin to get the area of the polygons. I want to extract those values for each polygon that I get as part of my query. Is there a way to do this?

(28 Nov '18, 08:43) imsubkrishd

If you want to just extract the areas, in JOSM:

  1. Make sure utilsplugin2 is enabled. If so, you should have in the main menu Data > Tag multiple objects
  2. Download the data with your Overpass query
  3. Select your polygons
  4. Press ctrl+T or go through the menu Data > Tag multiple objects
  5. On the table that shows up, you have the objects tags with an area column in the end. You can select all cells (click on one cell then ctrl+A) - or just those you need - copy them and paste them into a spreadsheet.

But for a cleaner method and if you want to go further with your data I'd suggest doing things in a GIS software like QGIS (for e.g download the data through QuickOSM and generate the areas as new column).

permanent link

answered 28 Nov '18, 11:42

Privatemajory's gravatar image

Privatemajory
1.1k142233
accept rate: 23%

I have tried both methods and as you suggested the QGIS method is much more cleaner and straightforward. But one thing I want to know is that can I automate this process but creating a Python script? I have multiple points that I want to check for.

(29 Nov '18, 06:52) imsubkrishd

QGIS has python and an overpass I/f so it may be possible to do this from within QGIS.

(30 Nov '18, 15:34) SK53 ♦

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:

×228
×213
×85
×9

question asked: 23 Nov '18, 07:44

question was seen: 6,151 times

last updated: 30 Nov '18, 15:34

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