Calculate the length of a GeoJSON LineString or MultiLineString
Project description
geojson-length
Calculate the length of a GeoJSON LineString or MultiLineString
Free software: MIT license
Documentation: https://geojson-length.readthedocs.io.
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.
History
0.1.0 (2020-06-04)
First release on PyPI.
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.1.2.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for geojson_length-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c93350fdccf4d7a085a69cfb63366bdc62bfa6af0f58af969e7eac94d14f2c41 |
|
MD5 | 31bfe05b4136c3e1b2fb0a77233d8447 |
|
BLAKE2b-256 | 4afd19dbdbc9499399cfe256d99ee2b14ab879232a27279fe984c3f7a7d61e03 |