Functionality to access and curate GeoJSON in CLDF datasets
Project description
cldfgeojson
cldfgeojson
provides tools to work with geographic data structures encoded as GeoJSON
in the context of CLDF datasets.
Install
pip install cldfgeojson
Creating CLDF datasets with speaker area data in GeoJSON
The functionality in cldfgeojson.create
helps adding speaker area
information when creating CLDF datasets (e.g. with cldfbench
).
Working around Antimeridian problems
Tools like shapely
allow doing geometry with shapes derived from GeoJSON, e.g. computing
intersections or centroids. But shapely
considers coordinates to be in the cartesian plane rather
than on the surface of the earth. While this works generally well enough close to the equator, it
fails for geometries crossing the antimeridian. To prepare GeoJSON objects for investigation with
shapely
, we provide a function that "moves" objects on a - somewhat linguistically informed -
pacific-centered cartesian plane: longitudes less than 26°W are adapted by adding 360°, basically
moving the interval of valid longitudes from -180°..180° to -26°..334°. While this just moves the
antimeridian problems to 26°W, it's still useful because most spatial data about languages does not
cross 26°W - which cannot be said for 180°E because this longitude is crosssed by the speaker area
of the Austronesian family.
>>> from cldfgeojson.geojson import pacific_centered
>>> from shapely.geometry import shape
>>> p1 = shape({"type": "Point", "coordinates": [179, 0]})
>>> p2 = shape({"type": "Point", "coordinates": [-179, 0]})
>>> p1.distance(p2)
358.0
>>> p1 = shape(pacific_centered({"type": "Point", "coordinates": [179, 0]}))
>>> p2 = shape(pacific_centered({"type": "Point", "coordinates": [-179, 0]}))
>>> p1.distance(p2)
2.0
Manipulating geo-referenced images in GeoTIFF format
The cldfgeojson.geotiff
module provides functionality related to
images in GeoTIFF format.
Commandline interface
cldfgeojson
also provides cldfbench
sub-commands:
leaflet.draw
This package contains the leaflet.draw
plugin in the form of data://
URLs in
a mako template. leaflet.draw
is
distributed under a MIT license:
Copyright 2012-2017 Jon West, Jacob Toye, and Leaflet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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
Built Distribution
File details
Details for the file cldfgeojson-1.0.0.tar.gz
.
File metadata
- Download URL: cldfgeojson-1.0.0.tar.gz
- Upload date:
- Size: 82.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d2aabaafb5b25c01c39777a505740251e2b335a4049245c4441dee00b42cb85 |
|
MD5 | 343fa232e265293428e0721194dff396 |
|
BLAKE2b-256 | 539c59829cd9867fb4d3e51b40593ac180ac02eb4f85881107f1d9ecbfa31970 |
File details
Details for the file cldfgeojson-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: cldfgeojson-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 79.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9603af9f43df267bcbd65b59927e52d8f2cf2cf1050da273e3fad2e90bdb3fd1 |
|
MD5 | bf78162773a4a9d68740650fe71d8ee2 |
|
BLAKE2b-256 | 84eec01362c6ec8bc73ceffea59467762fba972aa05afcffef69f0b170d92b42 |