KMLBuilder
KMLBuilder is a module designed to ingest user-provided GPS coordinates and/or geo-located images, and to produce a final KML file with these. The end result is a folder with the final KML file (w/o coordinates) and an additional 'img' folder containing (resized or not) geo-located images to be accessed via a GIS software of preference. Cuyrrently, this works with GoogleEarth.
Below are the input requirements for both geo-located images and GPS coordinates:
- The Pandas DataFrame must have these headers: 'placemark', 'keep_elevation', 'time', 'lat', 'lon', 'elevation'
- 'placemark' is the name of the placemark(s) to be chosen by the user; e.g. if there are more than one trip, then the user could name each group of coordinates individually
- 'keep_elevation' is a binary (i.e. 1 or 0) telling the module whether to clamp coordinates to the ground or display the actual elevation recorded
- 'time' is not required; currently kept for future developments purposes
- 'lat', 'lon' GPS coordinates must be in decimal WGS84 GCS
- 'elevation' is the altitude measured in metres; please note that this needs to be provided if the user wants to display it as is in the GIS of choice
- Image format must be one handled by PIL (Pillow)
- Image geo-location must be present in their EXIF
- Image geo-location coordinates must be in WGS84 GCS
- Image EXIF requirements are: 'GPSInfo' for geo-location data extraction, 'DateTimeOriginal' for pictures ordering
Requirements
KMLBuilder uses a number of open source projects to work properly:
- [io]
- [datetime]
- [pathlib]
- [zipfile]
- [xml.dom.minidom]
- [PIL]
- [pandas]
- [numpy]
- [colour]
Installation
Install the dependencies and the module as you would normally:
pip install KMLBuilder
Usage as follows:
from GeoFun.KMLBuilder import CreateKmlFile
import pandas as pd
# 1) Load the coordinates data file into a Pandas DataFrame,
gps_coords_raw = "coordinates/Apulia.csv"
gps_coords_df = pd.read_csv(gps_coords_raw)
# 2) the folder location of images to be loaded into the KML, and:
img_folder = "images/"
# 3) and the file location of where the KML should be saved
kml_output = "kml/Apulia/"
# 4) and ingest everything into the CreateKmlFile() function:
CreateKmlFile(kml_output,
coords_df=gps_coords_df,
img_input_folder=img_folder,
resize_opt=100, # This is the resize filesize (in KB); can also be expressed as a 0-1 for percentage
zip_files=True, # whether to zip the KML folder
verbose=False) # whether to make the process verbose or not
Todos
- Expand module output types
- Improve quality
- Avoid module-sucking
- Any idea, fire away! :)
License
GNU GPLv3
Metadata
Release files for GeoFun 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| GeoFun-0.1.tar.gz | 9.4 kB | Without provenance | Details for GeoFun-0.1.tar.gz |
Release files / GeoFun-0.1.tar.gz
| Download URL | GeoFun-0.1.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c36af66e86cb7dedb7015adf908ca6979a5fc2ee21be1ed6e5a29b8858314c5b
|
|
BLAKE2b-256 checksum How to use checksums |
463cbcebf38724b2ca2d380e3edc7df94991a8559ea2bb22f3ac2ce8a95fd616
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for GeoFun 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.