Commit Graph

628 Commits

Author SHA1 Message Date
Tom Kralidis 83ea3d3959 fix docs 2021-07-06 17:20:23 -04:00
Benjamin Webb 8f8d19c5f8 Sensorthings API Provider (#721)
* Create sensorthings.py

* Update plugin.py

* Add files via upload

* Update sensorthings.py

* Add files via upload

* Update sensorthings.py

* Update sensorthings.py

* Update sensorthings.py

* Update sensorthings.py

* Update sensorthings BRGM Endpoint

* Clean Examples

* Cleaned sensorthings config

* add bbox and datetime query params

Added optional intralinking between STA entities

* add pytest for sta provider

* add sta pytest to workflow

* improve versatility of intralink and uri

* Update Datastreams geometry provider

* Update iow.sta.pygeoapi.config.yml

* faster hits using sta $count

* fix flake8

* added sta provider for github actions

* type in main.yml

* Update main.yml

* Update main.yml

* rename tests/data/datastreams.json

* Update main.yml

* Update load_sta_data.py

* Update load_sta_data.py

* Update load_sta_data.py

* Update load_sta_data.py

* Update load_sta_data.py

* Fix sta pytest

* fix flake8

* Update docs

* Update test_sensorthings__provider.py

* Merge various fixes from sta-patch-1

* force sorting

* Move STA data to remote host

* Clarify use of the intralink field

* rename test_sensorthings_provider.py

* Add Readme.md and switch to docker-compose

* Sensorthings -> SensorThings
2021-07-06 17:04:45 -04:00
Tom Kralidis 89eff49ce0 add support for configuration schema and validation (#553) (#719)
* add support for configuration schema and validation (#553)

* rename types

* minor doc fix

* update i18n regexes

* make openapi click options required arguments
2021-07-06 17:01:05 -04:00
Tom Kralidis d6df7d4fef add ui parameter to OpenAPI def 2021-06-30 12:30:47 -04:00
Tom Kralidis 167281ee83 add support for OpenAPI rendering via ReDoc (#414) (#720)
* add support for OpenAPI rendering via ReDoc (#414)

* add support for OpenAPI rendering via ReDoc (#414)
2021-06-30 11:11:57 -04:00
Tom Kralidis 7ecac02693 add support for OpenAPI validation (#717) (#718)
* add support for OpenAPI validation (#717)

* update copyright years

* fix ES ref

* update CLI
2021-06-29 08:48:22 -04:00
Mikael Vaaltola 4ccb0e574d Fix SQLite provider for GPKG with multiple layers (#716)
Running SELECT AutoGPKGStart(); returns the number of layers in a GPKG
file.
Therefore, only 0 is an invalid value which should raise an error.
2021-06-22 19:44:37 -04:00
Kyle Onda 37b1e9553b add geometry representations for json-ld output format (#689)
* Update linked_data.py

* Update linked_data.py

Added schema:geoShape to geojsonld = false

* Update linked_data.py

* Update linked_data.py for rebasing

* Update linked_data.py

* Update configuration.rst

* Update linked_data.py for geosparql geometry

* Add files via upload

* Update test_api.py

* Update test_api.py

* Update linked_data.py logic

* Add pytest for more geometry types

* Update test_util.py

* rename geojson2geojsonld, separated geom2schemageo

* Add pytest for polygon and linestring

* Update expanation of uri_field

Co-authored-by: Benjamin Webb <40066515+webb-ben@users.noreply.github.com>
Co-authored-by: Benjamin Webb <bmwebb20@colby.edu>
2021-06-17 19:00:35 -04:00
Tom Kralidis 61e5ab68af Docker locale tz (#711)
* update locales and timezone

* tabs to spaces

* fix ref
2021-06-17 16:51:23 +02:00
Tom Kralidis 05c18e14ee STAC: lazy add datetime (#713) 2021-06-14 10:37:13 -04:00
Tom Kralidis 989dfb6d30 fix Coverage output and format exception MIME type (#712)
* fix Coverage output and format exception MIME type

* Minor tweaks, added test to assert that a text/html header (without 'f' query param) returns JSON for get_collection_coverage()

Co-authored-by: Sander Schaminee <sander.schaminee@geocat.net>
2021-06-10 19:47:21 -04:00
Tom Kralidis b914e13205 STAC: dynamically capture band tags (#710) 2021-06-09 17:13:19 -04:00
Tom Kralidis 1715509f39 add safeguard for formatting errors (#708) 2021-06-09 14:33:09 -04:00
Sander Schaminee 8f3e5c2ad7 Simplify API tests (#707) 2021-06-09 06:10:10 -04:00
Tom Kralidis 48efbdec53 various fixes (#706) 2021-06-09 06:09:32 -04:00
Sander Schaminee 023f24d26b Multilingual support (alternative) (#664)
* Created localization (l10n) module + tests. Added l10n support to API and plugins (wip).

* Big refactor:

* All routed API methods are now decorated by @pre_process (consistency) and no longer have a headers+format argument but a request argument (**kwargs also removed)
* The pre_process decorator turns an incoming Flask/Starlette request into a generic APIRequest instance
* The new APIRequest class extracts all relevant info (params, data, locale, etc.) from the request and exposes them as properties
* Removed a lot of boilerplate (i.e. format checking) and wrapped that into methods
* Updated server-specific API calls in each route method (pass entire request object, not headers and query params)

* Several improvements and fixes:

* Updated OpenAPI page with "l" query param
* Added example translations (metadata)
* Changed plugin signature: added explicit locale attribute (instead of **kwargs)
* Moved locale processing to get_plugin_locale() function in l10n module
* API should pass raw requested locale to plugins, locale should always be set
* Fixed API tests and added APIRequest tests
* Prepared utils.py for Jinja2 i18n extension
* Rebased on commit b40297a8 and fixed compatibility with #661 and #662

* Updated documentation for language support

* Rebased and fixed compatibility with PR #658:

* Fixed EDR provider signature (added locale)
* Fixed EDR API routes and query function (and improved parameter-name handling)
* Fixed EDR tests

* Translate entire config in render_j2_template for requested locale:

* Added new translate_dict function to l10n module (+ tests)
* Updated all render_j2_template calls with locale parameter
* Updated pygeoapi-test-config.yml with some language structs

* Minor improvements

* support both 'language' and 'languages' property in server config and provider definitions
* renamed and modified translate_dict() to more generic translate_struct() function (l10n module)
* remove Content-Language header from provider responses if provider has no language support and format is json(ld)
* updated tests

* Leave provider locale handling to API

* Moved code to determine locale from providers to API class (and remove for formatters and processes)
* Removed locale parameter from plugin __init__ signatures
* Removed locale parameter from load_plugin()
* Added **kwargs to provider implementations for get, query, get_metadata, get_coverage_domainset and get_coverage_rangetype method signatures
* Added language=<locale> to all API calls to provider get, query, get_metadata, get_coverage_domainset and get_coverage_rangetype methods

* Use 'lang' instead of 'l' as language query parameter

* Updated Open API
* Updated documentation
* Fixed tests

* Implemented requested PR changes:

* Added usage examples to the APIRequest docstring
* Removed language support from coverage functions
* Updated plugins.rst and language.rst to match new behavior
* Removed language struct from resource links in pygeoapi-config.yml
* Rebased on latest master (fixed test_api.py)

* Rebased and applied fixes:

* Data property in APIRequest now is an awaitable attribute (fixed for Starlette compatibility)
* Named references to 'l' parameter to 'lang'

* Final changes/improvements:

* Make sure that Content-Language is always set;
* Added more tests to ensure that the default language returned is the first configured language (if no language was requested by the user);
* Updated docs;
* Replaced re-occuring strings with constants in api.py;
* Fixed Flake8 checks.

* add missing async to starlette routes (#704)

Co-authored-by: Tom Kralidis <tomkralidis@gmail.com>
2021-06-08 18:46:35 -04:00
Tom Kralidis 4bc929ef87 add missing async to starlette routes (#704) 2021-06-05 15:49:36 +02:00
Tom Kralidis 46f84a4ed3 migrate to GitHub Actions (#616) (#703) 2021-06-01 17:15:30 -04:00
Tom Kralidis f2d064656f fix Flask blueprints (#702) 2021-05-31 18:30:30 -04:00
Tom Kralidis d92f8012d1 update OARec metadata models per spec changes (#701) 2021-05-31 18:27:53 -04:00
Jo 7a9a8b19bf - Updated attribution to reflect the change of background map (#700)
Co-authored-by: doublebyte1 <info@doublebyte.net>
2021-05-31 10:41:42 -04:00
Tom Kralidis f6a469a7f5 fix flake8 2021-05-28 11:16:47 -04:00
Tom Kralidis 357c184c71 fix flake8, add function documentation 2021-05-28 10:58:46 -04:00
Francesco Bartoli b478f4f4b6 Fix #695 with a monkey patch (#698)
Fix #695 with a monkey patch
2021-05-28 10:52:00 -04:00
Jo ba3bf1621f - changed default background map to OSM (#697)
Co-authored-by: doublebyte1 <info@doublebyte.net>
2021-05-27 17:43:46 -04:00
Jo c7ea56218d Added missing parameters on the openapi definition of the get an observations tile request (#694)
* - Added missing parameters on the openapi definition of get an observations tile request

* - changed default background map to osm

Co-authored-by: doublebyte1 <info@doublebyte.net>
2021-05-27 22:30:04 +02:00
Ben Coleman 6f8ba4709d Handle null geometries (#693)
If the geometry value is `null`, then a JSON serialization error occurs
because `None` by itself is not JSON serializable.
2021-05-27 13:42:05 -04:00
Tom Kralidis ac7098aab5 update OATiles conformance classes (#692) 2021-05-27 08:38:06 -04:00
Tom Kralidis 7e568f5838 fix 5 minute install (#686) (#691) 2021-05-24 21:49:11 -04:00
Tom Kralidis 2744a24e6a fix ESRI Shapefile STAC publishing (#561) (#681) 2021-05-18 06:46:36 -04:00
Tom Kralidis a4bf35d310 implement STAC 1.0.0-rc.2 improvements (#679) 2021-04-27 19:52:28 -04:00
Tom Kralidis 5f241ba484 fixes JSON and JSON-LD links in HTML base template (#680) 2021-04-27 19:48:39 -04:00
Kyle Onda 589df6370a Support for PIDs and (non-Geo)JSON-LD (#676)
* Update api.py for uri_field

* Update linked_data.py

Update to meet the needs of https://github.com/internetofwater/geoconnex.us/issues/93

* Add uri_field to base.py provider

* Update index.html

Push uri-like field to front of list in collections/items

* Update api.py

Allow html files to handle uri_field

* Add trailing / to schema context

* Add uri_field to collections index page

* Add uri_field to collections item html page

* Update api.py

* Update configuration.rst

* fixed spelling

* Update configuration.rst

* Update configuration.rst

* Update configuration.rst

* Update sqlite.py

* Update linked_data.py

* Update api.py

* Revert 'id' cast to string

* Update configuration.rst

* Update linked_data.py

* Update api.py

* Update linked_data.py

* Update configuration.rst for json boolean

Co-authored-by: Benjamin Webb <40066515+webb-ben@users.noreply.github.com>
2021-04-27 19:44:19 -04:00
Tom Kralidis 3b0cc014d4 tighten ES id query as match case (#678) 2021-04-22 06:55:24 -04:00
Tom Kralidis a196f40e8c fix Starlette POST handling (#673) (#674) 2021-04-08 08:24:14 -04:00
totycro f7800fb46b Allow specifying job_id via request parameter (#675)
This is somewhat unconventional with REST design and leaves it up to the
process implementation to deal with duplicates and invalid IDs, however
it can make sense in certain use cases.

An alternative design would be to encode the desired `job_id` in the url:
`POST /processes/<process_id>/jobs/<job_id>`
This would suggest full control over the `job_id` from the client side,
so I'd prefer to pass the id via POST data. This way we can treat it as
suggestion, or possibly as a template from which the server derives the
actual id.
2021-04-08 08:16:21 -04:00
Tom Kralidis 3f248a5c42 fix datetime window validation (#666) (#671) 2021-03-30 06:21:11 -04:00
Tom Kralidis 43b6165fa9 EDR: s/parameters/parameter-names/ (#667) 2021-03-26 09:58:46 -04:00
Angelos Tzotsos c55e1cf452 back to dev 2021-03-18 18:01:10 +02:00
Angelos Tzotsos 837847e85d update release version 2021-03-18 17:59:10 +02:00
Tom Kralidis b40297a864 handle datetime errors in config (#659) (#661) 2021-03-18 06:25:39 -04:00
Tom Kralidis e2e2b7d671 improve MIME type handling for raw payload responses (#662)
* improve MIME type handling for raw payload responses

* fix ref
2021-03-18 06:25:10 -04:00
Angelos Tzotsos 50fcfdf047 Back to dev 2021-03-16 18:40:48 +02:00
Angelos Tzotsos f978d0a1f6 update release version 2021-03-16 18:06:56 +02:00
Tom Kralidis 951a1fb486 implement OGC EDR API (#658)
* implement OGC EDR API
* add docs/tests
* fix tests
2021-03-15 17:37:40 +02:00
Tom Kralidis 2063c69872 add support for OpenAPI document as JSON (#657) 2021-03-12 16:47:01 -05:00
Tom Kralidis ee568f9952 handle ES URLs via HTTPS (#654) 2021-03-02 19:15:17 -05:00
Sander Schaminee 22a46ec5c8 Match new queryable model from commit e0003b06 (#652) 2021-02-27 07:24:37 -05:00
Tom Kralidis 2f99f19fb0 refactor exceptions (#650)
* refactor exceptions

* add test
2021-02-26 14:07:50 -05:00
Tom Kralidis 1804a9b493 fix ref 2021-02-25 22:26:25 +01:00