Skip to content

Commit

Permalink
conformance /geo/crs-list (#89)
Browse files Browse the repository at this point in the history
* conformance /geo/crs-list

* crs list[str] -> str

* updated /geo/crs-list
  • Loading branch information
WouterVisscher authored Jan 4, 2024
1 parent 4db2a11 commit 527b0eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ python3 -m coverage run --source=src/coordinate_transformation_api -m pytest -v

Execute the following shell one-liner to install the NSGI `proj.db` from the [GeodetischeInfrastructuur/transformations](https://github.com/GeodetischeInfrastructuur/transformations/releases) repo:


```sh
proj_data_dir=$(python3 -c 'import pyproj;print(pyproj.datadir.get_data_dir());')
curl -sL -o "${proj_data_dir}/nl_nsgi_nlgeo2018.tif" https://cdn.proj.org/nl_nsgi_nlgeo2018.tif && \
Expand Down
10 changes: 5 additions & 5 deletions docs/KP-API-geospatial.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

| recommendation | applicable | description |
| --- | --- | --- |
| JSON-based encoding | :heavy_check_mark: | |
| consider text/html | :heavy_check_mark: | |
| JSON-based encoding | :heavy_check_mark: | the API returns default it's resources back in `Content-Type: application/json` |
| consider text/html | :grey_exclamation:/:heavy_check_mark: | Given the nature of the API this is not 'always' feasible. But the OAS spec is. |
| GeoJSON | :heavy_check_mark: | Limitations regarding GeoJSON are described in this document, but these are not applicable to our API. Because we do not generate new objects or features, we only transform the geometry of a given feature. |

## Rules
Expand All @@ -16,17 +16,17 @@
| --- | --- | --- |
| /geo/bbox-query-parameter | :grey_exclamation: | nonapplicable |
| /geo/geometric-context | :grey_exclamation: | nonapplicable |
| /geo/geojson-request | :grey_exclamation: | GeoJSON response have the header `application/json` instead of `application/geo+json` because GeoJSON is only WGS84 and we transform our GeoJSON to other CRS | |
| /geo/geojson-request | :grey_exclamation:/:heavy_check_mark: | GeoJSON response have the header `application/json` instead of `application/geo+json` because GeoJSON is only WGS84 and we transform our GeoJSON to other CRS | |
| /geo/embed-geojson-geometry-request | :grey_exclamation: | nonapplicable |
| /geo/geojson-response | :grey_exclamation: | nonapplicable |
| /geo/embed-geojson-geometry-response | :grey_exclamation: | nonapplicable |
| /geo/crs-list | :x: | **Needs to be implemented** |
| /geo/crs-list | :heavy_check_mark:/:grey_exclamation: | implemented, with the modification that a URI is return instead of a array of URI's, better suited for our use-case|
| /geo/storage-crs | :grey_exclamation: | nonapplicable, we don't store data |
| /geo/default-crs | :grey_exclamation: | nonapplicable, the service is build around RDNAPTRANS(r), so the default is EPSG:7415 not CRS84 |
| /geo/preferred-crs | :heavy_check_mark: | We return data in RD and ETRS89 |
| /geo/ensemble-member-crs | :grey_exclamation: | nonapplicable |
| /geo/bbox-crs-query-parameter | :grey_exclamation: | nonapplicable |
| /geo/filter-crs-query-parameter | :grey_exclamation: | nonapplicable |
| /geo/content-crs-request-header | :x: | Content CRS is now negotiated through query parameters and the feature it self. Adding a third option would bloat the API. |
| /geo/content-crs-request-header | :heavy_check_mark: | Content CRS is negotiated through the feature it self, query parameters and a content-crs header. |
| /geo/crs-query-paramete | :x: | We don't use the CRS query parameter because we need 2 CRS for our API. Using a named one like source-crs and target-crs makes it clear what the purpose is |
| /geo/content-crs-response-header | :grey_exclamation: | nonapplicable, response crs is know through the requested target-crs |
2 changes: 2 additions & 0 deletions src/coordinate_transformation_api/assets/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,8 @@ components:
- axes
title: CRS
example:
crs:
- "https://www.opengis.net/def/crs/EPSG/0/28992"
name: Amersfoort / RD New
type_name: Projected CRS
crs_auth_identifier: EPSG:28992
Expand Down
2 changes: 2 additions & 0 deletions src/coordinate_transformation_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class Axis(BaseModel):


class Crs(BaseModel):
crs: str
name: str
type_name: str
crs_auth_identifier: str
Expand All @@ -139,6 +140,7 @@ def from_crs_str(cls, crs_st: str) -> "Crs": # noqa: ANN102
for a in crs.axis_info
]
return cls(
crs=f"https://www.opengis.net/def/crs/{auth}/0/{identifier}",
name=crs.name,
type_name=crs.type_name,
crs_auth_identifier=crs.srs,
Expand Down

0 comments on commit 527b0eb

Please sign in to comment.