Documentation
Published on ReadTheDocs: Documentation
Features
Command line utility for easy transformations between geodata/spatial filetypes.
Python functions with documentation for direct usage.
This is my own main use case: A package with all basic geopandas file loads and saves bundled.
Uses Python pathlib for cross-platform path handling.
Support
Currently supports:
File Geodatabases Read only
All file formats supported by geopandas can be implemented.
Dependencies
Alternatives
The GDAL tool ogr2ogr is a much more sophisticated command-line tool for converting between spatial file formats.
Geopandas by itself supports many more spatial file formats. For more advanced use cases when interacting with Python I recommend just using geopandas.
Fiona provides a command-line interface fio. fio.
Installation
PyPi
pip install geotrans
poetry for development
git clone https://github.com/nialov/geotransform.git
cd geotransform
poetry install
Using geotransform
Command line
Run
geotrans --help
to print the command line help for the utility.
To transform from a geopackage file with a single layer to an ESRI shapefile:
geotrans input_file.gpkg --to_type shp --output output_file.shp
To transform from a geopackage file with multiple layers to multiple ESRI shapefiles into a given directory:
geotrans input_file.gpkg --to_type shp --output output_dir
Python
All main functions in charge of loading and saving geodata files are exposed in the transform.py file in the geotrans package.
from geotrans.transform import load_file, save_files, SHAPEFILE_DRIVER
from pathlib import Path
# Your geodata file
filepath = Path("input_file.gpkg")
# load_file returns a single or multiple geodataframes depending
# on how many layers are in the file.
geodataframes, layer_names = load_file(filepath)
# Assuming geopackage contained only one layer ->
# Save acquired geodataframe and layer
save_files(geodataframes, layer_names, [Path("output_file.shp")], SHAPEFILE_DRIVER)
License
This project is licensed under the terms of the MIT license.
Copyright © 2020, Nikolas Ovaskainen.
Metadata
Release files for geotrans 0.0.5
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 |
|---|---|---|---|---|
| geotrans-0.0.5.tar.gz | 8.8 kB | Without provenance | Details for geotrans-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geotrans-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for geotrans-0.0.5-py3-none-any.whl |
Total release size: 17.2 kB
Release files / geotrans-0.0.5.tar.gz
| Download URL | geotrans-0.0.5.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3b562bf02586e538797fd93d03b71c19632b10661e70225be86f13927bd3ebe
|
|
BLAKE2b-256 checksum How to use checksums |
864a377940c610158db9e635e7d156943b71b1b9e136e837fd2645725833a1df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / geotrans-0.0.5-py3-none-any.whl
| Download URL | geotrans-0.0.5-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22c285b7b8c8add95f82f5adb01c5c7ae0fdc317386820e1893d48724fe01317
|
|
BLAKE2b-256 checksum How to use checksums |
6c2a0c58755581b99bd4793e74b82f85e0222da78cedd9ef0a6c350fa5bf870a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Security for geotrans 0.0.5
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.