Skip to content

Commit

Permalink
Merge branch 'geopython:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal committed Jul 8, 2024
2 parents 54fb751 + 5e48308 commit ff476aa
Show file tree
Hide file tree
Showing 59 changed files with 1,324 additions and 15,333 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
mongodb-version: 4.4
- name: Install and run SensorThingsAPI
uses: cgs-earth/sensorthings-action@v0.0.2
uses: cgs-earth/sensorthings-action@v0.1.0
- name: Install sqlite and gpkg dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand Down Expand Up @@ -104,6 +104,7 @@ jobs:
python3 tests/load_mongo_data.py tests/data/ne_110m_populated_places_simple.geojson
gunzip < tests/data/hotosm_bdi_waterways.sql.gz | psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/dummy_data.sql
psql postgresql://postgres:${{ secrets.DatabasePassword || 'postgres' }}@localhost:5432/test -f tests/data/dummy_types_data.sql
docker ps
python3 tests/load_oracle_data.py
- name: run unit tests ⚙️
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
# =================================================================

FROM ubuntu:jammy-20240227
FROM ubuntu:jammy-20240627.1

LABEL maintainer="Just van den Broecke <justb4@gmail.com>"

Expand Down
2 changes: 1 addition & 1 deletion docker/default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ resources:
keywords:
- Portugal
- POI
- Point of Interrest
- Point of Interest
- Madeira
- Azores
- OSM
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ case ${entry_cmd} in
test)
for test_py in $(ls tests/test_*.py)
do
# Skip tests requireing backend server or libs installed
# Skip tests requiring backend server or libs installed
case ${test_py} in
tests/test_elasticsearch__provider.py)
;&
Expand Down
2 changes: 1 addition & 1 deletion docs/source/admin-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Access control
--------------

It should be made clear that authentication and authorization is beyond the responsibility of pygeoapi. This means that
if a pygeoapi user enables the Admin API, they must provide access control explicity via another service.
if a pygeoapi user enables the Admin API, they must provide access control explicitly via another service.

pygeoapi hot reloading in gunicorn
----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __getattr__(cls, name):
# built documents.
#
# The short X.Y version.
version = '0.17.dev0'
version = '0.18.dev0'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
4 changes: 2 additions & 2 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ The ``logging`` section provides directives for logging messages which are usefu
logging:
level: ERROR # the logging level (see https://docs.python.org/3/library/logging.html#logging-levels)
logfile: /path/to/pygeoapi.log # the full file path to the logfile
logformat: # example for miliseconds:'[%(asctime)s.%(msecs)03d] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s'
dateformat: # example for miliseconds:'%Y-%m-%dT%H:%M:%S'
logformat: # example for milliseconds:'[%(asctime)s.%(msecs)03d] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s'
dateformat: # example for milliseconds:'%Y-%m-%dT%H:%M:%S'
.. note::
If ``level`` is defined and ``logfile`` is undefined, logging messages are output to the server's ``stdout``.
Expand Down
18 changes: 18 additions & 0 deletions docs/source/data-publishing/ogcapi-coverages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,41 @@ Data access examples
--------------------

* list all collections

* http://localhost:5000/collections

* overview of dataset

* http://localhost:5000/collections/foo

* schema of dataset

* http://localhost:5000/collections/foo/schema

* coverage access via CoverageJSON (default)

* http://localhost:5000/collections/foo/coverage?f=json

* coverage access via native format (as defined in ``provider.format.name``)

* http://localhost:5000/collections/foo/coverage?f=GRIB

* coverage access with comma-separated properties

* http://localhost:5000/collections/foo/coverage?properties=1,3

* coverage access with subsetting

* http://localhost:5000/collections/foo/coverage?subset=lat(10:20)&subset=long(10:20)

* coverage with bbox

* http://localhost:5000/collections/foo/coverage?bbox=10,10,20,20

* coverage with bbox and bbox CRS

* http://localhost:5000/collections/foo/coverage?bbox=-8794239.772668611,5311971.846945471,-8348961.809495518,5621521.486192066&bbox=crs=3857


.. note::
``.../coverage`` queries which return an alternative representation to CoverageJSON (which prompt a download)
Expand Down
21 changes: 18 additions & 3 deletions docs/source/data-publishing/ogcapi-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ Mandatory properties
- example_group_id
On large tables it could be useful to disallow a query on the complete dataset. For this reason it is possible to
configure mandatory properties. When this is activated, the provoder throws an exception when the parameter
configure mandatory properties. When this is activated, the provider throws an exception when the parameter
is not in the query uri.

