Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/source/crs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Metadata
The conformance class `http://www.opengis.net/spec/ogcapi-features-2/1.0/conf/crs` is present as a `conformsTo` field
in the root landing page response.

The configured CRSs, or their defaults, `crs` and `storageCRS` and optionally `storageCrsCoordinateEpoch` will be present in the "Describe Collection" response.
The configured CRSs, or their defaults, `crs` and `storageCrs` and optionally `storageCrsCoordinateEpoch` will be present in the "Describe Collection" response.

Parameters
----------
Expand Down Expand Up @@ -95,7 +95,7 @@ Suppose an addresses collection with the following CRS support in its collection
"http://www.opengis.net/def/crs/EPSG/0/28992",
"http://www.opengis.net/def/crs/OGC/1.3/CRS84"
],
"storageCRS": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
"storageCrs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"


This allows a `bbox-crs` query using Dutch "RD" coordinates with CRS `http://www.opengis.net/def/crs/EPSG/0/28992` to retrieve
Expand Down
6 changes: 3 additions & 3 deletions pygeoapi/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def _create_crs_transform_spec(

if not query_crs_uri:
if storage_crs_uri in DEFAULT_CRS_LIST:
# Could be that storageCRS is
# Could be that storageCrs is
# http://www.opengis.net/def/crs/OGC/1.3/CRS84h
query_crs_uri = storage_crs_uri
else:
Expand Down Expand Up @@ -714,7 +714,7 @@ def _set_content_crs_header(
# If empty use default CRS
storage_crs_uri = config.get('storage_crs', DEFAULT_STORAGE_CRS)
if storage_crs_uri in DEFAULT_CRS_LIST:
# Could be that storageCRS is one of the defaults like
# Could be that storageCrs is one of the defaults like
# http://www.opengis.net/def/crs/OGC/1.3/CRS84h
content_crs_uri = storage_crs_uri
else:
Expand Down Expand Up @@ -1136,7 +1136,7 @@ def describe_collections(api: API, request: APIRequest,
# OAPIF Part 2 - list supported CRSs and StorageCRS
if collection_data_type in ['edr', 'feature']:
collection['crs'] = get_supported_crs_list(collection_data, DEFAULT_CRS_LIST) # noqa
collection['storageCRS'] = collection_data.get('storage_crs', DEFAULT_STORAGE_CRS) # noqa
collection['storageCrs'] = collection_data.get('storage_crs', DEFAULT_STORAGE_CRS) # noqa
if 'storage_crs_coordinate_epoch' in collection_data:
collection['storageCrsCoordinateEpoch'] = collection_data.get('storage_crs_coordinate_epoch') # noqa

Expand Down
8 changes: 4 additions & 4 deletions pygeoapi/api/itemtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ def get_collection_items(
# bbox but no bbox-crs param: assume bbox is in default CRS
bbox_crs = DEFAULT_CRS

# Transform bbox to storageCRS
# when bbox-crs different from storageCRS.
# Transform bbox to storageCrs
# when bbox-crs different from storageCrs.
if len(bbox) > 0:
try:
# Get a pyproj CRS instance for the Collection's Storage CRS
Expand Down Expand Up @@ -1008,7 +1008,7 @@ def create_crs_transform_spec(

if not query_crs_uri:
if storage_crs_uri in DEFAULT_CRS_LIST:
# Could be that storageCRS is
# Could be that storageCrs is
# http://www.opengis.net/def/crs/OGC/1.3/CRS84h
query_crs_uri = storage_crs_uri
else:
Expand Down Expand Up @@ -1065,7 +1065,7 @@ def set_content_crs_header(
# If empty use default CRS
storage_crs_uri = config.get('storage_crs', DEFAULT_STORAGE_CRS)
if storage_crs_uri in DEFAULT_CRS_LIST:
# Could be that storageCRS is one of the defaults like
# Could be that storageCrs is one of the defaults like
# http://www.opengis.net/def/crs/OGC/1.3/CRS84h
content_crs_uri = storage_crs_uri
else:
Expand Down
6 changes: 3 additions & 3 deletions pygeoapi/templates/collections/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h3>{% trans %}Reference Systems{% endtrans %}</h3>
<h3>{% trans %}Storage CRS{% endtrans %}</h3>
<ul>
<li>
{% trans %}CRS{% endtrans %}: <a title="{{ data['storageCRS'] }}" href="{{ data['storageCRS'] }}"><span>{{ data['storageCRS'] }}</span></a>
{% trans %}CRS{% endtrans %}: <a title="{{ data['storageCrs'] }}" href="{{ data['storageCrs'] }}"><span>{{ data['storageCrs'] }}</span></a>
</li>
<li>
{% trans %}Epoch{% endtrans %}: <span>{{ data['storageCrsCoordinateEpoch'] or '_(not specified)' }}</span></a>
Expand All @@ -148,8 +148,8 @@ <h3>{% trans %}Storage CRS{% endtrans %}</h3>

{# if this collection has a map representation, add it to the map #}
{% for link in data['links'] %}
{% if link['rel'] == 'http://www.opengis.net/def/rel/ogc/1.0/map' and link['href'] %}
L.tileLayer.wms("{{ link['href'] }}", {"opacity": .7, "transparent": true, "crs": L.CRS.EPSG4326}).addTo(map);
{% if link['rel'] == 'http://www.opengis.net/def/rel/ogc/1.0/map' and link['href'] %}
L.tileLayer.wms("{{ link['href'] }}", {"opacity": .7, "transparent": true, "crs": L.CRS.EPSG4326}).addTo(map);
{% endif %}
{% endfor %}

Expand Down
8 changes: 4 additions & 4 deletions tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ def test_describe_collections(config, api_):
]
for crs in crs_set:
assert crs in collection['crs']
assert collection['storageCRS'] is not None
assert collection['storageCRS'] == 'http://www.opengis.net/def/crs/OGC/1.3/CRS84' # noqa
assert collection['storageCrs'] is not None
assert collection['storageCrs'] == 'http://www.opengis.net/def/crs/OGC/1.3/CRS84' # noqa
assert 'storageCrsCoordinateEpoch' not in collection

# French language request
Expand Down Expand Up @@ -652,8 +652,8 @@ def test_describe_collections(config, api_):
if crs in default_crs_list:
contains_default = True
assert contains_default
assert collection['storageCRS'] is not None
assert collection['storageCRS'] == 'http://www.opengis.net/def/crs/OGC/1.3/CRS84' # noqa
assert collection['storageCrs'] is not None
assert collection['storageCrs'] == 'http://www.opengis.net/def/crs/OGC/1.3/CRS84' # noqa
assert collection['storageCrsCoordinateEpoch'] == 2017.23


Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_itemtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def test_get_collection_items_crs(config, api_):
assert code == HTTPStatus.OK
assert rsp_headers['Content-Crs'] == f'<{crs}>'

# With CRS query parameter, using storageCRS
# With CRS query parameter, using storageCrs
req = mock_api_request({'crs': storage_crs})
rsp_headers, code, response = get_collection_items(
api_, req, 'norway_pop')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ogr_gpkg_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def config_gpkg_28992():
'http://www.opengis.net/def/crs/OGC/1.3/CRS84',
'http://www.opengis.net/def/crs/EPSG/0/28992'
],
'storageCRS': 'http://www.opengis.net/def/crs/EPSG/0/28992',
'storageCrs': 'http://www.opengis.net/def/crs/EPSG/0/28992',
'id_field': 'id',
'layer': 'OGRGeoJSON'
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ogr_wfs_provider_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def config_geosol_gs_WFS():
'http://www.opengis.net/def/crs/OGC/1.3/CRS84',
'http://www.opengis.net/def/crs/EPSG/0/32632'
],
'storageCRS': 'http://www.opengis.net/def/crs/EPSG/0/32632',
'storageCrs': 'http://www.opengis.net/def/crs/EPSG/0/32632',
'id_field': 'gml_id',
'layer': 'unesco:Unesco_point',
}
Expand Down