Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDR CoverageJSON conformance fixes: time axis and demo data #1814

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5cf2ee3
clean axis y order
pzaborowski Aug 12, 2024
1b5432c
remove comments
pzaborowski Aug 12, 2024
3fc3b5f
fixed axis from data/bbox
pzaborowski Aug 12, 2024
2feee54
bbox read from already calculated metadata
pzaborowski Sep 18, 2024
d583d32
Merge branch 'upsorg' into edr_fixed_axis
pzaborowski Sep 19, 2024
f0c2dd0
fix
pzaborowski Sep 19, 2024
d3c6726
whitespaces
pzaborowski Sep 19, 2024
dfce634
Merge pull request #11 from pzaborowski/edr_fixed_axis
pzaborowski Sep 19, 2024
00ea4c4
EDR covjson time axis compliance with stadnard
pzaborowski Sep 19, 2024
bc7623e
coveragejson compliance
pzaborowski Sep 20, 2024
8531e40
Update coads_sst.nc
pzaborowski Sep 20, 2024
baf9c7c
Merge branch 'EDR-time-axis-values' into edr_fixed_axis
pzaborowski Sep 20, 2024
9c0be8b
formatting
pzaborowski Sep 20, 2024
57fb90f
Merge pull request #12 from pzaborowski/edr_fixed_axis
pzaborowski Sep 20, 2024
76fd130
Update Ubuntu Jammy docker base image to 20240911.1 (#1815)
kalxas Sep 21, 2024
52bec0f
docs: update compliance for OGC API - Processes (#1817)
tomkralidis Sep 21, 2024
6b91024
Zoom to first layer on EDR (#1819)
webb-ben Sep 26, 2024
83ef1ac
update release version
kalxas Sep 27, 2024
b3a7071
back to dev
kalxas Sep 27, 2024
474cb60
fix item queryables provider handling (#1820)
tomkralidis Sep 29, 2024
d240a82
Improvements for xarray provider (#1800)
barbuz Sep 30, 2024
e736fa3
Custom esri token service (#1813)
colin-geo Oct 1, 2024
179c90f
Fixes a memoryfile issue with rasterio. When using f=json, it doesn't…
Alex-NRCan Oct 3, 2024
3bdeefe
Properly support int variables of any width (#1829)
barbuz Oct 15, 2024
c38ad33
tests aligned with data, unneccesary time properties removed
pzaborowski Oct 23, 2024
368fc34
Merge branch 'upsorg'
pzaborowski Oct 23, 2024
1431963
Merge branch 'edr_fixed_axis'
pzaborowski Oct 23, 2024
e6436eb
Merge branch 'EDR-time-axis-values'
pzaborowski Oct 23, 2024
12f9c5d
time dimension as first and with label from configuration
pzaborowski Nov 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-20240627.1
FROM ubuntu:jammy-20240911.1

LABEL maintainer="Just van den Broecke <[email protected]>"

Expand Down
7 changes: 5 additions & 2 deletions docs/source/_templates/indexsidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
<a title="OGC Reference Implementation" href="https://www.ogc.org/resource/products/details/?pid=1663">
<img alt="OGC Reference Implementation" src="https://portal.ogc.org/public_ogc/compliance/badge.php?s=ogcapi-tiles-1%201.0.1&r=1&n=1)" width="164" height="44"/>
</a>
<a title="OGC Reference Implementation" href="https://www.ogc.org/resource/products/details/?pid=1826">
<img alt="OGC Reference Implementation" src="https://portal.ogc.org/public_ogc/compliance/badge.php?s=ogcapi-processes-1%201.0.1&n=1)" width="164" height="44"/>
</a>
<a title="OSGeo Project" href="https://www.osgeo.org/projects/pygeoapi">
<img style="background: white;" alt="OSGeo Project" src="https://raw.githubusercontent.com/OSGeo/osgeo/master/incubation/project/OSGeo_project.png" width="164" height="64"/>
</a>
<a title="FOSS4G Conference" href="https://2023.foss4g.org">
<img style="background: white;" alt="FOSS4G Conference" width="145" height="45" src="https://2023.foss4g.org/img/logo.png"/>
<a title="FOSS4G Conference" href="https://2024.foss4g.org">
<img style="background: white;" alt="FOSS4G Conference" width="145" height="45" src="https://2024.foss4g.org/_next/static/media/foss4g-belem-logo-vertical.30d8343b.svg"/>
</a>
</p>

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.18.dev0'
version = '0.19.dev0'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
24 changes: 23 additions & 1 deletion docs/source/data-publishing/ogcapi-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ To publish an ESRI `Feature Service`_ or `Map Service`_ specify the URL for the

* ``id_field`` will often be ``OBJECTID``, ``objectid``, or ``FID``.
* If the map or feature service is not shared publicly, the ``username`` and ``password`` fields can be set in the
configuration to authenticate into the service.
configuration to authenticate to the service.
* If the map or feature service is self-hosted and not shared publicly, the ``token_service`` and optional ``referer`` fields
can be set in the configuration to authenticate to the service.

To publish from an ArcGIS online hosted service:

.. code-block:: yaml

Expand All @@ -158,6 +162,24 @@ To publish an ESRI `Feature Service`_ or `Map Service`_ specify the URL for the
crs: 4326 # Optional crs (default is EPSG:4326)
username: username # Optional ArcGIS username
password: password # Optional ArcGIS password
token_service: https://your.server.com/arcgis/sharing/rest/generateToken # optional URL to your generateToken service
referer: https://your.server.com # optional referer, defaults to https://www.arcgis.com if not set

To publish from a self-hosted service that is not publicly accessible, the ``token_service`` field is required:

.. code-block:: yaml

providers:
- type: feature
name: ESRI
data: https://your.server.com/arcgis/rest/services/your-layer/MapServer/0
id_field: objectid
time_field: date_in_your_device_time_zone # Optional time field
crs: 4326 # Optional crs (default is EPSG:4326)
username: username # Optional ArcGIS username
password: password # Optional ArcGIS password
token_service: https://your.server.com/arcgis/sharing/rest/generateToken # Optional url to your generateToken service
referer: https://your.server.com # Optional referer, defaults to https://www.arcgis.com if not set

GeoJSON
^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Features
* OGC API - Features
* OGC API - Environmental Data Retrieval
* OGC API - Tiles
* OGC API - Processes

* additionally implements

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

Expand Down Expand Up @@ -52,7 +52,7 @@ Standards are at the core of pygeoapi. Below is the project's standards support
`OGC API - Coverages`_,Implementing
`OGC API - Maps`_,Implementing
`OGC API - Tiles`_,Reference Implementation
`OGC API - Processes`_,Implementing
`OGC API - Processes`_,Compliant
`OGC API - Records`_,Implementing
`OGC API - Environmental Data Retrieval`_,Reference Implementation
`SpatioTemporal Asset Catalog`_,Implementing
Expand Down
2 changes: 1 addition & 1 deletion pygeoapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#
# =================================================================

__version__ = '0.18.dev0'
__version__ = '0.19.dev0'

import click
try:
Expand Down
29 changes: 11 additions & 18 deletions pygeoapi/api/itemtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,22 @@ def get_collection_queryables(api: API, request: Union[APIRequest, Any],
HTTPStatus.NOT_FOUND, headers, request.format, 'NotFound', msg)

LOGGER.debug('Creating collection queryables')
try:
LOGGER.debug('Loading feature provider')
p = load_plugin('provider', get_provider_by_type(
api.config['resources'][dataset]['providers'], 'feature'))
except ProviderTypeError:

p = None
for pt in ['feature', 'coverage', 'record']:
try:
LOGGER.debug('Loading coverage provider')
LOGGER.debug(f'Loading {pt} provider')
p = load_plugin('provider', get_provider_by_type(
api.config['resources'][dataset]['providers'], 'coverage')) # noqa
api.config['resources'][dataset]['providers'], pt))
break
except ProviderTypeError:
LOGGER.debug('Loading record provider')
p = load_plugin('provider', get_provider_by_type(
api.config['resources'][dataset]['providers'], 'record'))
finally:
msg = 'queryables not available for this collection'
return api.get_exception(
HTTPStatus.BAD_REQUEST, headers, request.format,
'NoApplicableError', msg)
LOGGER.debug(f'Providing type {pt} not found')

except ProviderGenericError as err:
if p is None:
msg = 'queryables not available for this collection'
return api.get_exception(
err.http_status_code, headers, request.format,
err.ogc_exception_code, err.message)
HTTPStatus.BAD_REQUEST, headers, request.format,
'NoApplicableError', msg)

queryables = {
'type': 'object',
Expand Down
8 changes: 4 additions & 4 deletions pygeoapi/provider/esri.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def __init__(self, provider_def):
self.crs = provider_def.get('crs', '4326')
self.username = provider_def.get('username')
self.password = provider_def.get('password')
self.token_url = provider_def.get('token_service', ARCGIS_URL)
self.token_referer = provider_def.get('referer', GENERATE_TOKEN_URL)
self.token = None

self.session = Session()

self.login()
Expand Down Expand Up @@ -194,16 +195,15 @@ def login(self):
msg = 'Missing ESRI login information, not setting token'
LOGGER.debug(msg)
return

params = {
'f': 'pjson',
'username': self.username,
'password': self.password,
'referer': ARCGIS_URL
'referer': self.token_referer
}

LOGGER.debug('Logging in')
with self.session.post(GENERATE_TOKEN_URL, data=params) as r:
with self.session.post(self.token_url, data=params) as r:
self.token = r.json().get('token')
# https://enterprise.arcgis.com/en/server/latest/administer/windows/about-arcgis-tokens.htm
self.session.headers.update({
Expand Down
21 changes: 11 additions & 10 deletions pygeoapi/provider/rasterio_.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def get_fields(self):
dtype2 = dtype
if dtype.startswith('float'):
dtype2 = 'number'
elif dtype.startswith('int'):
dtype2 = 'integer'

self._fields[i2] = {
'title': name,
Expand Down Expand Up @@ -240,16 +242,15 @@ def query(self, properties=[], subsets={}, bbox=None, bbox_crs=4326,
out_meta['units'] = _data.units

LOGGER.debug('Serializing data in memory')
with MemoryFile() as memfile:
with memfile.open(**out_meta) as dest:
dest.write(out_image)

if format_ == 'json':
LOGGER.debug('Creating output in CoverageJSON')
out_meta['bands'] = args['indexes']
return self.gen_covjson(out_meta, out_image)

else: # return data in native format
if format_ == 'json':
LOGGER.debug('Creating output in CoverageJSON')
out_meta['bands'] = args['indexes']
return self.gen_covjson(out_meta, out_image)

else: # return data in native format
with MemoryFile() as memfile:
with memfile.open(**out_meta) as dest:
dest.write(out_image)
LOGGER.debug('Returning data in native format')
return memfile.read()

Expand Down
Loading
Loading