Code Monkey home page Code Monkey logo

pg_featureserv's Introduction

pg_featureserv

Travis Build Status

A lightweight RESTful geospatial feature server for PostGIS, written in Go. It supports the OGC API - Features REST API standard.

Features

  • Implements the OGC API - Features standard.
    • Supports standard request parameters limit, bbox, property filtering
    • Extended parameters include offset, properties, orderBy, transform, precision
  • Data responses are formatted in JSON and GeoJSON
  • Provides a simple HTML user interface, with web maps to view spatial data
  • Uses the power of PostgreSQL to reduce the amount of code and to make data definition easy and familiar.
    • Feature collections are defined by database objects (tables and views)
  • Uses PostGIS to provide geospatial functionality:
    • Transforming geometry data into the output coordinate system
    • Marshalling feature data into GeoJSON
  • Full-featured HTTP support
    • CORS support with configurable Allowed Origins
    • GZIP response encoding
    • HTTP and HTTPS support

For a full list of software capabilities see FEATURES.

Documentation

Download

Builds of the latest code:

Building from Source

pg_featureserv is developed under Go 1.13. It may also work with earlier versions.

  • Ensure the Go compiler is installed
  • Download or clone this repository into $GOPATH/src/github.com/CrunchyData/pg_featureserv
  • To build the executable, run the following commands:
cd $GOPATH/src/github.com/CrunchyData/pg_featureserv/
go build
  • This should create a pg_featureserv executable in the application directory
  • (Optional) Run the unit tests using go test ./...

Configuring the service

  • Set the environment variable DATABASE_URL with a Postgres connection string
    • Example: export DATABASE_URL="host=localhost user=postgres"
  • Edit the configuration file pg_featureserv.toml, located in ./config, /config, or /etc

Running the service

  • If not already done, move to the application directory:
    • cd $GOPATH/src/github.com/CrunchyData/pg_featureserv
  • Start the server:
    • ./pg_featureserv
  • Open the service home page in a browser:
    • http:/localhost:9000/home.html

Command-line options

  • -? - show command usage
  • --config file.toml - specify configuration file to use
  • --debug - set logging level to TRACE (can also be set in config file)
  • --devel - run in development mode (e.g. HTML templates reloaded every query)
  • --test - run in test mode, with an internal catalog of tables and data
  • --version - display the version number

Requests Overview

Features are identified by a collection name and feature id pair.

The default response is in JSON/GeoJSON format. Append .html to the request path to see the UI page for the resource. In a web browser, to request a JSON response append .json to the path (which overrides the browser Accept header).

The example requests assume that the service is running locally and configured to listen on port 9000.

See API Summary for a summary of the web service API.

pg_featureserv's People

Contributors

dr-jts avatar pramsey avatar crunchyheath avatar thesteve0 avatar kbatuigas avatar stephenhillier avatar adamtimm avatar crunchyjohn avatar jomue avatar crunchymaggie avatar

Watchers

James Cloos avatar  avatar

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.