Commit Graph

242 Commits

Author SHA1 Message Date
Tom Kralidis f3151b0231 update CSV provider property typing (#1122)
* update CSV provider property typing

* fix test

* fix ref

* fix ref

* fix ref

* fix truthy evaluations
2023-01-31 06:26:31 -05:00
Tom Kralidis 0806757a01 add links to process list endpoint (#1117) 2023-01-28 16:49:15 -05:00
Tom Kralidis c8d55ecef8 autodetect SQLiteGPKG geometry columns, normalize fields into JSON Schema types (#1088) (#1103) 2023-01-14 08:04:13 -05:00
Angelos Tzotsos 126da2cc41 Reverting SensorThings test fix 2023-01-12 18:22:49 +02:00
Angelos Tzotsos 9c9111b096 Updating SensorThing test 2023-01-10 12:35:10 +02:00
Francesco Bartoli 172c12a0e5 Replace http status numbers with standard enumerations (#1068)
Replace http status numbers with standard enumerations
2022-12-10 00:54:43 -05:00
Benjamin Webb 29970e29c3 Use awalsh128/cache-apt-pkgs-action action (#1066)
Install libsqlite3-mod-spatialite for Github CI

Update sqlite tests
2022-12-08 16:45:36 -05:00
Benjamin Webb fffed87f2d Use Sensorthings action for API tests (#1055) 2022-12-08 16:33:18 -05:00
Tom Kralidis f9fb2c6005 move to f-strings for string interpolation (#1064)
* update from format() to f-strings

* fix

* fix

* fix ref

* update headers
2022-12-08 16:09:19 -05:00
Tom Kralidis 608fba5664 add support for OAMaps 🗺️ (#668) 2022-12-01 11:55:46 +02:00
Tom Kralidis fdf19c5f29 move numpy based tests to xarray/zarr provider (#1042) 2022-11-20 19:31:20 -05:00
Peter Garnæs 8938733292 Json serialize numpy types (#913)
* Json serialize numpy types

This commit fixes an issue with the current xarray provider. When a
NetCDF file is loaded into an xarray dataset, attributes of data
variables that are numbers will be loaded as numpy.float64 or
numpy.int64. These attributes are passed directly to metadata objects
that are json serialized, creating the issue.

This commit thereby fixes #895

* Avoid numpy import in util module
2022-11-20 19:12:02 -05:00
John A Stevenson 644281359a Add CQL to PostgreSQL provider (via pygeofilter and sqlalchemy) (#964)
* Add pygeofilter, unpin psycopg2

* Add pygeofilter SQLAlchemy query demo

* Add note about primary key

* Add todos to script

* Make script generic

* Add (commented out) PostgreSQL provider hotosm_bdi_waterways to config

* Update to use local test database

* Return result as dictionary

* Pass GEOM_FIELD as variable

* Add offset and limt, fix two names

* Implement order by

* Use function for cql query

* Add cql query block to query and test

* Link up to db engine

* Convert WKB geometry to GeoJSON

* Add shapely as explicit dependency

* Add tests for CQL queries

* Add test using CROSSES with LINESTRING

* Uncomment Docker PostGIS test layer

* First pass at wiring up API

The CQL is read from the request but the parser fails to convert to
AST.

* Turn logging to DEBUG

Example query
http://localhost:5000/collections/hot_osm_waterways/items?cql=%27osm_id%20BETWEEN%2080800000%20AND%2080900000%20AND%20name%20IS%20NULL%27

* Create dedicated pygeoapi-config.yml for testing PostgreSQL

* Add test for PostgreSQL CQL

* Return 400 for bad CQL

* Tidy up old files

* Bring API error type tests together

* Only reflect the table of interest

* Add pygeofilter to requirements

* Remove local setup_env.sh from .gitignore

* Remove lark exception handling

* Remove lark codes from tests, docstring change

* Split cql test into good and error

* Rename cql parameter to filter

* Add optional filter-lang parameter with test

* Initial changes

* Rename cql text parser

* Use CQL-JSON POST for PostgreSQL query

* Refactor to get data early and handle errors

* Add error tests for CQL-JSON PostgreSQL

* Add tests for prev/next and provider instantiation

* As filter-lang is set the block in not needed

* Clarify test fixtures

* Use filterq only in all CQL calls

* Make engine and table_model attributes of provider

* Handle different instantiation failures

* Use SQLAlchemy for get_fields()

* Minor doc edits

* Use SQLAlchemy for get()

* Simplify _sqlalchemy_to_feature

* Store database parameters in dedicated function

* Strip out non-SQLAlchemy code

* Add draft query() based on CQL filters

* Add property filtering to query()

* Implement select_properties and skip_geometry

* Implement bbox filter

* Implement properties subset defined in config

* Clean up materialized view test

We only need to test the fields that are present to be sure that the
view has been accessed, so other checks have been removed.

* Flake8 fixes and tidy up

* Add combined test for CQL with bbox and properties

* Create sessions directly where required

* Add Engine store to allow connection reuse

* Replace cql_ast with filterq

* Tidy up tests by using fixture for api

* Add authors

* Use Session() as context manager

A session requires a connection to the database, as provided by the
SQLAlchemy engine.  When the session goes out of scope, e.g. at exit
from the function when it was used, it should be garbage collected and
the connection freed.  However, during load testing it was found that
this wasn't happening.  This commit uses a context manager pattern to
start the session, which ensures that the session is closed at the end
of the `with` block.

* Return fields type as {'type': ...}

* Cache the table_model with the engine

Generating the table_model by "reflecting" the database is expensive but
the resulting model doesn't change.  If we cache the table_model with
the engine we save on a round-trip to the database and speed up response
time.

* Use separate stores for Engine and table_models

Using a combined store based on both engine and table_model meant that
a pygeoapi serving multiple tables on the same database would maintain
a connection pool for each table.  This could eventually saturate the
number of available connections.  This commit separates the store into
two parts.

* Update documentation with example

* Manage or post items based on POST content type

* ghcr build action

* only ghcr job

* run criteria edit

* Update README.md

* job = main

* remove success requirememt

* add tag

* tags: bgs-cql

* Update main.yml

* Update README.md

* remove binary

* update

* Update actions to latest versions

* Dockerfile refactor

* Dockerfile refactor

* restore dockerhub

* fix pygeoif version

* # 3.6 test & dockerhub ref

* Pin pygeoif version to less than 1

* Replace psycopg-binary with psycopg

* Split Docker build into sections

* Pin click version >7,<=8

* Add further cql examples

* Update workflows to match GeoPython repo

* update flake python version

* Unquote PostgreSQL column names

* Update container workflow uses versions

* flake8 use python version 3.7

* Use pre ping to get db connection

* Test that properties are set in provider

* Amendments as requested by @tomkralidis

* Correction

* Fix reviewed changes in api code

Co-authored-by: Colin Blackburn <colb@bgs.ac.uk>
Co-authored-by: KoalaGeo <eddlewis85@gmail.com>
Co-authored-by: Edd <edlew@bgs.ac.uk>
Co-authored-by: Colin Blackburn <ximenesuk@users.noreply.github.com>
2022-10-29 02:15:31 -04:00
Just van den Broecke 93bbc12aac fixes issue #1013 - new URL Dutch RDInfo WFS (#1014) 2022-10-13 18:33:45 -04:00
Tom Kralidis d08b8e6ab2 fix media type for queryables responses 2022-09-30 09:09:28 -04:00
Just van den Broecke 197b5588cb fix for issue #993 - fix ESRI Provider tests (#996)
* fix for issue #993 - fix ESRI Provider tests

* fix for issue #993 - fix ESRI Provider tests - reset time to TZ Z

* issue #993 - fix ESRI Provider tests - assert on UTC timestamp

* issue #993 - fix ESRI Provider tests - fix flake8 err
2022-09-27 20:56:35 -04:00
Just van den Broecke 2b149ad184 fix for issue 989 - get Docker build/push working (#997)
* fix for issue 989 - get Docker build/push working - try 1

* fix for issue 989 - get Docker build/push working - try 2 - remove tests - new WFS GeoSolutions
2022-09-27 21:19:38 +02:00
Benjamin Webb ffffc09fbe Fixes for github actions lik unit tests (#992)
* use int

* Update esri test data source

* Run tests on DEBUG loglevel

* Use np.int32
2022-09-27 02:04:21 +02:00
Just van den Broecke 3e33793b43 PR #801 comment-out failing coverage api test to enable unit-tests pass thus Docker build/push - try 2 2022-09-27 00:17:53 +02:00
Just van den Broecke 95f84d45ad PR #801 comment-out failing coverage api test to enable unit-tests pass thus Docker build/push 2022-09-27 00:13:20 +02:00
Tom Kralidis faa00e7c92 add support for API transactions (#984)
* add support for API transactions (#107)

* update Django views

* fix Starlette refs

* isolate  metadata fields

* fix flake8

* add root link relations to collection and item endpoints

* fix tests

* fix tests

* fix tests

* fix tests
2022-09-15 11:59:06 -04:00
Antonio Cerciello 514b7b9e08 Update OATiles to the latest specification changes #1 (#982)
* Start a wip alignment

* Adding CRS to tile_matrix_set_links

* Refactor json structure tiles endpoint

* Link section in tileset

* Unit test

Co-authored-by: Francesco Bartoli <francesco.bartoli@geobeyond.it>
2022-09-12 16:24:25 -04:00
Benjamin Webb 46f213bff5 Add Socrata provider for OGC API - Features (#955) 2022-08-15 09:44:25 -04:00
Benjamin Webb 5a6fdd2bed Add ESRI Service provider for OGC API - Features (#954) 2022-08-15 09:44:13 -04:00
Tom Kralidis a4478f817e fix schema imports as HTTPS (#961)
* fix schema imports as HTTPS

* fix schema imports as HTTPS
2022-08-10 10:12:39 -04:00
Tom Kralidis b3e766179f Update README.md 2022-07-28 22:02:58 -04:00
Benjamin Webb ac91bfe9b4 Provide source for items.geojson (#949) 2022-07-28 14:53:50 -04:00
Tom Kralidis 5c9e60f5d6 Update README.md (#946)
* Update README.md

* Update README.md
2022-07-27 14:53:17 -04:00
Just van den Broecke 24c1d6f870 Add Source info Dutch Addresses test data (#947)
As done.
2022-07-27 11:28:22 -04:00
Tom Kralidis 08f3380b6f update hidden resources concept (#934) 2022-07-11 07:45:10 -04:00
Benjamin Webb cd9e8ba7ee Update test_elasticsearch__provider.py (#936)
Update pytests re: https://github.com/geopython/pygeoapi/pull/935
2022-07-08 21:56:56 -04:00
Tom Kralidis 2d85eb2ac6 add support for non-advertised resources (#927) 2022-07-07 06:32:43 -04:00
Tom Kralidis 3b231c5fea add OpenAPI generate option to write to file (#919) (#925) 2022-06-21 21:03:19 -04:00
Tom Kralidis 427c46de7f update OARec links based on latest updates in specification (#915) 2022-05-30 09:46:40 -04:00
David Bitner 15e7deabed Fix SQL injection vulnerability. Fix bug with schema prefixed tables. (#889)
* Do not use str.format() for database queries. Ensure that pg columns returned respect schema prefix.

* quotes not needed with %s

* use sorted on test array comparison

* linting
2022-04-25 20:37:02 -04:00
Tom Kralidis b132882513 display conformance based on configuration (#888) 2022-04-19 21:37:21 +02:00
Tom Kralidis 356fe1280c add skip_geometry to remaining feature providers (#887)
* skip geometry for SQLite/GPKG backends (#886)

* simplify GKPG

* add for remaining providers, add to doc
2022-04-19 13:44:56 -04:00
Tom Kralidis 36b88e0719 fix map ref for CITE setup 2022-04-16 18:34:23 -04:00
Tom Kralidis 09ad6f8fce Hierarchical collections (#885)
* add support for hierarchical collections

* fix JSON rendering in docs

* fix JSON rendering in docs

* fix tests

* update docs

* update HTML templates with collections path

* fix template error

* add test
2022-04-16 18:26:55 -04:00
Tom Kralidis 7e8496d999 fix ES GeoJSON response when properties= is detected (#878)
* fix ES GeoJSON response when properties= is detected

* ES: use keywords arguments

* fix tests

* fix

* fix
2022-03-31 03:54:52 -04:00
Martin Pontius 12abb81227 Add unit test for tinydb job manager with parallel requests (#872)
* Add unit test for tinydb job manager with parallel requests

* Add source code header

* Fix flake8 issues
2022-03-14 06:25:03 -04:00
Tom Kralidis f17c6936a0 OACov: change coverage range-subset to properties, update conformance classes (#870)
* OACov: change coverage range-subset to properties, update conformance classes

* fix conformance tests
2022-03-10 16:23:49 -05:00
Tom Kralidis 1c87e0005b move items startindex to offset 2022-03-08 14:51:53 -05:00
Tom Kralidis 76fd56a671 fix OAProc relation types (#846)
* [OAProc]: fix relation types (#845)

* [OAProc]: fix relation types (#845)
2022-01-25 06:42:09 -05:00
Tom Kralidis 5d072f4efa OAProc updates (#840)
* update OAProc jobs as a top-level resource (#838)

* update config

* update copyright year
2022-01-04 08:43:39 -05:00
Tom Kralidis 3e6ac1eea9 fix off by one error in ES provider (#839)
* fix off by one error in ES provider

* fix tests
2022-01-03 09:57:49 -05:00
Tom Kralidis 1b508c77cd support antimeridian bbox cases (#837) 2022-01-03 08:25:37 -05:00
Tom Kralidis aa8eee662c fix float detection for ES provider (#836)
* fix float detection for ES provider

* fix float detection for ES provider

* fix typo
2021-12-26 20:14:43 -05:00
James Robinson eb891010b7 Add support for materialised views to postgres provider (#827) 2021-12-07 18:00:08 -05:00
James Robinson 3969fc0b19 Add support for config file properties to PostgreSQL provider (#829)
* 🐛 Add support for the properties keyword from the config file

* 🚨 Fixed flake8 errors

*  Added a test for config properties
2021-12-06 07:58:39 -05:00