Skip to content

cuteDen-ECNU/Spatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spatter

Purpose

Spatter is a tool for finding Spatial related bugs in Spatial DBMS using Shape-Preserving Transformation.

Supported Spatial DBMS

  • PostGIS
  • MySQL
  • DuckDB

Effectiveness

Step by Step

Quick Start for PostGIS

Install PostGIS

  1. Make sure the docker name and port, for example:
docker_name=postgis-spatter
docker_port=15450
  1. Create a docker
cd src/postgis
./init-docker/start-docker.sh ${docker_name} ${docker_port}
  1. Install necessary dependancy
docker exec ${docker_name} sh -c "apt-get install -y bison flex cmake autoconf libtool libxml2-dev"
docker exec ${docker_name} sh -c "apt-get install -y libproj-dev libcunit1 libcunit1-doc libcunit1-dev lcov rsync"
docker exec ${docker_name} sh -c "pip install psycopg2-binary shapely "
  1. Copy postgis source code from "src/postgis/script/src-repo"
docker exec ${docker_name} sh -c "mv /script/src-repo/postgres-main /postgres"
docker exec ${docker_name} sh -c "mv /script/src-repo/geos-main /geos"
docker exec ${docker_name} sh -c "mv /script/src-repo/postgis-main /postgis"

Or choose the newest version of PostGIS through github:

docker exec ${docker_name} sh -c "git clone https://github.com/postgres/postgres.git || exit -1"
docker exec ${docker_name} sh -c "git clone https://github.com/libgeos/geos.git || exit -1"
docker exec ${docker_name} sh -c "git clone https://github.com/postgis/postgis.git || exit -1"
  1. Begin to compile
postgis_new='07a73c0f2'
geos_new='0a8fc37a9'
docker exec ${docker_name} sh /script/compile/compile.sh ${postgis_new} ${geos_new}
  1. Start postgres, create database, and create extension
./init-docker/prepare-psql.sh ${docker_name}
./init-docker/start-psql.sh ${docker_name}

Run Spatter

  1. How to set parameter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py -h"
  1. Run Spatter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py"
  1. Reduce a single trigger case:
trigger_path=/log/trigger-cases/$(docker exec -it ${docker_name} sh -c "ls /log/trigger-cases/ | head -n 1")
docker exec -it ${docker_name} sh -c "./script/SpatterReduce.py ${trigger_path}"

Quick Start for DuckDB Spatial

Install DuckDB Spatial

  1. Make sure the docker name, for example:
docker_name=duckdb-spatter
  1. Create docker:
cd src/duckdb
./init-docker/start-docker.sh ${docker_name}
  1. Compile duckdb:
docker exec ${docker_name} sh /script/compile/compile.sh

Run Spatter

  1. Run Spatter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py"
  1. Reduce a single trigger case:
trigger_path=$(docker exec -it ${docker_name} sh -c 'echo /log/trigger-cases/* | cut -d" " -f1')
docker exec -it ${docker_name} sh -c "./script/SpatterReduce.py ${trigger_path}"

Quick Start for MySQL GIS

Install MySQL

  1. Make sure the docker name, for example:
docker_name=mysql-spatter
docker_port=15451
  1. Create docker:
cd src/mysql
./init-docker/start-docker.sh ${docker_name} ${docker_port}
  1. Compile duckdb:
docker exec ${docker_name} sh /script/compile/compile.sh

Run Spatter

  1. Start postgres, and create database:
./init-docker/start-mysql.sh ${docker_name}
  1. Run Spatter:
docker exec -it ${docker_name} sh -c "./script/SpatterRun.py"
  1. Reduce a Single Trigger Case:
trigger_path=$(docker exec -it ${docker_name} sh -c 'echo /log/trigger-cases/* | cut -d" " -f1')
docker exec -it ${docker_name} sh -c "./script/SpatterReduce.py ${trigger_path}"

Efficiency

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published