Spiky removes spikes from GeoPackage shapes
Latest docs are available at: Readthedocs
- A single outlier vertex between two vertices that forms an acute angle to them
- A shape can have more than one spike
- Spikes could be inward or outward
- Spikes can be on exterior and on one or more interior polygon boundaries
- Geographical location and scale should not affect spike detection
- Topology and geometry should be preserved - no simplifying
- Accepts a positional argument for filename
- Optionally accepts a max spike angle parameter (-a: float)
- Removes spikes for all shapes in the GeoPackage
- Writes out new file (*_ds.gpkg) to same folder as input
- Spiky functions can also be be imported if analysis on GeoPackage components is required
- Does not consider geometries with dimensions higher than 2d (z, m)
- Input must be in geographic coordinates referenced to WGS84
The simplest way of using the tool is to run the Docker image
The latest Docker image is available at: Dockerhub
- Pull image with:
docker pull andretheronsa/spiky:latest
- Run program and mount directory with file as a volume to /home/work/:
docker run -v /home/user/input/:/home/work/ andretheronsa/spiky:latest spiky-polygons.gpkg
- Outputs will be written to the same folder with '_ds' appended
Alternatively the tool can be downloaded and run with Python (3.5+).
Required modules should be installed with pip.
It is highly recommended to use Python Virtual environments (or similar tool) to avoid conflicts.
Pip install on Windows will fail due to missing Geopandas dependencies - instructions.
Wheels for GDAL, Fiona, Shapely, Pyproj, Rtree can be found here
- Pull code from git:
git clone https://github.com/andretheronsa/spiky.git
- Enter folder and activate virtual environment (venv used in this case):
cd spiky/
python -m venv venv
./venv/Scripts/active
- Install dependencies:
python3 -m pip install -r requirements.txt
- Run program with arguments:
python3 spiky.py /home/user/spiky-polygon.gpkg -a 1
- Outputs will be written to the same folder with '_ds' appended.
- Testing is done with Pytest and automated during master deploy using Github actions.
- Test spiky and despiked dataset can be found in /tests/fixtures.
- Enable Line, MultiLine, or MultiPolygon geometries
- Enable pip setuptools install
Andre Theron [email protected]