Extra properties
Expand All @@ -387,13 +387,28 @@ Extra properties
Extra properties is a list of strings which are added as fields for data retrieval in the SELECT clauses. They
can be used to return expressions computed by the database.

Session Pooling
""""""""""""""""

Configured using environment variables.

.. code-block:: bash
export ORACLE_POOL_MIN=2
export ORACLE_POOL_MAX=10
The ``ORACLE_POOL_MIN`` and ``ORACLE_POOL_MAX`` environment variables are used to trigger session pool creation in the Oracle Provider and the ``DatabaseConnection`` class. See https://python-oracledb.readthedocs.io/en/latest/api_manual/module.html#oracledb.create_pool for documentation of the ``create_pool`` function.

If none or only one of the environment variables is set, session pooling will not be activated and standalone connections are established at every request.


Custom SQL Manipulator Plugin
"""""""""""""""""""""""""""""
The provider supports a SQL-Manipulator-Plugin class. With this, the SQL statement could be manipulated. This is
useful e.g. for authorization at row level or manipulation of the explain plan with hints.

An example an more informations about that feature you can find in the test class in tests/test_oracle_provider.py.
An example an more information about that feature you can find in the test class in tests/test_oracle_provider.py.

.. _PostgreSQL:

Expand Down Expand Up @@ -488,7 +503,7 @@ SQLiteGPKG
^^^^^^^^^^

.. note::
Requries Spatialite installation
Requires Spatialite installation

SQLite file:

Expand Down
4 changes: 2 additions & 2 deletions docs/source/data-publishing/ogcapi-processes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fashion (inputs, outputs).
pygeoapi implements OGC API - Processes functionality by providing a plugin architecture, thereby
allowing developers to implement custom processing workflows in Python.

The pygeoapi offers two processes: a default ``hello-world`` process which allows you to quickly explore the capabilities of processes, and an optional ``shapely-functions`` process with more advanced features that leverages `Shapely_` to expose various geometric processing functionality.
The pygeoapi offers two processes: a default ``hello-world`` process which allows you to quickly explore the capabilities of processes, and an optional ``shapely-functions`` process with more advanced features that leverages `Shapely`_ to expose various geometric processing functionality.

Configuration
-------------
Expand Down Expand Up @@ -110,7 +110,7 @@ Hello World (Default)
# execute a job for the ``hello-world`` process in asynchronous mode
curl -X POST http://localhost:5000/processes/hello-world/execution \
-H "Content-Type: application/json" \
-H "Prefer: respond-async"
-H "Prefer: respond-async" \
-d "{\"inputs\":{\"name\": \"hi there2\"}}"
# execute a job for the ``hello-world`` process with a success subscriber
curl -X POST http://localhost:5000/processes/hello-world/execution \
Expand Down
22 changes: 22 additions & 0 deletions docs/source/data-publishing/ogcapi-records.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,49 @@ Metadata search examples
------------------------

* overview of record collection

* http://localhost:5000/collections/metadata-records

* queryables

* http://localhost:5000/collections/foo/queryables

* browse records

* http://localhost:5000/collections/foo/items

* paging

* http://localhost:5000/collections/foo/items?offset=10&limit=10

* CSV outputs

* http://localhost:5000/collections/foo/items?f=csv

* query records (spatial)

* http://localhost:5000/collections/foo/items?bbox=-180,-90,180,90

* query records (attribute)

* http://localhost:5000/collections/foo/items?propertyname=foo

* query records (temporal)

* http://localhost:5000/collections/my-metadata/items?datetime=2020-04-10T14:11:00Z

* query features (temporal) and sort ascending by a property (if no +/- indicated, + is assumed)

* http://localhost:5000/collections/my-metadata/items?datetime=2020-04-10T14:11:00Z&sortby=datetime

* query features (temporal) and sort descending by a property

* http://localhost:5000/collections/my-metadata/items?datetime=2020-04-10T14:11:00Z&sortby=-datetime

* fetch a specific record

* http://localhost:5000/collections/my-metadata/items/123


.. note::
provider `id_field` values support slashes (i.e. ``my/cool/identifier``). The client request would then
Expand Down
10 changes: 10 additions & 0 deletions docs/source/data-publishing/ogcapi-tiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,25 @@ Data access examples
--------------------

* list all collections

* http://localhost:5000/collections

* overview of dataset

* http://localhost:5000/collections/foo

* overview of dataset tiles

* http://localhost:5000/collections/foo/tiles

