From 5fdba51ab6bd03b7577f20af4b37fffb6f76c094 Mon Sep 17 00:00:00 2001 From: Wouter Date: Tue, 23 Jan 2024 15:43:20 +0100 Subject: [PATCH 1/9] remove AOI when requesting a transformergroup --- src/coordinate_transformation_api/crs_transform.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/coordinate_transformation_api/crs_transform.py b/src/coordinate_transformation_api/crs_transform.py index 70b0abd..029208c 100644 --- a/src/coordinate_transformation_api/crs_transform.py +++ b/src/coordinate_transformation_api/crs_transform.py @@ -291,15 +291,9 @@ def get_transformer( if exclude_transformation(source_crs, target_crs): raise TransformationNotPossibleError(source_crs, target_crs) - # Area of interest spanning NL - # coord from EPSG.org Netherlands - onshore - aoi = transformer.AreaOfInterest(3.2, 50.75, 7.22, 53.7) - # Get available transformer through TransformerGroup # TODO check/validate if always_xy=True is correct - tfg = transformer.TransformerGroup( - s_crs, t_crs, allow_ballpark=False, area_of_interest=aoi - ) + tfg = transformer.TransformerGroup(s_crs, t_crs, allow_ballpark=False) # If everything is 'right' we should always have a transformer # based on our configured proj.db. Therefor this error. From 470f9460b477ac82c7ecc4911053a23184d52946 Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 11:51:49 +0100 Subject: [PATCH 2/9] update Dockerfile --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9108fc0..440dd43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.11.4-bullseye as builder -ARG NSGI_PROJ_DB_VERSION="1.0.2" +ARG NSGI_PROJ_DB_VERSION="1.0.3" LABEL maintainer="NSGI " @@ -25,6 +25,8 @@ WORKDIR /assets RUN curl -sL -o nl_nsgi_nlgeo2018.tif https://cdn.proj.org/nl_nsgi_nlgeo2018.tif && \ curl -sL -o nl_nsgi_rdcorr2018.tif https://cdn.proj.org/nl_nsgi_rdcorr2018.tif && \ curl -sL -o nl_nsgi_rdtrans2018.tif https://cdn.proj.org/nl_nsgi_rdtrans2018.tif && \ + curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="bq_nsgi_bongeo2004.tif").url') -o bq_nsgi_bongeo2004.tif \ + curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="nllat2018.gtx").url') -o nllat2018.gtx \ curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="proj.global.time.dependent.transformations.db").url') -o proj.db RUN ls -lah /src/dist/ >&2 @@ -38,6 +40,7 @@ COPY --from=builder /src/dist/coordinate_transformation_api-2*.whl . RUN pip install coordinate_transformation_api-2*.whl COPY --from=builder /assets/*.tif /usr/local/lib/python3.11/site-packages/pyproj/proj_dir/share/proj +COPY --from=builder /assets/*.gtx /usr/local/lib/python3.11/site-packages/pyproj/proj_dir/share/proj COPY --from=builder /assets/proj.db /usr/local/lib/python3.11/site-packages/pyproj/proj_dir/share/proj/proj.db # PORT for serving out API From b06c72dc55d7e3d20662d0ad793982d9148b07ae Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 12:58:41 +0100 Subject: [PATCH 3/9] fix error in Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 440dd43..a1203a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,8 @@ WORKDIR /assets RUN curl -sL -o nl_nsgi_nlgeo2018.tif https://cdn.proj.org/nl_nsgi_nlgeo2018.tif && \ curl -sL -o nl_nsgi_rdcorr2018.tif https://cdn.proj.org/nl_nsgi_rdcorr2018.tif && \ curl -sL -o nl_nsgi_rdtrans2018.tif https://cdn.proj.org/nl_nsgi_rdtrans2018.tif && \ - curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="bq_nsgi_bongeo2004.tif").url') -o bq_nsgi_bongeo2004.tif \ - curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="nllat2018.gtx").url') -o nllat2018.gtx \ + curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="bq_nsgi_bongeo2004.tif").url') -o bq_nsgi_bongeo2004.tif && \ + curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="nllat2018.gtx").url') -o nllat2018.gtx && \ curl -sL -H "Accept: application/octet-stream" $(curl -s "https://api.github.com/repos/GeodetischeInfrastructuur/transformations/releases/tags/${NSGI_PROJ_DB_VERSION}" | jq -r '.assets[] | select(.name=="proj.global.time.dependent.transformations.db").url') -o proj.db RUN ls -lah /src/dist/ >&2 From 05b6593624bb884d67600d146a101eeed8fe0336 Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 13:09:57 +0100 Subject: [PATCH 4/9] added BES transformation config --- .../assets/config.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/coordinate_transformation_api/assets/config.yaml b/src/coordinate_transformation_api/assets/config.yaml index 1224444..0dfa2a4 100644 --- a/src/coordinate_transformation_api/assets/config.yaml +++ b/src/coordinate_transformation_api/assets/config.yaml @@ -246,3 +246,60 @@ "OGC:CRS84h": exclude-transformations: [] uri: http://www.opengis.net/def/crs/OGC/0/CRS84h +"NSGI:DPnet_Bonaire": + exclude-transformations: + - "EPSG:7415" + - "EPSG:28992" + - "EPSG:4258" + - "EPSG:4937" + - "EPSG:4936" + - "EPSG:3035" + - "EPSG:3034" + - "EPSG:3043" + - "EPSG:3044" + - "EPSG:7931" + - "EPSG:9067" + - "EPSG:7930" + - "EPSG:7432" + - "EPSG:7423" + - "EPSG:9423" + - "EPSG:9289" + uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Bonaire +"NSGI:DPnet_Saba": + exclude-transformations: + - "EPSG:7415" + - "EPSG:28992" + - "EPSG:4258" + - "EPSG:4937" + - "EPSG:4936" + - "EPSG:3035" + - "EPSG:3034" + - "EPSG:3043" + - "EPSG:3044" + - "EPSG:7931" + - "EPSG:9067" + - "EPSG:7930" + - "EPSG:7432" + - "EPSG:7423" + - "EPSG:9423" + - "EPSG:9289" + uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Saba +"NSGI:DPnet_StEustatius": + exclude-transformations: + - "EPSG:7415" + - "EPSG:28992" + - "EPSG:4258" + - "EPSG:4937" + - "EPSG:4936" + - "EPSG:3035" + - "EPSG:3034" + - "EPSG:3043" + - "EPSG:3044" + - "EPSG:7931" + - "EPSG:9067" + - "EPSG:7930" + - "EPSG:7432" + - "EPSG:7423" + - "EPSG:9423" + - "EPSG:9289" + uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_StEustatius From a8d1422ee982f1f8d31868f6ff4660d5f3232ba6 Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 13:28:35 +0100 Subject: [PATCH 5/9] disabled ITRF2014 for Bonaire --- src/coordinate_transformation_api/assets/config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/coordinate_transformation_api/assets/config.yaml b/src/coordinate_transformation_api/assets/config.yaml index 0dfa2a4..89ce02a 100644 --- a/src/coordinate_transformation_api/assets/config.yaml +++ b/src/coordinate_transformation_api/assets/config.yaml @@ -264,6 +264,9 @@ - "EPSG:7423" - "EPSG:9423" - "EPSG:9289" + - "EPSG:9000" + - "EPSG:7912" + - "EPSG:7789" uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Bonaire "NSGI:DPnet_Saba": exclude-transformations: From 1c33aa950e2953331a504a0e2c41ce40090f8516 Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 13:47:30 +0100 Subject: [PATCH 6/9] added NSG:DPnet_KADpeil_Bonaire --- .../assets/config.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/coordinate_transformation_api/assets/config.yaml b/src/coordinate_transformation_api/assets/config.yaml index 89ce02a..972dee9 100644 --- a/src/coordinate_transformation_api/assets/config.yaml +++ b/src/coordinate_transformation_api/assets/config.yaml @@ -246,6 +246,28 @@ "OGC:CRS84h": exclude-transformations: [] uri: http://www.opengis.net/def/crs/OGC/0/CRS84h +"NSGI:DPnet_KADpeil_Bonaire": + exclude-transformations: + - "EPSG:7415" + - "EPSG:28992" + - "EPSG:4258" + - "EPSG:4937" + - "EPSG:4936" + - "EPSG:3035" + - "EPSG:3034" + - "EPSG:3043" + - "EPSG:3044" + - "EPSG:7931" + - "EPSG:9067" + - "EPSG:7930" + - "EPSG:7432" + - "EPSG:7423" + - "EPSG:9423" + - "EPSG:9289" + - "EPSG:9000" + - "EPSG:7912" + - "EPSG:7789" + uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Bonaire "NSGI:DPnet_Bonaire": exclude-transformations: - "EPSG:7415" From 2436f953e133a7aec97f0dca86dbbd456487251f Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 13:57:40 +0100 Subject: [PATCH 7/9] update DPnet_KADpeil_Bonaire uri --- src/coordinate_transformation_api/assets/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coordinate_transformation_api/assets/config.yaml b/src/coordinate_transformation_api/assets/config.yaml index 972dee9..15a2641 100644 --- a/src/coordinate_transformation_api/assets/config.yaml +++ b/src/coordinate_transformation_api/assets/config.yaml @@ -267,7 +267,7 @@ - "EPSG:9000" - "EPSG:7912" - "EPSG:7789" - uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Bonaire + uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_KADpeil_Bonaire "NSGI:DPnet_Bonaire": exclude-transformations: - "EPSG:7415" From 594ed48b9d61a1b681a80454599eb7c9bc332683 Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 16:35:17 +0100 Subject: [PATCH 8/9] config new names for BES transformations --- .../assets/config.yaml | 54 ++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/src/coordinate_transformation_api/assets/config.yaml b/src/coordinate_transformation_api/assets/config.yaml index 15a2641..59cb1b5 100644 --- a/src/coordinate_transformation_api/assets/config.yaml +++ b/src/coordinate_transformation_api/assets/config.yaml @@ -246,7 +246,7 @@ "OGC:CRS84h": exclude-transformations: [] uri: http://www.opengis.net/def/crs/OGC/0/CRS84h -"NSGI:DPnet_KADpeil_Bonaire": +"NSGI:Bonaire_DPnet_KADpeil": exclude-transformations: - "EPSG:7415" - "EPSG:28992" @@ -267,8 +267,8 @@ - "EPSG:9000" - "EPSG:7912" - "EPSG:7789" - uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_KADpeil_Bonaire -"NSGI:DPnet_Bonaire": + uri: http://www.nsgi.nl/def/crs/NSGI/0/Bonaire_DPnet_KADpeil +"NSGI:Bonaire_DPnet": exclude-transformations: - "EPSG:7415" - "EPSG:28992" @@ -289,8 +289,8 @@ - "EPSG:9000" - "EPSG:7912" - "EPSG:7789" - uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Bonaire -"NSGI:DPnet_Saba": + uri: http://www.nsgi.nl/def/crs/NSGI/0/Bonaire_DPnet +"NSGI:Saba_DPnet": exclude-transformations: - "EPSG:7415" - "EPSG:28992" @@ -308,8 +308,8 @@ - "EPSG:7423" - "EPSG:9423" - "EPSG:9289" - uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_Saba -"NSGI:DPnet_StEustatius": + uri: http://www.nsgi.nl/def/crs/NSGI/0/Saba_DPnet +"NSGI:Saba_DPnet_Height": exclude-transformations: - "EPSG:7415" - "EPSG:28992" @@ -327,4 +327,42 @@ - "EPSG:7423" - "EPSG:9423" - "EPSG:9289" - uri: http://www.nsgi.nl/def/crs/NSGI/0/DPnet_StEustatius + uri: http://www.nsgi.nl/def/crs/NSGI/0/Saba_DPnet_Height +"NSGI:St_Eustatius_DPnet": + exclude-transformations: + - "EPSG:7415" + - "EPSG:28992" + - "EPSG:4258" + - "EPSG:4937" + - "EPSG:4936" + - "EPSG:3035" + - "EPSG:3034" + - "EPSG:3043" + - "EPSG:3044" + - "EPSG:7931" + - "EPSG:9067" + - "EPSG:7930" + - "EPSG:7432" + - "EPSG:7423" + - "EPSG:9423" + - "EPSG:9289" + uri: http://www.nsgi.nl/def/crs/NSGI/0/St_Eustatius_DPnet +"NSGI:St_Eustatius_DPnet_Height": + exclude-transformations: + - "EPSG:7415" + - "EPSG:28992" + - "EPSG:4258" + - "EPSG:4937" + - "EPSG:4936" + - "EPSG:3035" + - "EPSG:3034" + - "EPSG:3043" + - "EPSG:3044" + - "EPSG:7931" + - "EPSG:9067" + - "EPSG:7930" + - "EPSG:7432" + - "EPSG:7423" + - "EPSG:9423" + - "EPSG:9289" + uri: http://www.nsgi.nl/def/crs/NSGI/0/St_Eustatius_DPnet_Height From a28984047547c384e6486429b617948cb9d62d60 Mon Sep 17 00:00:00 2001 From: Wouter Date: Wed, 24 Jan 2024 16:59:03 +0100 Subject: [PATCH 9/9] update API key text from NL -> EN --- src/coordinate_transformation_api/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coordinate_transformation_api/util.py b/src/coordinate_transformation_api/util.py index 785408b..a7654ec 100644 --- a/src/coordinate_transformation_api/util.py +++ b/src/coordinate_transformation_api/util.py @@ -270,7 +270,7 @@ def init_oas(crs_config) -> tuple[dict, str, str]: } security: dict = {"security": [{"APIKeyHeader": []}]} if app_settings.example_api_key is not None: - api_key_description = f"\n\nDemo API key is `{app_settings.example_api_key}` en is bedoeld voor exploratief gebruik van de API. " + api_key_description = f"\n\nThe Demo API key is `{app_settings.example_api_key}` and is intended for exploratory use of the API only. " oas["info"]["description"] = ( oas["info"]["description"] + api_key_description )