Commit Graph

906 Commits

Author SHA1 Message Date
Just van den Broecke c436baf739 #1110 try fix hanging Docker build GH Workflow - downgrade GH build env 2023-01-20 14:30:24 +01:00
Just van den Broecke 79688e9917 #1110 try fix hanging Docker build GH Workflow - split RUNs 2023-01-20 11:35:39 +01:00
Just van den Broecke 0e22b4fea5 #1110 - disable build for test and upgrade action versions (#1112) 2023-01-19 09:42:47 -05:00
Tom Kralidis 7cde469bd9 fix string formatting in item HTML template (#1107) (#1109) 2023-01-19 08:26:49 +01:00
Massimo Di Stefano 2d4d8e6646 docker: upgrade ubuntu version (#1093)
* docker: upgrade ubuntu version

Upgrade rhe ubuntu version used in the main Dockerfile to latest stable version `20.04`

* Update Dockerfile

amended ubuntu version 20 -> 22

but then the following error:

```
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
gpg: error running '/usr/bin/gpg-agent': probably not installed
gpg: failed to start agent '/usr/bin/gpg-agent': Configuration error
gpg: can't connect to the agent: Configuration error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 423, in add_key
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'deb https://ppa.launchpadcontent.net/ubuntugis/ubuntugis-unstable/ubuntu/ jammy main'
Description:
Unstable releases of Ubuntu GIS packages. These releases are more bleeding edge and while generally they should work well, they dont receive the same amount of quality assurance as our stable releases do.
More info: https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable
Adding repository.
Adding deb entry to /etc/apt/sources.list.d/ubuntugis-ubuntu-ubuntugis-unstable-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/ubuntugis-ubuntu-ubuntugis-unstable-jammy.list
Adding key to /etc/apt/trusted.gpg.d/ubuntugis-ubuntu-ubuntugis-unstable.gpg with fingerprint 6B827C12C2D425E227EDCA75089EBE08314DF160
    subprocess.run(cmd.split(), check=True, input=keys)
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['gpg', '-q', '--no-options', '--no-default-keyring', '--batch', '--keyring', '/etc/apt/trusted.gpg.d/ubuntugis-ubuntu-ubuntugis-unstable.gpg', '--homedir', '/tmp/tmpjlr98185', '--import']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 364, in <module>
    sys.exit(0 if addaptrepo.main() else 1)
  File "/usr/bin/add-apt-repository", line 357, in main
    shortcut.add()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 222, in add
    self.add_key()
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 425, in add_key
    raise ShortcutException(e)
softwareproperties.shortcuthandler.ShortcutException: Command '['gpg', '-q', '--no-options', '--no-default-keyring', '--batch', '--keyring', '/etc/apt/trusted.gpg.d/ubuntugis-ubuntu-ubuntugis-unstable.gpg', '--homedir', '/tmp/tmpjlr98185', '--import']' returned non-zero exit status 2.
````

Removing the ubuntugis PPA  build without error - is ubuntugis a requirements? probably Jammy has up-to-date packages for pygeoapi dependencies

* Update Dockerfile

removing ubuntugis PPA

* Update Dockerfile

adding  `python3-pytest` and `python3-pyld`  dependencies

* Update Dockerfile

* Update Dockerfile

* fixing docker environment with suggested changes

* replace ubuntu version with codename

* Update .dockerignore

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update entrypoint.sh

skip the SensorThings and other tests that require a local server

Co-authored-by: Just van den Broecke <just@justobjects.nl>
2023-01-18 15:04:36 +01:00
Benjamin Webb a1a70a4139 Return empty field set (#1106)
- Return empty field set instead of throwing an error.
- Update license year
2023-01-17 23:14:28 -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
Tom Kralidis 3bc40624b7 add warning when flask_cors is not enabled (#1083) (#1097)
* add warning when flask_cors is not enabled (#1083)

* fix
2023-01-12 12:10:12 -05:00
Angelos Tzotsos 126da2cc41 Reverting SensorThings test fix 2023-01-12 18:22:49 +02:00
Tom Kralidis 808fe82edf add OAMaps datetime to OpenAPI (#1095) (#1096) 2023-01-12 18:11:23 +02:00
Kevin Ngai daca503b43 Fix calls of render_j2_template() to pass in request.locale as the param (not SYSTEM_LOCALE) in order to apply proper translations for /jobs/**/*.html pages and /collection/tiles/index.html templates (#1094)
Co-authored-by: Kevin Ngai <afswken@geomet-dev-03.cmc.ec.gc.ca>
2023-01-12 08:05:14 +01:00
Angelos Tzotsos 2e1f181461 Fix spatialite version 2023-01-10 12:35:10 +02:00
Angelos Tzotsos 9c9111b096 Updating SensorThing test 2023-01-10 12:35:10 +02:00
Angelos Tzotsos 511f0ef09f Update debian control file 2023-01-07 15:19:43 +02:00
Tom Kralidis 30e1adeb79 Happy New Year! 🥳 2023-01-01 12:57:56 -05:00
Tom Kralidis 82c432794e various updates (#1082) 2022-12-27 07:26:21 -05:00
Francesco Bartoli 59dae2be8e Add normal function to generate openapi document (#1080) 2022-12-27 07:04:43 -05:00
Francesco Bartoli c209022a46 Add provider properties configuration (#1079) 2022-12-27 07:03:54 -05:00
Nick Forbes-Smith be5da13016 Fix workflow_dispatch event for Publish Docker image workflow (#1077) 2022-12-23 11:14:48 -05:00
Krishna Lodha 9202bce5c1 Fixed issue #1075 (#1076)
* added requests in requirements.txt

* added requests in requirements.txt
2022-12-22 09:11:33 -05:00
Nick Forbes-Smith 694fa7a942 Fix f-string for OGR provider query bbox (#1069) 2022-12-14 14:07:21 -05:00
Angelos Tzotsos 74509452f9 Stay with Shapely 1.x for a while (#1072) 2022-12-14 14:04:02 -05:00
Francesco Frassinelli 819ec3fd82 Show actual default value for limit (#1071) 2022-12-14 10:55:09 -05: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
Francesco Bartoli 7564d7b398 Fixing various problems with the starlette interface (#1067)
* Fix uvicorn start with reload

* Handle uvicorn log level from cli

* Fix starlette tiles routing

* Fix vector tiles rendering
2022-12-09 10:08:57 -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
Francesco Frassinelli 64e63ac4c0 Fix typo in plugins.rst example (#1063) 2022-12-07 16:51:44 -05:00
Aontnio Cereicllo 0be1ce54af Updates to Tileset Metadata endpoint (#1051)
* Adding metadata to matrix endpoint

* Adding Tileset metadata with mandatory fields

* Making metadata.json not mandatory, except when it is

* Adding pydantic models

Using models in place of json text

* Adding metadata to matrix endpoint

* Adding Tileset metadata with mandatory fields

* Making metadata.json not mandatory, except when it is

* Adding pydantic models

Using models in place of json text

* Fix tilesets template

Co-authored-by: Francesco Bartoli <francesco.bartoli@geobeyond.it>
2022-12-05 11:33:07 +01:00
Jo 111cfa5a98 - update docs with example of configuration for rendering pg_tileserv vector tiles (#1058) 2022-12-04 07:06:22 -05:00
Jo c2fe864a34 - removing deadcode (#1057) 2022-12-04 06:46:01 -05:00
Tom Kralidis c3b0e7868e minor updates to #1040 (#1054)
* minor updates to #1040
* s/crs/bbox-crs
* write status to stdout if --output-file is used
2022-12-02 09:58:45 +02:00
Tom Kralidis ccb94e132d Update introduction.rst 2022-12-01 09:16:45 -05:00
Jo 85a4984bbe Add Support for a generic url template, for publishing vector tiles as OGC API Tiles (#1050)
* - Added support to read from a generic url template as vector tile backend.

* - Add support for not rendering the tileset metadata

* - added support for z/y/x vector tile layers

* - fixed formatting issues

* - refactored code to use get_layer function, everywhere we need to parse username
- added a couple of debug statements, to make sure we are getting the layer name
correctly
- added an error for url templates that follow a schema, which is not supported yet

* - Added documentation for tiles provider, to show how to read a generic url

* - fixed formatting issues

* - added example of ES vector tiles in the docker-config of elasticsearch

Co-authored-by: doublebyte1 <info@doublebyte.net>
2022-12-01 08:34:16 -05:00
Tom Kralidis 1aa80368f7 fix temporal handling 2022-12-01 14:39:54 +02:00
Tom Kralidis 3ebaaaa27b remove sizing 2022-12-01 14:39:54 +02:00
Tom Kralidis 7fb420c142 add OAMaps django support (#668) 2022-12-01 14:39:54 +02:00
Tom Kralidis 608fba5664 add support for OAMaps 🗺️ (#668) 2022-12-01 11:55:46 +02:00
Tom Kralidis 1aa9630c5f add pygeoif and pygeofilter to debian requirements (#1045) 2022-11-29 11:02:50 -05:00
Tom Kralidis af72c79267 add requirements note for providers (#1040) (#1041) 2022-11-23 08:03:44 -05:00
Tom Kralidis fdf19c5f29 move numpy based tests to xarray/zarr provider (#1042) 2022-11-20 19:31:20 -05:00
Alex ba15a8a4fe Fixes a "TypeError: argument of type 'NoneType' is not iterable" when self.options is None (#1037) 2022-11-20 19:19:33 -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
Tom Kralidis 2c380375ec Update README.md 2022-11-15 09:20:06 -05:00
Angelos Tzotsos 09f2eff771 back to dev 2022-11-15 16:08:53 +02:00
Angelos Tzotsos 5e7015c2c7 update release version 2022-11-15 15:38:29 +02:00
Tom Kralidis 5ed6fb3170 add OGC RI for EDR (#1036) 2022-11-10 14:43:39 -05:00
Tom Kralidis db8fae61eb minor fixes following #964 (#1030) 2022-10-29 02:41:45 -04: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