A CLI tool to convert geospatial data.
GeoConverter is a command-line tool for converting geospatial data. Designed for efficiency and ease of use, it seamlessly integrates into various workflows, making geospatial data conversion straightforward.
- ✅ CLI-based – Simple and efficient command-line interface.
- ✅ Convert Shapefiles to GeoJSON – Easily transform geospatial data.
The following features are planned for future releases:
- Convert GeoJSON to Shapefile
- Convert Raster to GeoJSON and Shapefile
- Convert Shapefile to Raster
- Convert GeoJSON to Raster
- Publish to PyPI for easy installation via
pip
To set up the project locally, follow these steps:
-
Clone this repository:
git clone https://github.com/sotberd/geoconverter.git
-
Install PDM if you don't have it already. You can do this via pip:
pip install pdm
-
Activate the project environment with PDM:
pdm use
You can specify the Python version if needed, or omit it to use the default one.
-
Install the project dependencies:
pdm install
This will set up the project with PDM’s environment management and install all the necessary dependencies as defined in pyproject.toml.
To run the CLI, use the following command:
geoconverter --helpThe CLI provides a simple way to convert Shapefiles to GeoJSON. To convert Shapefiles to GeoJSON, use the following command:
geoconverter shp2geojson --input-path data/shp --output-path data/geojson --crs EPSG:4326The --output-path will be created if it does not exist. The --crs parameter is optional; The default is the original CRS of the shapefile.
Testing is crucial for maintaining the reliability of the API. This project uses pytest for testing.
./scripts/test.sh
open htmlcov/index.htmlTo maintain code quality, this project uses pre-commit hooks. These hooks can automatically format and lint your code before commits.
-
Run pre-commit hooks:
pre-commit run --all-files
-
Formatting:
To automatically format your code, use the following script:
./scripts/format.sh
-
Linting:
To lint your code, use the following script:
./scripts/lint.sh
This project is licensed under the terms of the MIT.