Skip to content

Commit

Permalink
update from main
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Dec 19, 2024
2 parents 1887633 + f978c3e commit 910c3c0
Show file tree
Hide file tree
Showing 40 changed files with 495 additions and 555 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ on:
workflow_dispatch:

env:
LATEST_PY_VERSION: '3.12'
LATEST_PY_VERSION: '3.13'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,21 @@ repos:
hooks:
- id: validate-pyproject

- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.238
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.11.2
hooks:
- id: mypy
language_version: python
Expand Down
9 changes: 6 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@

### titiler.core

* Add layer control to map viewer template (author @hrodmn, https://github.com/developmentseed/titiler/pull/1051)
* add layer control to map viewer template (author @hrodmn, https://github.com/developmentseed/titiler/pull/1051)
* improve query string handling in LowerCaseQueryStringMiddleware using urlencode (author @pratapvardhan, https://github.com/developmentseed/titiler/pull/1050)
* add `titiler.core.utils.bounds_to_geometry` and reduce code duplication in factories (author @PratapVardhan, https://github.com/developmentseed/titiler/pull/1047)
* simplify image format dtype validation in `render_image` (author @PratapVardhan, https://github.com/developmentseed/titiler/pull/1046)

### titiler.application

* update `/healthz` endpoint to return dependencies versions (titiler, rasterio, gdal, ...) (author @scottyhq, https://github.com/developmentseed/titiler/pull/1056)

* Simplify image format dtype validation in `render_image` (author @PratapVardhan, https://github.com/developmentseed/titiler/pull/1046)
* migrate `templates/index.html` to bootstrap5, remove unused css, reuse bs classes (author @PratapVardhan, https://github.com/developmentseed/titiler/pull/1048)

## 0.19.2 (2024-11-28)

### Misc

* drop python 3.8 and add python 3.13 support (author @pratapvardhan, https://github.com/developmentseed/titiler/pull/1058)

* Update package build backend from `pdm-pep517` to `pdm-backend` (https://backend.pdm-project.org/#migrate-from-pdm-pep517)

* Update namespace package from using `.` to `-` as separator to comply with PEP-625 (https://peps.python.org/pep-0625/)
Expand Down
86 changes: 36 additions & 50 deletions docs/src/examples/notebooks/Working_with_Algorithm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"metadata": {},
"outputs": [],
"source": [
"titiler_endpoint = \"https://titiler.xyz\" # Developmentseed Demo endpoint. Please be kind."
"titiler_endpoint = (\n",
" \"https://titiler.xyz\" # Developmentseed Demo endpoint. Please be kind.\n",
")"
]
},
{
Expand Down Expand Up @@ -70,9 +72,9 @@
"# Fetch dataset Metadata\n",
"r = httpx.get(\n",
" f\"{titiler_endpoint}/cog/info\",\n",
" params = {\n",
" params={\n",
" \"url\": url,\n",
" }\n",
" },\n",
").json()\n",
"\n",
"print(r)"
Expand All @@ -97,21 +99,19 @@
"source": [
"r = httpx.get(\n",
" f\"{titiler_endpoint}/cog/WebMercatorQuad/tilejson.json\",\n",
" params = {\n",
" params={\n",
" \"url\": url,\n",
" }\n",
" },\n",
").json()\n",
"\n",
"bounds = r[\"bounds\"]\n",
"m = Map(\n",
" location=((bounds[1] + bounds[3]) / 2,(bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"]\n",
" location=((bounds[1] + bounds[3]) / 2, (bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"],\n",
")\n",
"\n",
"TileLayer(\n",
" tiles=r[\"tiles\"][0],\n",
" opacity=1,\n",
" attr=\"Office fédéral de topographie swisstopo\"\n",
" tiles=r[\"tiles\"][0], opacity=1, attr=\"Office fédéral de topographie swisstopo\"\n",
").add_to(m)\n",
"m"
]
Expand All @@ -127,24 +127,22 @@
"source": [
"r = httpx.get(\n",
" f\"{titiler_endpoint}/cog/WebMercatorQuad/tilejson.json\",\n",
" params = {\n",
" params={\n",
" \"url\": url,\n",
" # rio-tiler cannot rescale automatically the data when using a colormap\n",
" \"rescale\": \"1615.812,2015.09448\",\n",
" \"colormap_name\": \"terrain\",\n",
" }\n",
" },\n",
").json()\n",
"\n",
"bounds = r[\"bounds\"]\n",
"m = Map(\n",
" location=((bounds[1] + bounds[3]) / 2,(bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"]\n",
" location=((bounds[1] + bounds[3]) / 2, (bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"],\n",
")\n",
"\n",
"aod_layer = TileLayer(\n",
" tiles=r[\"tiles\"][0],\n",
" opacity=1,\n",
" attr=\"Office fédéral de topographie swisstopo\"\n",
" tiles=r[\"tiles\"][0], opacity=1, attr=\"Office fédéral de topographie swisstopo\"\n",
")\n",
"aod_layer.add_to(m)\n",
"m"
Expand Down Expand Up @@ -200,26 +198,22 @@
"source": [
"r = httpx.get(\n",
" f\"{titiler_endpoint}/cog/WebMercatorQuad/tilejson.json\",\n",
" params = {\n",
" params={\n",
" \"url\": url,\n",
" \"algorithm\": \"hillshade\",\n",
" # Hillshade algorithm use a 3pixel buffer so we need\n",
" # to tell the tiler to apply a 3 pixel buffer around each tile\n",
" \"buffer\": 3,\n",
" }\n",
" },\n",
").json()\n",
"\n",
"bounds = r[\"bounds\"]\n",
"m = Map(\n",
" location=((bounds[1] + bounds[3]) / 2,(bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"]\n",
" location=((bounds[1] + bounds[3]) / 2, (bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"],\n",
")\n",
"\n",
"aod_layer = TileLayer(\n",
" tiles=r[\"tiles\"][0],\n",
" opacity=1,\n",
" attr=\"Yo!!\"\n",
")\n",
"aod_layer = TileLayer(tiles=r[\"tiles\"][0], opacity=1, attr=\"Yo!!\")\n",
"aod_layer.add_to(m)\n",
"m"
]
Expand All @@ -241,31 +235,27 @@
"source": [
"r = httpx.get(\n",
" f\"{titiler_endpoint}/cog/WebMercatorQuad/tilejson.json\",\n",
" params = {\n",
" params={\n",
" \"url\": url,\n",
" \"algorithm\": \"contours\",\n",
" \"algorithm_params\": json.dumps(\n",
" {\n",
" \"increment\": 20, # contour line every 20 meters\n",
" \"thickness\": 2, # 2m thickness\n",
" \"increment\": 20, # contour line every 20 meters\n",
" \"thickness\": 2, # 2m thickness\n",
" \"minz\": 1600,\n",
" \"maxz\": 2000\n",
" \"maxz\": 2000,\n",
" }\n",
" ),\n",
" }\n",
" },\n",
").json()\n",
"\n",
"bounds = r[\"bounds\"]\n",
"m = Map(\n",
" location=((bounds[1] + bounds[3]) / 2,(bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"]\n",
" location=((bounds[1] + bounds[3]) / 2, (bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"],\n",
")\n",
"\n",
"TileLayer(\n",
" tiles=r[\"tiles\"][0],\n",
" opacity=1,\n",
" attr=\"Yo!!\"\n",
").add_to(m)\n",
"TileLayer(tiles=r[\"tiles\"][0], opacity=1, attr=\"Yo!!\").add_to(m)\n",
"m"
]
},
Expand All @@ -278,31 +268,27 @@
"source": [
"r = httpx.get(\n",
" f\"{titiler_endpoint}/cog/WebMercatorQuad/tilejson.json\",\n",
" params = {\n",
" params={\n",
" \"url\": url,\n",
" \"algorithm\": \"contours\",\n",
" \"algorithm_params\": json.dumps(\n",
" {\n",
" \"increment\": 5, # contour line every 5 meters\n",
" \"thickness\": 1, # 1m thickness\n",
" \"increment\": 5, # contour line every 5 meters\n",
" \"thickness\": 1, # 1m thickness\n",
" \"minz\": 1600,\n",
" \"maxz\": 2000\n",
" \"maxz\": 2000,\n",
" }\n",
" ),\n",
" }\n",
" },\n",
").json()\n",
"\n",
"bounds = r[\"bounds\"]\n",
"m = Map(\n",
" location=((bounds[1] + bounds[3]) / 2,(bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"]\n",
" location=((bounds[1] + bounds[3]) / 2, (bounds[0] + bounds[2]) / 2),\n",
" zoom_start=r[\"minzoom\"],\n",
")\n",
"\n",
"TileLayer(\n",
" tiles=r[\"tiles\"][0],\n",
" opacity=1,\n",
" attr=\"Yo!!\"\n",
").add_to(m)\n",
"TileLayer(tiles=r[\"tiles\"][0], opacity=1, attr=\"Yo!!\").add_to(m)\n",
"m"
]
},
Expand Down
Loading

0 comments on commit 910c3c0

Please sign in to comment.