Yitzhak Melamed
Yitzhak Melamed

Reputation: 15

Get size of GeoJson polygon (OpenStreetMap way)

I've tagged many industrial sites in OpenStreetMap and now would like to get the sizes of these areas. I'm exporting my Osm ways with Overpass Turbo to GeoJSON, so basically my question is:

How to calculate the size (square meters) of a GeoJSON polygon in commandline?

Thanks for your help.

Upvotes: 0

Views: 891

Answers (1)

Luis Paganini
Luis Paganini

Reputation: 181

For exporting from OSM you may use this python script:

import geojson
import overpass

endpoint = "https://overpass-api.de/api/interpreter"
api = overpass.API(timeout=100, endpoint=endpoint)

query = 'way('+str(areaId)+')'

result = api.get(query, responseformat="geojson")

print(result)

But for the area you may resort to https://gis.stackexchange.com/questions/127607/area-in-km-from-polygon-of-coordinates

Upvotes: 1

Related Questions