All Projects → developmentseed → Sat Api Pg

developmentseed / Sat Api Pg

Licence: mit
A Postgres backed STAC API.

Labels

Projects that are alternatives of or similar to Sat Api Pg

Pgtap
PostgreSQL Unit Testing Suite
Stars: ✭ 631 (+3055%)
Mutual labels:  plpgsql
Pg Mask
Simple data masking for PostgreSQL
Stars: ✭ 16 (-20%)
Mutual labels:  plpgsql
Elite
Stars: ✭ 7 (-65%)
Mutual labels:  plpgsql
Blog
Everything about database,business.(Most for PostgreSQL).
Stars: ✭ 6,330 (+31550%)
Mutual labels:  plpgsql
Chinook Database
Sample database for SQL Server, Oracle, MySQL, PostgreSQL, SQLite, DB2
Stars: ✭ 786 (+3830%)
Mutual labels:  plpgsql
Geocode
Batch geocoding addressess, map to census block with PostGIS Tiger Geocoder
Stars: ✭ 23 (+15%)
Mutual labels:  plpgsql
Audit Trigger
Simple, easily customised trigger-based auditing for PostgreSQL (Postgres). See also pgaudit.
Stars: ✭ 493 (+2365%)
Mutual labels:  plpgsql
Basketball Data Scraper
A scraping library that gets you basketball data for the NBA and WNBA
Stars: ✭ 13 (-35%)
Mutual labels:  plpgsql
Odata V4 Typeorm
OData to TYPEORM query compiler
Stars: ✭ 16 (-20%)
Mutual labels:  plpgsql
Foodnutrition
食物营养大数据
Stars: ✭ 27 (+35%)
Mutual labels:  plpgsql
Demo
“Happy Lager” Craft CMS demo site.
Stars: ✭ 730 (+3550%)
Mutual labels:  plpgsql
Mysql Deadlocks
收集一些常见的 MySQL 死锁案例
Stars: ✭ 777 (+3785%)
Mutual labels:  plpgsql
Postgis
PostGIS spatial database extension to PostgreSQL [mirror]
Stars: ✭ 925 (+4525%)
Mutual labels:  plpgsql
Postgrest Starter Kit
Starter Kit and tooling for authoring REST API backends with PostgREST
Stars: ✭ 657 (+3185%)
Mutual labels:  plpgsql
Scidb4geo
A SciDB Plugin for Managing Spatial and Temporal Reference Information of Arrays
Stars: ✭ 8 (-60%)
Mutual labels:  plpgsql
Node Sqlite3
Asynchronous, non-blocking SQLite3 bindings for Node.js
Stars: ✭ 5,083 (+25315%)
Mutual labels:  plpgsql
Pg query internals
Query PostgreSQL internals using SQL
Stars: ✭ 17 (-15%)
Mutual labels:  plpgsql
Sqlgenerate
Generates SQL when given an AST from the Codeschool/sqlite-parser
Stars: ✭ 14 (-30%)
Mutual labels:  plpgsql
Medrianchor
The (Me)tadata (Dr)iven (Anchor) Model
Stars: ✭ 9 (-55%)
Mutual labels:  plpgsql
Mallcloud Platform
mallcloud商城基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离vue的企业级微服务敏捷开发系统架构。并引入组件化的思想实现高内聚低耦合,项目代码简洁注释丰富上手容易,适合学习和企业中使用。真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案,面向互联网设计同时适合B端和C端用户,支持CI/CD多环境部署,并提供应用管理方便第三方系统接入;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等
Stars: ✭ 27 (+35%)
Mutual labels:  plpgsql

sat-api-pg

A Postgres backed STAC API.

sat-api-pg OpenAPI Docs

Built on the foundation of the excellent

PostgREST - Postgres REST API backends.

PostgREST Starter Kit - Starter Kit and tooling for authoring REST API backends with PostgREST.

Purpose

To provide the community a Postgres backed reference implementation of the STAC API specification. Postgres's flexibility and ecosystem of geospatial functionality provide a great foundation for building spatial APIs and we hope the community can expand on this work to drive STAC development forward.

Project Layout

.
├── db                        # Database schema source files and tests
│   └── src                   # Schema definition
│       ├── api               # Api entities avaiable as REST endpoints
│       ├── data              # Definition of source tables that hold the data
│       ├── libs              # A collection modules of used throughout the code
│       ├── authorization     # Application level roles and their privileges
│       ├── sample_data       # A few sample rows
│       └── init.sql          # Schema definition entry point
├── openresty                 # Reverse proxy configurations and Lua code
│   ├── lualib
│   │   └── user_code         # Application Lua code
│   ├── nginx                 # Nginx files
│   │   ├── conf              # Configuration files
│   │   └── html              # Static frontend files
│   ├── Dockerfile            # Dockerfile definition for production
│   └── entrypoint.sh         # Custom entrypoint
├── tests                     # Tests for all the components
│   ├── db                    # pgTap tests for the db
│   └── rest                  # REST interface tests
├── docker-compose.yml        # Defines Docker services, networks and volumes
└── .env                      # Project configurations

Installation

Prerequisites

In the root folder of the application, install the necessary js libs.

$ yarn

The root folder of the application contains .sample_env with development environment settings. Rename this file by running

$ cp .sample_env .env

In the root folder of application, run the docker-compose command

$ docker-compose up -d

The API server will become available at the following endpoint:

Try a simple request

$ curl http://localhost:8080/collections/landsat-8-l1/items

To remove the docker compose stack run

$ docker-compose stop

Followed by

$ docker-compose rm

Development workflow and debugging

In the root of your project run.

$ yarn subzero dashboard

After this step you can view the logs of all the stack components (SQL queries will also be logged) and if you edit a sql / conf / lua file in your project, the changes will immediately be applied.

Testing

Conformance with the STAC API specification and extensions can be understood by reviewing the integration tests available at /tests/rest. To run tests, the docker-compose stack must be running.

yarn test                   # Run all tests (db, rest)
yarn test_db                # Run pgTAP tests
yarn test_rest               # Run integration tests

Deployment

For AWS deployment steps see deployment/README.md.

Contributing

This project was initiated as part of Development Seed's wider work in helping to build the STAC API specification and open sourced to to the community to help drive contributions and new functionality. New contributions are welcomed and you can contact @sharkinsspatial or [email protected] for additional support or assistance with customization. Anyone and everyone is welcome to contribute.

STAC alignment

This API implementation closely follows the STAC API specification. Becase the STAC API specifcation is under active development there are some current differences between the STAC specification v0.8.0. For more details on capabilities see sat-api-pg OpenAPI Docs. Notable differences

  • Though the search extension is not currently implemented much of the same behavior can be acheived via the use of http headers. When using the next and limit parameters, responses will contain a Content-Range header which shows the current range of the response. To obtain the total number of items found the request can specify the Prefer: count=exact header and the full count will be available in the Content-Range response header. Be aware that this exact count can be slow for very large tables. For increased performance we will soon release support for the Prefer: count=planned header to provide an estimated count. Note that the accuracy of this count depends on how up-to-date are the PostgreSQL statistics tables.

  • The API contains a generic /items endpoint which supports access to items across parent collections. The rationale for this is tied to the insert extension described below.

  • The transaction is not currently implemented but insert behavior using http POST is enabled for items and collections. Authentication for insert operations is handled via the Authorization header with JWT tokens. To make an authenticated request the client must include an Authorization HTTP header with the value Bearer <jwt>. Tokens can be generated using the JWT_SECRET from the .env file by running

$ node generateToken.js 

Due to permissions on the base table where records are stored insert requests must also set the header Prefer: return=minimal.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].