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

BES #108

Merged
merged 9 commits into from
Jan 24, 2024
Merged

BES #108

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
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

Expand All @@ -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
Expand All @@ -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
Expand Down
120 changes: 120 additions & 0 deletions src/coordinate_transformation_api/assets/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,123 @@
"OGC:CRS84h":
exclude-transformations: []
uri: http://www.opengis.net/def/crs/OGC/0/CRS84h
"NSGI:Bonaire_DPnet_KADpeil":
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/Bonaire_DPnet_KADpeil
"NSGI:Bonaire_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"
- "EPSG:9000"
- "EPSG:7912"
- "EPSG:7789"
uri: http://www.nsgi.nl/def/crs/NSGI/0/Bonaire_DPnet
"NSGI:Saba_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/Saba_DPnet
"NSGI:Saba_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/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
8 changes: 1 addition & 7 deletions src/coordinate_transformation_api/crs_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/coordinate_transformation_api/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Loading