Commit Graph

1068 Commits

Author SHA1 Message Date
Tom Kralidis 21de48d787 ERDDAP and OpenAPI fixes (#1308) 2023-07-03 09:25:48 -04:00
Ricardo Garcia Silva 2def8e5e47 Do not require links in process metadata (#1284)
* Move get_manager to base module

* Process manager now knows about existing processes

* Guard API from manager.get_job() errors

* Guard API from job-related errors

* moved process-related exceptions to pygeoapi.process.base

* manager is now responsible for instantiating a processor

* Guard API from manager.get_job() errors

* Guard API from job-related errors

* made process description links optional

* removed duplicated exception class

* Removed process.exceptions module, which got accidentally reintroduced after a rebase

---------

Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com>
2023-07-03 06:32:35 -04:00
Ricardo Garcia Silva 44768fc488 Guard against invalid job id throwing error (#1281)
* Process manager now knows about existing processes

* Move get_manager to base module

* Process manager now knows about existing processes

* Guard API from manager.get_job() errors

* Guard API from job-related errors

* fix flak8-related issue on tests

* moved process-related exceptions to pygeoapi.process.base

---------

Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com>
2023-07-02 12:47:23 +02:00
Tom Kralidis ba7fc15be7 fix reference to OGC API - Tiles schema (#1299) (#1300) 2023-07-02 11:45:29 +02:00
Ricardo Garcia Silva 40e82424f3 Process manager instantiates processor (#1278)
* Process manager now knows about existing processes

* Move get_manager to base module

* manager is now responsible for instantiating a processor

* manager.execute_process now accepts process_id instead of processor instance

* Add license to test file

* fix email address typo

---------

Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com>
2023-07-02 04:51:34 -04:00
Ricardo Garcia Silva 862e83da1f Process manager now knows about existing processes (#1277)
* Process manager now knows about existing processes

* get processes from the process manager rather than the config

* Move get_manager to base module

---------

Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com>
2023-07-01 10:53:46 -04:00
Jo f47979335b - removed empty key section, which is causing yaml errors: (#1275)
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.elastic_search.environment contains an invalid type, it should be an object, or
an array
(pygeoapi)

Co-authored-by: doublebyte1 <info@doublebyte.net>
2023-07-01 09:07:11 -04:00
totycro d7b112f62b Avoid internal server error when no format requested in get_collection_item (#1274)
Previously, request.format was assumed to always be defined when
generating `prev` and `next` links.

This commit changes this by using json as default format. This supports
the use case of curl nicely, but we could also choose e.g. html.

This branch is not yet tested because I didn't manage to find/produce test
data for single items which have next/previous links.

Fixes https://github.com/geopython/pygeoapi/issues/1272
2023-07-01 09:06:36 -04:00
Just van den Broecke 6a871e8591 #1297 pin pydantic to less than 2.0 (#1298) 2023-07-01 14:52:50 +02:00
Tom Kralidis 5afa360019 Update requirements.txt 2023-07-01 04:49:35 -04:00
totycro f6a055e8e1 Improve tinydb locking (#1273)
* Update tinydb manager test to current api

* Add tinydb parallel tests to CI

* Use filelock library to help make tinydb threadsafe

The tests for parallel access sometimes failed with the previous
implementation. I'm currently not 100% sure why, but it might have
to do with the fact that the file is already created in the TinyDB
constructor which was not protected by a lock.

Also not protecting the reads can read to invalid reads in the case
when a read and a write happen simultaneously and the read catches
partially written data.

This implementation allows for fewer concurrency but is quite simple,
so we should be able to be confident about its safety.

Also the TinyDB manager is not intended for high performance and its
IO operations are orders of magnitude faster than requests over the
network or process executions anyway.
2023-07-01 04:48:06 -04:00
Benjamin Webb aaaa174fcd Fix ref in docs (#1294)
- Remove typos from OGC API - Features table
- Fix link relations in docs
2023-07-01 04:47:20 -04:00
Jo d96e78871c - Added TileMatrixSet definition (from OGC NA) to the tilesets response: (#1290)
See: https://docs.ogc.org/is/20-057/20-057.html#toc34
2023-06-27 17:48:12 +02:00
Jo 1cb4b872cf Fixing error when retrieving the TMS in vector tiles that do not provide tilejson metadata (#1288)
* - look for metadata.json, only when we are using the tilejson format; in other cases, this file is missing and that is going to make pygeoapi fail

* - updated configuration examples in documentation, to use "default" as metadata for vector tiles ("raw" does not work)
- added metadata format configuration for the pg_tileserv provider example
2023-06-27 05:17:47 +02:00
Tom Kralidis 97a77b11bb update TinyDBCatalogue test metadata loader to latest OWSLib (#1291) 2023-06-27 02:13:04 +03:00
Tom Kralidis f436f0553f raise error on empty wildcarded indices (#1276) 2023-06-21 16:27:23 -04:00
Jo 3b5330782f Added conformance classes for OGC API - Common - part 1 (#1271) 2023-06-20 23:00:42 -04:00
Tom Kralidis 3566290ac4 Rename readthedocs.yml to .readthedocs.yaml (#1267)
* Rename readthedocs.yml to .readthedocs.yml

* Rename .readthedocs.yml to .readthedocs.yaml
2023-06-16 07:54:20 +02:00
Mathieu Tachon 1ff847d3eb fix(starlette_app): rename app -> APP in uvicorn.run call (#1260) 2023-06-15 23:11:42 -04:00
Tom Kralidis 0237e4cbbd fix tile link relations (#1262) (#1264) 2023-06-15 08:18:55 +02:00
Jo eb89c08ad0 Added conformance class for Mapbox Vector Tiles (#1263)
* - Added conformance class for Mapbox Vector Tiles

* - updated number of conformance classes on tests

---------

Co-authored-by: doublebyte1 <info@doublebyte.net>
2023-06-14 18:55:40 -04:00
Ricardo Garcia Silva 893e5064be Remove usage of flask path parameters in process-related routes (#1257)
Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com>
2023-06-07 21:56:08 -04:00
Benjamin Webb 7ccfded868 Return numberMatched if in STA response (#1259)
Attempt to return `@iot.count` in included in response. Including the query param `'$count' = 'true'` is costly on the SensorThings API endpoint when accessing the Observations entity. Some STA endpoints are including the count as a default.
2023-06-06 17:42:58 -04:00
Paul Tomasula 10d33c4207 Case-insensitive headers for execute_process (#1256)
* Address case-insensitive for headers in execute_process

Headers fields are general case insensitive. I found my client was sending the prefer field as lower case, resulting in my processes being run synchronously. This commit changes the default value of the dict.get command for 'Prefer' to try looking up 'prefer' if it cannot find the capital version of the field in the headers dictionary.

* Address flake8 issues

Tweaks to style to address flake8 flagged issues.
2023-05-30 11:51:24 -04:00
totycro 32d50f982b Fix api tests in docker (#1255)
The tests have recently been rewritten to use `url_for`, which was
changed in flask 2.2.0, so the tests don't pass in previous versions
https://flask.palletsprojects.com/en/2.3.x/api/#flask.Flask.url_for

However the python3-flask package for ubuntu only features the ancient
version 2.0.1-2ubuntu1.

Therefore this commit switches flask the install to pip, where recent
verions are available

References https://github.com/geopython/pygeoapi/issues/1111
2023-05-26 20:42:03 -04:00
Angelos Tzotsos 953b6fa74d switch back to dev 2023-05-18 21:20:54 +03:00
Tom Kralidis 7587e7f5e6 fix docs warning and RTD settings (#1250) 2023-05-18 13:54:39 -04:00
Angelos Tzotsos 5dfdea3568 update release version 2023-05-18 19:06:12 +03:00
Benjamin Webb c45fb78223 Remove duplicate CRS configuration in docs (#1249)
- Deduplicate crs configuration in docs
- Move advanced provider configuration to end of example
2023-05-18 09:07:54 -04:00
Sarah Jordan dcfdfdf799 Time Querying in EDR Provider (#1247)
* update time handling for edr provider

* add logging for time parsing

* fix time handling errors

Convert times to np.datetime64 to allow greater than/less than comparison. If slicing over time, separate xarray sel into temporal and spatial component (cannot use method='nearest' for time slices).

* fix temporal query dictionary

* fix time error handling

* fix list handling for single timestep

* single timestep handling

* spatial-only query amendment

* code clean-up

* convert datetime

* move code to methods

for reuse between position and cube. #1239

* formatting fixes

#1239

* time query test

#1239

* clean-up

* move time querying tests to api testing

* Update test_api.py

* update time key

* modify test values

* updates for desired query behavior

#1239

* Update xarray_edr.py

* sanitize datetime_ parameter with Z

OpenAPI document provides RFC 3339 compliant examples (exclusively specify UTC as the timezone with a trailing Z; want to avoid confusion between allowed datetime query and the documentation. #1239

* requested changes from @webb-ben and @tomkralidis

#1247
2023-05-17 21:19:10 -04:00
Benjamin Webb dea6ffc48e Create separate tag for jobs in OAS (#1246)
Move paths for `/jobs**` from server tag to separate tag when generating OpenAPI document
2023-05-16 21:01:45 -04:00
Tom Kralidis 6aa8ca67a7 increase JSON minification (#1245) 2023-05-12 18:05:54 +02:00
Ricardo Garcia Silva a3b850fa6a fix importlib_metadata issue for early versions (#1242) 2023-05-05 14:21:48 -04:00
Ricardo Garcia Silva e06ff73e57 custom cli commands (#1234)
* Implemented discovery of third-party cli commands

* Updated authors

* Added python3-importlib-metadata to debian control file

* Replaced ellipsis with a pass statement

---------

Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com>
Co-authored-by: Tom Kralidis <tomkralidis@gmail.com>
2023-05-04 07:35:32 -04:00
Sarah Jordan fddefc4ec5 move functions for speed (#1238) 2023-05-03 21:10:36 -04:00
Tom Kralidis 997a83530e Unpin click and Jinja2 (#1236)
* test unpinning click and Jinja2

* test
2023-05-03 09:34:13 -04:00
Tom Kralidis 8f54a0d6dc Xarray: add support for multi-file dataset (#1233)
* Xarray: add support for multi-file dataset

* fix flake8

* test
2023-04-30 16:11:21 -04:00
Juan Pablo Duque c02d8f5ba2 Fixed Django serve error related to urlpatterns, updated documentation by adding hot-reloading section. (#1231)
* Fix for Django build, changes to documentation, and dev dependencies updated

* remove example configuration files

* Added readthedocs configuration file

* added section on building the documentation

* renamed docs/requirements-docs.txt to docs/requirements.txt

* renamed requirements file in readthedocs configuration

* Added documentation requirements installation to GitHub build workflow
2023-04-27 05:03:39 -04:00
IngenieroGeomatico 70c59bcfc6 🔧 if conditional is added to the collections section (#1226)
* 🔧 if conditional is added to the collections section

* 🔧 if conditional is added to the collections section

* ⬆️ add collection key in data
2023-04-25 13:36:39 -04:00
Tom Kralidis c46972dcf6 add license section to collection if rel=license exists (#1230) 2023-04-25 19:44:31 +03:00
Tom Kralidis b7ee1203cd add support for ERDDAP Tabledap provider (#1214) 2023-04-25 17:39:55 +02:00
Jo 6c71f90645 - Updated "Publishing map tiles to OGC API - Tiles" to "Publishing tiles to OGC API - Tiles". The previous title could be misleading, as this standard supports publishing different types of tiles, other than maps. (#1228)
- Added "coverage" as another type of tiles that the standard supports.
2023-04-24 10:27:00 -04:00
Tom Kralidis 12b2fa8935 update OAFeat Part 3 based on specification updates (#1223) 2023-04-24 09:13:48 +02:00
Ricardo Garcia Silva ac16e5ae97 1204 oapi process execution use prefer header (#1206)
* Added enum for requested process execution modes

* Added data dict as expected base process.execute param

* Modified base process manager to select execution mode

* Pass requested execution mode to process manager

* Refactored dummy process manager to deal with request execution mode

* Use num value in response headers

* fix bug with non-existent process response headers

* fix flake8 errors

* fix python version errors

* fix python version errors

* fix python version errors

* refactor failing test

* refactor failing test

* fix line length

* fix using tuple in type annotations

* update docs and add missing param docstring

* swapped double quotes for single quotes for consistency
2023-04-18 07:43:18 -04:00
Tom Kralidis 70feda7deb add DOI (#1220) 2023-04-17 19:28:03 -04:00
Tom Kralidis 627f2228ab ES: change PUT update argument (#1216) 2023-04-12 12:19:10 -04:00
Ricardo Garcia Silva 5e9c82a34d Process manager generate job ids (#1209)
* Modified process manager to generate job id

* Continued to refactor in order to let process manager generate job id

* fix syntax error

* reorder imports
2023-04-12 06:11:13 -04:00
Just van den Broecke 7c6993719d add CRS Support for OGC API Feature pygeoapi Provider (#1174)
* OGC API - Features Part 2 (groundwork+CRS-BBOX) from PR #1155 - contributes to issue #1128

* #1128 provide conformance class for OAPIF Part 2 in /conformance page

* #1128 bitten by flake8...

* #1128 configurability CRS Feature Providers with syntax, defaults and tests

* #1128 configurability CRS Feature Providers refine for default values

* #1128 display supported CRSs in HTML Collection template

* #1128 config, mmetadata and tests for storageCRS and storageCrsCoordinateEpoch

* #1128 WIP for bbox-crs parameter support

* #1128 utility function and tests for default/mandatory supprted CRS list

* #1128 default supported CRS adaptation to OAPIF Part 2 standard

* #1128 grr flake8 whitespace

* #1128 start adding full API tests OGR for bbox-crs and crs parms

* #1128 fix flake8

* #1128 fix flake8 - install GDAL in workflow main for OGR tests

* #1128 fix flake8 - install GDAL in workflow main for OGR tests - need pip package?

* #1128 fix flake8 - install GDAL in workflow main for OGR tests - using libgdal-dev gdal-bin

* #1128 fix SensorThings test for main.yml Workflow

* #1128 fix SensorThings test for main.yml Workflow nr 2

* #1128 make all OGR tests working again

* #1128 make all OGR tests working again - flake8

* #1128 make all OGR tests working again - GeoSolutions WFS bbox

* #1128 #1155 add documentation for OGC OAPIF Part 2 CRS CRS BBOX support

* #1128 #1155 refine documentation for OGC OAPIF Part 2 CRS CRS BBOX support

* #1128 #1155 refine documentation to align with #1149

* #1128 #1155 rework from review OAS and pygeoapi config schema

* #1128 #1155 minor: compile Re for CRS URI only once as global var

* #1128 merge in changes from PR #1173 - fix missing import

* WIP Ogcapi features part 2 - Support for crs query parameter (#1149)

* feat(ogcapi_features_crs): start implementing crs support from ogcapi features part2

* Pass input and output CRSs WKT instead of crs transformation object

* fix longs lines and blank lines

* fix typo

* fix import for type annotation not supported by python version

* fix variable visibility in local scope

* fix tabs/spaces indentations

* Add support for the crs parameter to OGRProvider

* make flake8 happy

* Make crs transformation mechanism more consistent between PostgreSQL and OGR providers

* test(util): add two test functions in util.py

New functions: test_get_crs_from_uri and test_get_transform_from_crs

* fix too long lines...

* Update get_crs_from_uri and corresponding test function

* fix(get_crs_from_uri): make the error more explicit in if wrong crs uri format

* flake8 again...

* Keep support for source_srs/target_srs in config for OGRProvider

* revert changes made to pygeoapi-config-0.x.yml, overlap with PR 1155

* test: add test data and update test config file

* Extract 'crs' and 'storage_crs' and provider level instead of collection level

* feat(crs): new decorator to support coordinates transformation of feature collections

* feat(crs): 'crs' query parameter for CSVProvider

* test(crs): add tests for 'crs' query parameter

* test: update number of collections in test_describe_collections

* test: update number of collections in test_filter_dict_by_key_value

* fix(crs_transform): change the crs transformation decorator

Change the logic of the decorator so that it works for both functions that
return FeatureCollections and for functions tha return single Features.

* test: add tests for get_collection_item end-point with 'crs' parameter

* fix(test_get_collection_item_crs): id as path parameter, not query parameter

* test: unpack coordinates to create point geometry

* feat(crs): add suuport for crs query parameter for all providers of type 'feature'

* docs(crs): add documentation to illustrate use of 'crs' query parameters

* docs(crs): more data access examples

* fix typo and add new line

* refactor: specify None as default value for crs_transform_out parameter in _sqlalchemy_to_feature method

* changes for PR 1149, test_api and style formatting

* CRS84 as default crs also for test_get_collection_items_crs

* test(crs): test coordinates transformation implementation of PostgreSQLProvider

* test(crs): move tests to test_postgresql_provider

* fix test function calls

* change test to ensure returned features are the same

* add json format to request object

* test(crs): test coordinates transformation implementation of OGRProvider

* refactor(crs): make more compact get_collection_item and get_collection_items

Define two new static methods in API class, to create crs_transform_wkt and
setting content-crs header. These methods can be re-used in both
get_collection_item and get_collection_items methods and removes code
duplication.

---------

Co-authored-by: Just van den Broecke <just@justobjects.nl>

* #1178 fix flake8 error

* #1178 use EPSG:28992 i.s.o. 32631 - fix unit test OGR Shapefile

* #1174 use CRS-compliant Axis ordering for crs support

* #1174 fix and honour CRS 4258disable native CRS Transform in OGR Provider - Axis ordering not honoured...

* #1174 remove ADR tests rom test_util.py

* #1174 enable native CRS transform again in OGR Provider

* #1174 enable native CRS transform again in OGR Provider - fix config

* #1174 remove support for source/target_srs in OGRProvider - enforce transforms always based on storageCRS

* #1174 fix tests Postgresql Provider for Transforms

* #1174 fix tests Postgresql Provider for Transforms

* #1174 add tests for OGR Transformation and Axis Order

* #1174 Suppress potential axis-swapping in OGR ExportToJSON

* #1174 minor fix test - unassign spatialref before setgeom infeat

* #1174 minor fix test - unassign spatialref before setgeom infeat - flake8

* #1174 solve CI WFS test failures with GDAL HTTP config options

* #1174 bbox and bbox-crs defs local in openapi.py for CITE validators

* #1174 merge master - #1152 #1203 etc

* #1174 small doc changes

* #1174 move GeomObject typedef to beginning of util.py

* #1174 added debug logging in transform Decorator func

---------

Co-authored-by: Mathieu Tachon <92298764+MTachon@users.noreply.github.com>
2023-04-11 09:34:48 -04:00
Ricardo Garcia Silva d594653150 Put plugin integration in a more prominent place in docs (#1208) 2023-04-11 08:59:10 -04:00
Tom Kralidis f92ca98765 various provider fixes (#1205)
* improve CRS detection for STAC item

* fix ES id ref
2023-04-06 18:20:59 +02:00