Commit Graph

999 Commits

Author SHA1 Message Date
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
Tom Kralidis 48b5b3b163 add HTTP OPTIONS handling to Django (#1203) 2023-04-04 09:49:22 +02:00
Sander Schaminee 41f3bd801a API design rule support (#1152)
* API design rule support (#1134):

- Change config model
- Change Flask, Starlette, and Django apps for API rule adherence
- Add Flask and Starlette mock clients to test API rule adherence
- Add get_base_url() util function to replace all config['server']['url'] refs
- Ensure that any internal links have URL prefixes if needed
- Add tests and update docs

* Prevent fcntl import error (breaks tests when running locally on Windows)

* Prefer trailing slash in landing page URL when strict_slashes=True (#1134)
2023-04-03 21:30:58 -04:00
Ricardo Garcia Silva c047582155 Generate openapi job endpoint definitions without checking for manager (#1202)
* Generate openapi job endpoint definitions without checking for manager

* Remove has_manager test
2023-04-03 20:30:58 -04:00
Mathieu Tachon 1a1d6362c1 fix(automap): fixes naming conflicts for PostgreSQLProvider (#1184)
* fix(automap): fix naming conflicts for PostgreSQLProvider

Automaping classes and relationships from database schema throws an error if a
column name is the same as a relationship name (see
https://docs-sqlalchemy.readthedocs.io/ko/latest/orm/extensions/automap.html#handling-simple-naming-conflicts).

* renaming function name_for_scalar_relationship -> _name_for_scalar_relationship

* test: test that PostgreSQL provider can handle naming conflicts

Re-use data file from https://github.com/geopython/pygeoapi/pull/1185, and make
to new and empty tables that create naming conflicts when queried.

* Change test function post_collection_items -> get_collection_items

* fix path to table
2023-03-31 13:05:31 +02:00
Tom Kralidis e8acad7120 add support for STAC Azure blob storage backend (#1196) 2023-03-30 16:49:16 -04:00
Benjamin Webb 0f7a8a122c Use sqlalchemy URL function (#1158)
- Use SQL Alchemy URL creation instead of passing a string to create_engine function
- Add Cloud SQL example to docs
2023-03-30 14:52:33 -04:00
Benjamin Webb 9debd89cd8 SensorThings API provider refactor (#1183)
* SensorThingsAPI Provider refactor

- Make code more readable
- Prevent empty SensorThings entity from erroring out pygeoapi

* Fix SensorThings Provider

* Only count on hits

* Fix ref

* Fix ref

- Speed up get_fields
- Simplify intralink process

* Cleanup STA examples

* Add docstrings to functions

* Small fixes

- Split out inner functions
- Add default @iot.id
- Add more debug statements

* Refactor STA paging

- Refactor STA paging
- Reorganize _geometry function
- Update logging
2023-03-30 07:45:12 -04:00
Alexander Pilz d9c377ef62 Feature/mongodb jobmanager (#1186)
* MongoDB Jobmanager

* Add MongoDB-Jobmanager

Example configuration included

* Requested Fixes

Fixes Issues mentioned in latest Review

* Flake8 fixes

Code is fixed on the basis of a flake8 report

* Update ogcapi-processes.rst

* Update ogcapi-processes.rst

* Flake8 fixes

Fixes of flake8 errors
2023-03-30 07:38:43 -04:00
Tom Kralidis 466a1df723 Merge pull request #1190 from tomkralidis/tinydb-updates 2023-03-28 03:41:53 -04:00
Tom Kralidis afc9409491 Merge pull request #4 from rouault/tinydb_fix_bbox_intersects 2023-03-28 03:35:14 -04:00
Even Rouault 13d9cf532f TinyDB provider: fix bbox_intersects() to work with all polygon geometries 2023-03-28 09:30:09 +02:00
Tom Kralidis 21ad9ea8a1 update TinyDBCatalogue based on OARec updates 2023-03-28 03:11:52 -04:00
Even Rouault 4689daab19 TinyDB provider: set [properties][extent][spatial][bbox] from geometry if not provided (#1188) 2023-03-27 12:24:48 -04:00
Even Rouault fcacf69c5b OGC API Features Part 4 fixes: create without id + options (#1187) 2023-03-25 01:32:50 -04:00
Francesco Bartoli 02d6349fd4 Fix returned properties for an item from postgres (#1182)
Fix returned properties for an item from postgres
2023-03-18 16:19:13 +01:00
Tom Kralidis fbf0f4c81a safeguard id detection (#1175) 2023-03-15 21:47:07 +01:00
Sander Schaminee 91051e5df0 Add enclosure link prefetcher and tests (#1169) (#1173) 2023-03-15 09:38:34 -04:00
Aontnio Cereicllo d3590f9047 Upgrading elastisearch.py lib in docker image (#1162)
* Upgrading elastisearch.py lib in docker image

* Unused compatibility mode
2023-03-14 13:18:10 -04:00
Benjamin Webb 4a18393662 Allow STA entity to be URL encoded (#1171) 2023-03-14 12:41:32 -04:00