Giter VIP home page Giter VIP logo

sieve's Introduction

Sieve

GitHub license GitHub release Go Report Card Docker Pulls

Sieves GeoPackage Polygon geometries.

The purpose of this application is to prerefine the (MULTI)POLYGON geometries in a geopackage used for vector tiles by filtering out geometries (based on the given resolution) smaller than the pixels that are generated from the given vectoriles. By doing this specific artifacts/errors regarding the rendering of vector tiles can be omitted, and less data needs to be processed.

Notes

  • It will take a Geopackage and writes a new Geopackage where all the (MULTI)POLYGON tables are sieved.
    • All other spatial tables are 'untouched' and copied as-is.
    • Other not spatial tables are not copied to the new geopackage.
  • The area of a POLYGON is used for determining if the geometries will be sieved, not the extent. So geometries with a extent larger then the given resolution but with an area smaller then that resolution will be sieved.
  • A MULTIPOLYGON will be split into separate POLYGONs that will be sieved. So a MULTIPOLYGON containing elements smaller then the given resolution will have those parts removed.
  • โš ๏ธ Spatialite lib is mandatory for running this application. This lib is needed for creating the RTree triggers on the spatial tables for updating/maintaining the RTree.

Usage

go build .

go run . -s=[source GPKG] -t=[target GPKG] -r=[resolution for filtering] \
   -p=[pagesize for writing to target GPKG]

go test ./... -covermode=atomic

Docker

docker build -t pdok/sieve .
docker run --rm --name sieve -v `pwd`/example:/example pdok/sieve ./sieve \
   -s=./example/example.gpkg -t=./example/example-processed.gpkg -r=50001 -p=10

With the docker example above processing the example.gpkg would result in the following.

with interiors without interiors

Inspiration

Code is inspired by the PostGis Sieve function from Mapbox.

sieve's People

Contributors

gerdos82 avatar roelarents avatar woutervisscher avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

woutervisscher

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.