Simple Python module for calculating bounding box (bbox) from given GeoJSON object
Project description
📐 geojson-bbox
Simple Python module for calculating bounding box (bbox) from given GeoJSON object.
Currently following GeoJSON objects are supported (RFC 7946):
Installation
$ pip install gbbox
Usage
>>> from gbbox import LineString
>>>
>>> linestring_geojson = {
>>> "type": "LineString",
>>> "coordinates": [
>>> [1.0, 2.0],
>>> [3.0, 4.0]
>>> ]
>>> }
>>>
>>> linestring = Point(**linestring_geojson)
>>> linestring_bbox = linestring.bbox()
>>> print(linestring_bbox)
>>> [1.0, 2.0, 3.0, 4.0]
>>> print(linestring.min_lon)
>>> 1.0
Development
$ docker compose up -d
# Start bash within container and enter it
$ docker exec -it gbbox bash
Project will be automatically installed within docker container in an editable mode and any code changes will be immediately reflected. Keep in mind that if you have python shell running then you have to restart it.
You can also use make lint
and make test
as shortcuts to run linters and tests
Changelog
v0.1.0 (2021-7-3):
- Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gbbox-0.1.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
gbbox-0.1.0-py3-none-any.whl
(5.2 kB
view hashes)