* tile matrix metadata

* http://localhost:5000/collections/lakes/tiles/WorldCRS84Quad/metadata

* tiles URI template

* `http://localhost:5000/collections/lakes/tiles/{tileMatrixSetId}/{tileMatrix}/{tileRow}/{tileCol}?f=mvt <http://localhost:5000/collections/lakes/tiles/{tileMatrixSetId}/{tileMatrix}/{tileRow}/{tileCol}?f=mvt>`_



.. _`OGC API - Tiles`: https://github.com/opengeospatial/ogcapi-tiles
Expand Down
3 changes: 2 additions & 1 deletion docs/source/data-publishing/stac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Connection examples
pygeometa metadata control files
--------------------------------

pygeoapi's STAC filesystem fuctionality supports `pygeometa`_ MCF files residing
pygeoapi's STAC filesystem functionality supports `pygeometa`_ MCF files residing
in the same directory as data files. If an MCF file is found, it will be used
as part of generating the STAC item metadata (e.g. a file named ``birds.csv``
having an associated ``birds.yml`` file). If no MCF file is found, then
Expand All @@ -66,6 +66,7 @@ Data access examples
--------------------

* STAC root page

* http://localhost:5000/stac

From here, browse the filesystem accordingly.
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ reference documentation on all aspects of the project.
data-publishing/index
transactions
admin-api
security
plugins
html-templating
crs
Expand Down
6 changes: 5 additions & 1 deletion docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ Features

* out of the box modern OGC API server
* certified OGC Compliant and Reference Implementation

* OGC API - Features
* OGC API - Environmental Data Retrieval
* OGC API - Tiles

* additionally implements

* OGC API - Coverages
* OGC API - Maps
* OGC API - Tiles
* OGC API - Processes
* OGC API - Records
* SpatioTemporal Asset Library

* out of the box data provider plugins for rasterio, GDAL/OGR, Elasticsearch, PostgreSQL/PostGIS
* easy to use OpenAPI / Swagger documentation for developers
* supports JSON, GeoJSON, HTML and CSV output
Expand Down
2 changes: 1 addition & 1 deletion docs/source/language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Translator guide
Hardcoded strings in pygeoapi templates are translated using the Babel translation system.

By default, pygeoapi stores translation files in the `locale` directory at the root of the
source code repository. This value can be overriden in the pygeoapi configuration with
source code repository. This value can be overridden in the pygeoapi configuration with
the `server.locale_dir` directive.

Translators can follow these steps to prepare their environment for translations.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ main Django application urls:
This integration can be seen in the provided example Django project. Refer to the `Django example in the pygeoapi-examples repository`_
for the integration of pygeoapi with an already exising Django application.
for the integration of pygeoapi with an already existing Django application.


.. note::
Expand Down
17 changes: 17 additions & 0 deletions docs/source/security.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _security:

Security
========

There exist use cases which require authentication and authorization against an API at various granularities
(collections, processes, etc.), restricting access to a given user, group or role. Implementing security
can be as simple as HTTP basic authentication, or as complex as fine-grained access control against a specific
collection item.

By design, pygeoapi does not have built-in support for access control. It is up to the user to secure pygeoapi
as required.

The following projects provide security frameworks atop pygeoapi:

* `fastgeoapi <https://github.com/geobeyond/fastgeoapi>`_
* `pygeoapi-auth <https://github.com/cartologic/pygeoapi-auth>`_
2 changes: 1 addition & 1 deletion docs/source/transactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Access control
^^^^^^^^^^^^^^

It should be made clear that authentication and authorization is beyond the responsibility of pygeoapi. This means that
if a pygeoapi user enables transactions, they must provide access control explicity via another service.
if a pygeoapi user enables transactions, they must provide access control explicitly via another service.

.. _`OGC API - Features - Part 4: Create, Replace, Update and Delete`: https://docs.ogc.org/DRAFTS/20-002.html
24 changes: 24 additions & 0 deletions locale/bs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,27 @@ msgstr ""

msgid "TileMatrixSet definition in JSON"
msgstr ""

msgid "Data collections in this service"
msgstr ""

msgid "Record collections in this service"
msgstr ""

msgid "Display Schema"
msgstr ""

msgid "Display Schema of"
msgstr ""

msgid "Contact"
msgstr ""

msgid "CRS"
msgstr ""

msgid "Epoch"
msgstr ""

msgid "not specified"
msgstr ""
Loading

0 comments on commit ff476aa

Please sign in to comment.