Reserve and execute commands on EC2 Spot instance with ease
Project description
Calculate the length of a GeoJSON LineString or MultiLineString
Free software: MIT license
Installation
$ pip3 install geojson-length
Usage
>>> from geojson_length import calculate_distance, Unit
>>> from geojson import Feature, LineString
>>> line = Feature(geometry=LineString([[19.6929931640625,48.953170117120976],[19.5556640625,48.99283383694351]]))
>>> calculate_distance(line, Unit.meters)
10979.098283583924
Note: You need to install python-geojson first or you can define GeoJSON as python dict:
line = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[
19.6929931640625,
48.953170117120976
],
[
19.5556640625,
48.99283383694351
]
]
}
}
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
The idea was inspired by geojson-length package written in JS.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
geojson-length-0.2.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for geojson_length-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f86862ba8093b45b291634f7060ac71073f21ec7b8a565dbb435cc65725299b1 |
|
MD5 | 38bbb749ee7b82b06982b669703521b7 |
|
BLAKE2b-256 | db6cc4e0caaeffa5330c9fa46e8e10ba45787d3039167cded852c345b54703ab |