Skip to content

Commit

Permalink
format all files previously not formatted with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
arbakker committed Feb 2, 2024
1 parent 01ba637 commit ee7a238
Show file tree
Hide file tree
Showing 26 changed files with 2,951 additions and 2,879 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on:
${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ cython_debug/
#.idea/

.gitconfig
.vscode/settings.json
76 changes: 39 additions & 37 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: FastAPI",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"--reload",
"--port", "8000",
"coordinate_transformation_api.main:app",
"--log-config", "${workspaceFolder}/.vscode/debug-logging.yaml"
],
"env": {
"LOG_LEVEL": "DEBUG",
"DEBUG": "true",
"MAX_SIZE_REQUEST_BODY": "5000000",
"CORS_ALLOW_ORIGINS": "*",
"API_KEY_IN_OAS": "true",
"EXAMPLE_API_KEY": "FOOBAR"
},
"jinja": true,
"justMyCode": false
},
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": false
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: FastAPI",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"--reload",
"--port",
"8000",
"coordinate_transformation_api.main:app",
"--log-config",
"${workspaceFolder}/.vscode/debug-logging.yaml"
],
"env": {
"LOG_LEVEL": "DEBUG",
"DEBUG": "true",
"MAX_SIZE_REQUEST_BODY": "5000000",
"CORS_ALLOW_ORIGINS": "*",
"API_KEY_IN_OAS": "true",
"EXAMPLE_API_KEY": "FOOBAR"
},
"jinja": true,
"justMyCode": false
},
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": false
}
]
}
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ the Netherlands. Build on top of pyproj and FastAPI.

- API metadata, documentation and source code is in English
- Easily accessible, but correct
- Conforms (as much is possible) to the [OGC API
Common](https://ogcapi.ogc.org/common/) and the [NL API Design
rules](https://gitdocumentatie.logius.nl/publicatie/api/adr/)
- Conforms (as much is possible) to the
[OGC API Common](https://ogcapi.ogc.org/common/) and the
[NL API Design rules](https://gitdocumentatie.logius.nl/publicatie/api/adr/)

## pyproj

Expand All @@ -31,9 +31,9 @@ Variant 2:

1. <https://cdn.proj.org/nl_nsgi_rdtrans2018.tif>

These transformation grids need to be downloaded from the [PROJ.org Datumgrid
CDN](https://cdn.proj.org/) and put in the correct directory. This can be done
in a couple of ways.
These transformation grids need to be downloaded from the
[PROJ.org Datumgrid CDN](https://cdn.proj.org/) and put in the correct
directory. This can be done in a couple of ways.

1. Enable PROJ_NETWORK environment variable
1. Edit proj.ini file by setting `network = on`
Expand Down Expand Up @@ -91,7 +91,8 @@ echo 'extends: "spectral:oas"\n'> ruleset.yaml && spectral lint http://127.0.0.

### Install NSGI proj.db

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

Expand Down Expand Up @@ -165,21 +166,21 @@ cjio test_1.city.json crs_reproject 4937 save test_1_4937.city.json
flowchart
input([/transform endpoint]) ==> filetype{content-type<br>request body}
filetype==> | GeoJSON | dc_param{density-check parameter}
filetype==> | CityJSON | a4[add response header:<br>density-check-result: not-implemented]
filetype==> | CityJSON | a4[add response header:<br>density-check-result: not-implemented]
a4 --> tf
dc_param ==> |"`default: *true*`"|ms_param{max_segment param}
ms_param -.-> |max_segment_deviation param| bc[check if data within bbox]
bc --> |success| dc
bc --> |failure| output_error_bbox([HTTP 400 with bbox error])
ms_param ==> |"`max_segment_length param (default: *200*)`"| dc[density check]
dc_param -.-> |"`*false*`"| a5[add response header:<br>density-check-result: not-run]
dc_param -.-> |"`*false*`"| a5[add response header:<br>density-check-result: not-run]
a5 --> tf[transform]
dc --> |"not applicable: geometrytype is point" | a2[add response header:<br>density-check-result: not-applicable-geom-type]
dc --> |"success"| a3[add response header:<br>density-check-result: success]
dc --> |"failure"| a6[add response header:<br>density-check-result: failed]
dc --> |"failure"| a6[add response header:<br>density-check-result: failed]
a6 --> output_error([HTTP 400 with density check report])
a2 --> tf
a3 --> tf
Expand Down
46 changes: 23 additions & 23 deletions docs/KP-API-geospatial.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@

## Recommendation

| recommendation | applicable | description |
| --- | --- | --- |
| 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. |
| recommendation | applicable | description |
| ------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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

| rule | applicable | description |
| --- | --- | --- |
| /geo/bbox-query-parameter | :grey_exclamation: | nonapplicable |
| /geo/geometric-context | :grey_exclamation: | nonapplicable |
| /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 | :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 | :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 |
| rule | applicable | description |
| ------------------------------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| /geo/bbox-query-parameter | :grey_exclamation: | nonapplicable |
| /geo/geometric-context | :grey_exclamation: | nonapplicable |
| /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 | :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 | :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 |
Loading

0 comments on commit ee7a238

Please sign in to comment.