Skip to content

Implementation of the OCG API - Features specification

License

Notifications You must be signed in to change notification settings

WouterVisscher/goaf

 
 

Repository files navigation

GOAF

GitHub license GitHub release Go Report Card Docker Pulls

GOAF is a OGC API - Features implementation in golang.

For who is it?

If you are looking for a very fast OGC API - Features application and are not afraid of some data tuning, this could be the application for you!

Datasources

GOAF supports the following datasources:

PDOK server implementation of OGCAPI-FEATURES

A a GeoJSON implementation with a Geopackage as a data provider.

The specification is a preliminary one, with go generate the routing based on api spec, provider interfaces en types structs and convenient parameter extractions are generated to stay easily up to date.

Build

docker build -t pdok/goaf:latest .

GeoPackage

The GeoPackage provider is a minimal config for GeoPackages that tend to be relative small e.g. < 3 GB.

docker run --rm -v `pwd`/example:/example -e CONFIG=/example/config-addresses-gpkg-minimal.yaml -p 8080:8080 pdok/goaf:latest

PostGIS

More elaborate config optimised performance for huge db (10M+ features/collection)

docker run -v `pwd`/example:/example -e CONFIG=/example/config-addresses-postgis-localhost.yaml' -p 8080:8080 pdok/goaf:latest

Example table

CREATE TABLE addresses.addresses
(
    fid text COLLATE pg_catalog."default" NOT NULL,
    offsetid bigint NOT NULL,
    properties jsonb,
    geom geometry,
    bbox geometry,
      
    CONSTRAINT addresses_addresses_pk PRIMARY KEY (fid)
)
WITH (
    OIDS = FALSE
)

CREATE INDEX addresses_geom_sidx ON addresses.addresses USING GIST (geom);
CREATE INDEX addresses_offsetid_idx ON addresses.addresses(offsetid);

Generate

Some of the code is generated based on the given oas.yaml:

codegen/provider.go
codegen/types.go
server/routing.gen.go
go generate generate/gen.go

Test

go test ./... -covermode=atomic

How to Contribute

Make a pull request...

License

Distributed under MIT License, please see license file within the code for more details.

Thanks

Inspiration and code copied from:

The main differences with regards to jivan is the data provider setup, some geopackage query speedups for larger Geopackages and some tweaks for scanning the SQL features

About

Implementation of the OCG API - Features specification

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 61.5%
  • Go 29.9%
  • HTML 7.4%
  • Other 1.2%