Skip to content

sotberd/geoconverter

Repository files navigation

geoconverter-logo

Python 3.11 CI

GeoConverter

A CLI tool to convert geospatial data.


Table of Contents

Overview

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.

Features

  • CLI-based – Simple and efficient command-line interface.
  • Convert Shapefiles to GeoJSON – Easily transform geospatial data.

Planned Features

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

Getting Started

Local Development

To set up the project locally, follow these steps:

  1. Clone this repository:

    git clone https://github.com/sotberd/geoconverter.git
  2. Install PDM if you don't have it already. You can do this via pip:

    pip install pdm
  3. Activate the project environment with PDM:

    pdm use

    You can specify the Python version if needed, or omit it to use the default one.

  4. 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.

Running the CLI

To run the CLI, use the following command:

geoconverter --help

The 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:4326

The --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

Testing is crucial for maintaining the reliability of the API. This project uses pytest for testing.

./scripts/test.sh

open htmlcov/index.html

Code Quality

To maintain code quality, this project uses pre-commit hooks. These hooks can automatically format and lint your code before commits.

  1. Run pre-commit hooks:

    pre-commit run --all-files
  2. Formatting:

    To automatically format your code, use the following script:

    ./scripts/format.sh
  3. Linting:

    To lint your code, use the following script:

    ./scripts/lint.sh

License

This project is licensed under the terms of the MIT.

About

A CLI tool to convert geospatial data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors