* Add gzip to API.py * pytest for gzip * fix pytest * Update test_api.py * Add gzip to server block of configuration files * Update api.py to include gzip opts from config Update logic behind gzip compression such that compression will only happen when gzip in the Accept-Encoding request header and config.server.gzip is True. Use server charset for encoding/decoding and include charset in Content-Type when compressed. * Update pytest to use gzip config options Update pytest to test with (gzip in Accept-Encoding & server.gzip = False), (gzip in Accept-Encoding & server.gzip = True), (gzip not in Accept-Encoding & server.gzip = True) * Better Content Negotiation (#7) * Change content negotiation in _get_format() * Add to pytest and force h to always be string * Force F_JSON to default response * Update test_api.py for utf-16 encoding * better content negotiation pytest. * Add comments to pytest * Fix flake 8 * Improve docstring for gzip decorator function
Pygeoapi with SensorThings (STA)
This folder contains a Docker Compose configuration necessary to setup an example
pygeoapi server using a STA endpoint.
This config is only for local development and testing.
SensorThings Build options
There are three example STA endpoints. To switch between examples, the pygeoapi.config.yml file used in the docker
compose needs to be changed.
-
The first, brgm.sta.pygeoapi.config.yml creates a
pygeoapiserver serving the BRGM water quality endpoint. -
The second, iow.sta.pygeoapi.config.yml creates a
pygeoapiserver hosting example IoW endpoint with URIs. -
The final config, sta.pygeoapi.config.yml creates a
pygeoapiserver inside of a muti-container Docker app, and linked to an empty FROST server. To use this configuration, uncomment Lines 40 - 70 of the docker-compose.yml file in addition to changing the pygeoapi config. The database can be populated following a workflow similar to that of the populator script for build testing,load_sta_data.py.Note: The pygeoapi server will fail to build until the STA server has been populated, thus the addition of always restart
SensorThings Usage
After editing the docker-compose.yml file appropriately:
docker compose up [-d]
Navigate to localhost:5000.