Skip to content

Optimizes geopackage so that it can be used as datasource for PDOK OGC services

License

Notifications You must be signed in to change notification settings

PDOK/geopackage-optimizer-go

Repository files navigation

geopackage-optimizer

GitHub license GitHub release Go Report Card Docker Pulls

Optimizes GeoPackage so that it can be used as datasource for (PDOK) OGC services and APIs.

Build

docker build pdok/geopackage-optimizer-go .

Run

Usage of /optimizer:
  -config string
        optional JSON config for additional optimizations
  -s string
        source geopackage (default "empty")
  -service-type string
        service type to optimize geopackage for (default "ows")

TL;DR

Run from the root of this repo (note modifies geopackage/original.gpkg):

docker run \
  -v geopackage:/geopackage \
  pdok/geopackage-optimizer-go:latest "/geopackage/original.gpkg"

Optimizations

OGC webservices

With flag -service-type ows:

  • create index PUUID using UUID4
  • create index FUUID using [tablename].[PUUID]

This ensures that there are randomly generated UUID's usable as index, which has a couple of advantages:

  • having an index is good for performance
  • having a UUID instead of an incremental ID prevents crawling
  • having a UUID prevents users from creating applications that assumes that id has meaning and will not change in the future

OGC API Features

With flag -service-type oaf:

  • create BTree equivalent of an RTree spatial index
  • create index for temporal columns
  • create indexed column with an "external feature id" (external_fid). This external FID is a UUID v5 based on one or more given columns that are functionally unique across time.

Above optimizations primarily target OGC API Features served through GoKoala.

Example:

docker run -v `pwd`/geopackage:/geopackage pdok/geopackage-optimizer-go 
    /geopackage/original.gpkg 
    -service-type oaf 
    -config '{"layers":{"mytable":{"external-fid-columns":["fid"]}}}'

About

Optimizes geopackage so that it can be used as datasource for PDOK OGC services

Resources

License

Stars

Watchers

Forks

Packages

No packages published