Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python

Related tags

Geolocation area
Overview

geojson-area

https://travis-ci.org/scisco/area.svg?branch=master

Calculate the area inside of any GeoJSON geometry. This is a port of Mapbox's geojson-area for Python.

Installation

$ pip install area

Usage

Simply pass a geojson string or python dictionary to the area function and get the area.

>>> from area import area
>>> obj = {'type':'Polygon','coordinates':[[[-180,-90],[-180,90],[180,90],[180,-90],[-180,-90]]]}
>>> area(obj)
511207893395811.06

Test

$ python test.py

Credit

You might also like...
This GUI app was created to show the detailed information about the weather in any city selected by user
This GUI app was created to show the detailed information about the weather in any city selected by user

WeatherApp Content Brief description Tools Features Hotkeys How it works Screenshots Ways to improve the project Installation Brief description This G

This is a simple python code to get IP address and its location using python

IP address & Location finder @DEV/ED : Pavan Ananth Sharma Dependencies: ip2geotools Note: use pip install ip2geotools to install this in your termin

GeoIP Legacy Python API

MaxMind GeoIP Legacy Python Extension API Requirements Python 2.5+ or 3.3+ GeoIP Legacy C Library 1.4.7 or greater Installation With pip: $ pip instal

Geocoding library for Python.

geopy geopy is a Python client for several popular geocoding web services. geopy makes it easy for Python developers to locate the coordinates of addr

Python Data. Leaflet.js Maps.

folium Python Data, Leaflet.js Maps folium builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js

Python tools for geographic data
Python tools for geographic data

GeoPandas Python tools for geographic data Introduction GeoPandas is a project to add support for geographic data to pandas objects. It currently impl

Python interface to PROJ (cartographic projections and coordinate transformations library)
Python interface to PROJ (cartographic projections and coordinate transformations library)

pyproj Python interface to PROJ (cartographic projections and coordinate transformations library). Documentation Stable: http://pyproj4.github.io/pypr

Documentation and samples for ArcGIS API for Python

ArcGIS API for Python ArcGIS API for Python is a Python library for working with maps and geospatial data, powered by web GIS. It provides simple and

PySAL: Python Spatial Analysis Library Meta-Package
PySAL: Python Spatial Analysis Library Meta-Package

Python Spatial Analysis Library PySAL, the Python spatial analysis library, is an open source cross-platform library for geospatial data science with

Comments
  • support __geo_interface__

    support __geo_interface__

    It would be sweet if a user could pass objects which implement the __geo_interface__ protocol into the area method. This would allow calculating area of, for example, shapely geometries and would be a very minor code change.

    I'm happy to write a PR if you think this would add value.

    opened by geospatial-jeff 0
  • Area is 0 if wrong winding order

    Area is 0 if wrong winding order

    If passing in geojson that has an outer ring with a clockwise winding order, it return an area of 0. The revised geojson spec says that the outside ring should have a counterclockwise winding order. I'd think that it should either raise an exception (because the geojson is invalid) or return a negative area. Right now it seems to be returning 0, which is a bit counter-intuitive.

    opened by JoelBennett 1
  • Coordinates should accept list or tuple

    Coordinates should accept list or tuple

    The asserts on lines 30 and 63, i.e. assert isinstance(coordinates, list) should also accept tuples, i.e. assert isinstance(coordinates, (list,tuple))

    Since tuples are a valid format on GeoJson and some libraries (e.g. shapely) map shapes to tuples instead of lists.

    opened by Taxuspt 1
Releases(v1.1.1)
Owner
Alireza
Engineer
Alireza
Calculate & view the trajectory and live position of any earth-orbiting satellite

satellite-visualization A cross-platform application to calculate & view the trajectory and live position of any earth-orbiting satellite in 3D. This

Space Technology and Astronomy Cell - Open Source Society 3 Jan 8, 2022
Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Jazzband 765 Jan 6, 2023
Python bindings and utilities for GeoJSON

geojson This Python library contains: Functions for encoding and decoding GeoJSON formatted data Classes for all GeoJSON Objects An implementation of

Jazzband 763 Dec 26, 2022
gjf: A tool for fixing invalid GeoJSON objects

gjf: A tool for fixing invalid GeoJSON objects The goal of this tool is to make it as easy as possible to fix invalid GeoJSON objects through Python o

Yazeed Almuqwishi 91 Dec 6, 2022
A bot that tweets info and location map for new bicycle parking added to OpenStreetMap within a GeoJSON boundary.

Bike parking tweepy bot app A twitter bot app that searches for bicycle parking added to OpenStreetMap. Relies on AWS Lambda/S3, Python3, Tweepy, Flas

Angelo Trivisonno 1 Dec 19, 2021
Wraps GEOS geometry functions in numpy ufuncs.

PyGEOS PyGEOS is a C/Python library with vectorized geometry functions. The geometry operations are done in the open-source geometry library GEOS. PyG

null 362 Dec 23, 2022
Constraint-based geometry sketcher for blender

Geometry Sketcher Constraint-based sketcher addon for Blender that allows to create precise 2d shapes by defining a set of geometric constraints like

null 1.7k Jan 2, 2023
WIP: extracting Geometry utilities from datacube-core

odc.geo This is still work in progress. This repository contains geometry related code extracted from Open Datacube. For details and motivation see OD

Open Data Cube 34 Jan 9, 2023
Advanced raster and geometry manipulations

buzzard In a nutshell, the buzzard library provides powerful abstractions to manipulate together images and geometries that come from different kind o

Earthcube Lab 30 Jun 20, 2022
Get-countries-info - A python code that fetches data of any country

Country-info A python code getting countries information including country's map

CODE 2 Feb 21, 2022