Skip to content

Commit

Permalink
update to pyproj 9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
arbakker committed Dec 3, 2024
1 parent 5023e70 commit 9854a5b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"program": "${file}",
"console": "integratedTerminal",
"args": [
"${workspaceFolder}/Z001_ETRS89andRDNAP.txt",
"${workspaceFolder}/validate_ETRS89andRDNAP.txt",
"${workspaceFolder}/output/validate-output.csv"
]
}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM osgeo/proj:9.4.1
FROM osgeo/proj:9.5.0
RUN apt-get -y update && \
apt-get install --no-install-recommends -y \
sqlite3 && \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ command.

```bash
mkdir -p output # required otherwise output folder is created owned with root
docker run -u "$(id -u):$(id -g)" --rm -v $(pwd)/output:/output -t geodetischeinfrastructuur/validate-transformations:latest python /app/validate.py /app/Z001_ETRS89andRDNAP.txt /output/validate-output.csv
docker run -u "$(id -u):$(id -g)" --rm -v $(pwd)/output:/output -t geodetischeinfrastructuur/validate-transformations:latest python /app/validate.py /app/validate_ETRS89andRDNAP.txt /output/validate-output.csv
```

Or by running the Python script directly.
Expand All @@ -114,7 +114,7 @@ cd validate/
uv sync # setuppython environment with uv
direnv allow # only on installation, every subsequent opening of the workspace will activate the uv managed env, see "direnv config" section in this readme
../configure-proj.sh $(python -c 'import pyproj;print(pyproj.datadir.get_data_dir());') ../sql ../grids/nl_nsgi # note configure-proj.sh can only be run once since the sql commands will fail if applied multiple times
python validate.py Z001_ETRS89andRDNAP.txt ../output/validate-output.csv
python validate.py validate_ETRS89andRDNAP.txt ../output/validate-output.csv
```

When the validation result is `OK` output (stdout) is:
Expand Down
9 changes: 7 additions & 2 deletions validate/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
ARG PYTHON_VERSION=3.12
# supply empty build-arg to use local image
# --build-arg TRANSFORMATION_IMAGE_SOURCE=""
ARG TRANSFORMATION_IMAGE_SOURCE=ghcr.io/

FROM ${TRANSFORMATION_IMAGE_SOURCE}geodetischeinfrastructuur/transformations:latest as transformations

FROM ghcr.io/astral-sh/uv:python${PYTHON_VERSION}-bookworm-slim

ARG PYTHON_VERSION
WORKDIR /app
COPY pyproject.toml uv.lock validate.py .python-version Z001_ETRS89andRDNAP.txt ./
COPY pyproject.toml uv.lock validate.py .python-version validate_ETRS89andRDNAP.txt ./
RUN uv sync

# COPY the transformation grids, the modified proj.db and all the other proj files, so we do not have to run configure-proj.sh
COPY --from=ghcr.io/geodetischeinfrastructuur/transformations:latest /usr/share/proj/ "/app/.venv/lib/python${PYTHON_VERSION}/site-packages/pyproj/proj_dir/share/proj"
COPY --from=transformations /usr/share/proj/ "/app/.venv/lib/python${PYTHON_VERSION}/site-packages/pyproj/proj_dir/share/proj"

ENV PATH="/app/.venv/bin:$PATH"
ENV PROJ_DATA="/app/.venv/lib/python${PYTHON_VERSION}/site-packages/pyproj/proj_dir/share/proj"
Loading

0 comments on commit 9854a5b

Please sign in to comment.