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

Merge from upstream 0.12.0 #7

Merged
merged 17 commits into from
Jul 31, 2023
Merged
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.11.7
current_version = 0.12.0
commit = True
tag = True
tag_name = {new_version}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
--exclude_source \
--overwrite \
titiler.mosaic.factory \
titiler.mosaic.resources.enums \
titiler.mosaic.errors

- name: Deploy docs
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
args: ["--fix"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.3.0
hooks:
- id: mypy
language_version: python
Expand Down
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Release Notes

## 0.12.0 (2023-07-17)

* use `Annotated` Type for Query/Path parameters
* replace variable `TileMatrixSetId` by `tileMatrixSetId`

### titiler.core

* update FastAPI dependency to `>=0.95.1`
* set `pydantic` dependency to `~=1.0`
* update `rio-tiler` dependency to `>=5.0,<6.0`
* update TMS endpoints to match OGC Tiles specification

### titiler.extensions

* use TiTiler's custom JSONResponse for the `/validate` endpoint to avoid issue when COG has `NaN` nodata value
* update `rio-cogeo` dependency to `>=4.0,<5.0`
* update `rio-stac` requirement to `>=0.8,<0.9` and add `geom-densify-pts` and `geom-precision` options

## titiler.mosaic

* update `cogeo-mosaic` dependency to `>=6.0,<7.0`
* remove `titiler.mosaic.resources.enum.PixelSelectionMethod` and use `rio_tiler.mosaic.methods.PixelSelectionMethod`
* allow more TileMatrixSet (than only `WebMercatorQuad`)

## 0.11.7 (2023-05-18)

### titiler.core
Expand Down
6 changes: 3 additions & 3 deletions deployment/aws/lambda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ RUN pip install \
# pin markupsafe so jinja will have access to soft_unicode
# https://github.com/aws/aws-sam-cli/issues/3661#issuecomment-1044340547
markupsafe==2.0.1 \
titiler.application==0.11.7 \
titiler.mosaic==0.11.7 \
titiler.core==0.11.7 \
titiler.application==0.12.0 \
titiler.mosaic==0.12.0 \
titiler.core==0.12.0 \
-t /var/task --no-binary pydantic
# original code also had --no-binary numpy, which takes 20-30 minutes to build

Expand Down
2 changes: 1 addition & 1 deletion deployment/aws/requirements-cdk.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ aws_cdk-aws_apigatewayv2_integrations_alpha==2.76.0a0
constructs>=10.0.0

# pydantic settings
pydantic
pydantic==1.10.11
python-dotenv
4 changes: 2 additions & 2 deletions deployment/k8s/charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
appVersion: 0.11.7
appVersion: 0.12.0
description: A dynamic Web Map tile server
name: titiler
version: 1.1.0
version: 1.1.2
icon: https://raw.githubusercontent.com/developmentseed/titiler/main/docs/logos/TiTiler_logo_small.png
maintainers:
- name: emmanuelmathot # Emmanuel Mathot
Expand Down
25 changes: 25 additions & 0 deletions deployment/k8s/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ spec:
labels:
{{- include "titiler.selectorLabels" . | nindent 8 }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
env:
{{- range $key, $val := .Values.env }}
- name: {{ $key }}
Expand Down Expand Up @@ -49,10 +53,31 @@ spec:
- mountPath: /config
name: config
readOnly: true
{{- range .Values.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
readOnly: {{ .readOnly }}
{{- if .mountPropagation }}
mountPropagation: {{ .mountPropagation }}
{{- end }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.env.terminationGracePeriodSeconds }}
volumes:
- name: config
configMap:
name: {{ include "titiler.fullname" . }}-configmap
{{- range .Values.extraHostPathMounts }}
- name: {{ .name }}
hostPath:
path: {{ .hostPath }}
type: Directory
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ .name }}
{{- end }}
{{- end }}
{{- with .Values.serviceAccountName }}
serviceAccountName: {{ . | quote }}
{{- end }}
Expand Down
11 changes: 11 additions & 0 deletions deployment/k8s/charts/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ ingress:
hosts:
- titiler.charter.uat.esaportal.eu

terminationGracePeriodSeconds: 30

extraHostPathMounts: []
# - name: map-sources
# mountPath: /map-sources/
# hostPath: /home/ubuntu/map-sources
# readOnly: false
# mountPropagation: HostToContainer # OPTIONAL

imagePullSecrets: []

env:
PORT: 80
CPL_TMPDIR: /tmp
Expand Down
25 changes: 25 additions & 0 deletions deployment/k8s/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ image:
nameOverride: ""
fullnameOverride: ""

terminationGracePeriodSeconds: 30

service:
type: ClusterIP
port: 80
Expand All @@ -26,6 +28,15 @@ ingress:
# hosts:
# - titiler.local

extraHostPathMounts: []
# - name: map-sources
# mountPath: /map-sources/
# hostPath: /home/ubuntu/map-sources
# readOnly: false
# mountPropagation: HostToContainer # OPTIONAL

imagePullSecrets: []

env:
PORT: 80
CPL_TMPDIR: /tmp
Expand Down Expand Up @@ -54,3 +65,17 @@ nodeSelector: {}
tolerations: []

affinity: {}

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# allowPrivilegeEscalation: false
# runAsNonRoot: true
# runAsUser: 1001

podSecurityContext: {}
# fsGroup: 1001
# runAsNonRoot: true
# runAsUser: 1001
1 change: 0 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ nav:
- viewer: api/titiler/extensions/viewer.md
- titiler.mosaic:
- factory: api/titiler/mosaic/factory.md
- enums: api/titiler/mosaic/resources/enums.md
- errors: api/titiler/mosaic/errors.md

- titiler.application:
Expand Down
7 changes: 4 additions & 3 deletions docs/src/advanced/Extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ See [titiler.application](../application) for a full example.
from dataclasses import dataclass, field
from typing import Tuple, List, Optional

import rasterio
from starlette.responses import Response
from fastapi import Depends, FastAPI, Query
from titiler.core.factory import BaseTilerFactory, FactoryExtension, TilerFactory
Expand Down Expand Up @@ -140,8 +141,8 @@ class thumbnailExtension(FactoryExtension):
env=Depends(factory.environment_dependency),
):
with rasterio.Env(**env):
with self.reader(src_path, **reader_params) as src_dst:
im = src.preview(
with factory.reader(src_path, **reader_params) as src:
image = src.preview(
max_size=self.max_size,
**layer_params,
**dataset_params,
Expand All @@ -160,7 +161,7 @@ class thumbnailExtension(FactoryExtension):

content = image.render(
img_format=format.driver,
colormap=colormap or dst_colormap,
colormap=colormap,
**format.profile,
**render_params,
)
Expand Down
32 changes: 16 additions & 16 deletions docs/src/advanced/tiler_factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ app.include_router(cog.router, tags=["Cloud Optimized GeoTIFF"])
| `GET` | `/info.geojson` | GeoJSON ([InfoGeoJSON][info_geojson_model]) | return dataset's basic info as a GeoJSON feature
| `GET` | `/statistics` | JSON ([Statistics][stats_model]) | return dataset's statistics
| `POST` | `/statistics` | GeoJSON ([Statistics][stats_geojson_model]) | return dataset's statistics for a GeoJSON
| `GET` | `/tiles[/{TileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `[/{TileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `[/{TileMatrixSetId}]/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/tiles[/{tileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `[/{tileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `[/{tileMatrixSetId}]/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][point_model]) | return pixel values from a dataset
| `GET` | `/preview[.{format}]` | image/bin | create a preview image from a dataset (**Optional**)
| `GET` | `/crop/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format}` | image/bin | create an image from part of a dataset (**Optional**)
| `POST` | `/crop[/{width}x{height}][.{format}]` | image/bin | create an image from a GeoJSON feature (**Optional**)
| `GET` | `/map` | HTML | return a simple map viewer
| `GET` | `[/{TileMatrixSetId}]/map` | HTML | return a simple map viewer
| `GET` | `[/{tileMatrixSetId}]/map` | HTML | return a simple map viewer

### `titiler.core.factory.MultiBaseTilerFactory`

Expand All @@ -54,14 +54,14 @@ app.include_router(cog.router, tags=["STAC"])
| `GET` | `/asset_statistics` | JSON ([Statistics][multistats_model]) | return per asset statistics
| `GET` | `/statistics` | JSON ([Statistics][stats_model]) | return assets statistics (merged)
| `POST` | `/statistics` | GeoJSON ([Statistics][multistats_geojson_model]) | return assets statistics for a GeoJSON (merged)
| `GET` | `/tiles[/{TileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from assets
| `GET` | `/[{TileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{TileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/tiles[/{tileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from assets
| `GET` | `/[{tileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][multipoint_model]) | return pixel values from assets
| `GET` | `/preview[.{format}]` | image/bin | create a preview image from assets (**Optional**)
| `GET` | `/crop/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format}` | image/bin | create an image from part of assets (**Optional**)
| `POST` | `/crop[/{width}x{height}][.{format}]` | image/bin | create an image from a geojson feature intersecting assets (**Optional**)
| `GET` | `[/{TileMatrixSetId}]/map` | HTML | return a simple map viewer
| `GET` | `[/{tileMatrixSetId}]/map` | HTML | return a simple map viewer

### `titiler.core.factory.MultiBandTilerFactory`

Expand Down Expand Up @@ -92,14 +92,14 @@ app.include_router(cog.router, tags=["Landsat"])
| `GET` | `/info.geojson` | GeoJSON ([InfoGeoJSON][info_geojson_model]) | return basic info for a dataset as a GeoJSON feature
| `GET` | `/statistics` | JSON ([Statistics][stats_model]) | return info and statistics for a dataset
| `POST` | `/statistics` | GeoJSON ([Statistics][stats_geojson_model]) | return info and statistics for a dataset
| `GET` | `/tiles[/{TileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `/[{TileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{TileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/tiles[/{tileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a dataset
| `GET` | `/[{tileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `/{tileMatrixSetId}/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][point_model]) | return pixel value from a dataset
| `GET` | `/preview[.{format}]` | image/bin | create a preview image from a dataset
| `GET` | `/crop/{minx},{miny},{maxx},{maxy}[/{width}x{height}].{format}` | image/bin | create an image from part of a dataset
| `POST` | `/crop[/{width}x{height}][.{format}]` | image/bin | create an image from a geojson feature
| `GET` | `[/{TileMatrixSetId}]/map` | HTML | return a simple map viewer
| `GET` | `[/{tileMatrixSetId}]/map` | HTML | return a simple map viewer

### `titiler.mosaic.factory.MosaicTilerFactory`

Expand All @@ -110,14 +110,14 @@ app.include_router(cog.router, tags=["Landsat"])
| `GET` | `/bounds` | JSON ([Bounds][bounds_model]) | return mosaic's bounds
| `GET` | `/info` | JSON ([Info][mosaic_info_model]) | return mosaic's basic info
| `GET` | `/info.geojson` | GeoJSON ([InfoGeoJSON][mosaic_geojson_info_model]) | return mosaic's basic info as a GeoJSON feature
| `GET` | `/tiles[/{TileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a MosaicJSON
| `GET` | `[/{TileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `[/{TileMatrixSetId}]/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/tiles[/{tileMatrixSetId}]/{z}/{x}/{y}[@{scale}x][.{format}]` | image/bin | create a web map tile image from a MosaicJSON
| `GET` | `[/{tileMatrixSetId}]/tilejson.json` | JSON ([TileJSON][tilejson_model]) | return a Mapbox TileJSON document
| `GET` | `[/{tileMatrixSetId}]/WMTSCapabilities.xml` | XML | return OGC WMTS Get Capabilities
| `GET` | `/point/{lon},{lat}` | JSON ([Point][mosaic_point]) | return pixel value from a MosaicJSON dataset
| `GET` | `/{z}/{x}/{y}/assets` | JSON | return list of assets intersecting a XYZ tile
| `GET` | `/{lon},{lat}/assets` | JSON | return list of assets intersecting a point
| `GET` | `/{minx},{miny},{maxx},{maxy}/assets` | JSON | return list of assets intersecting a bounding box
| `GET` | `[/{TileMatrixSetId}]/map` | HTML | return a simple map viewer
| `GET` | `[/{tileMatrixSetId}]/map` | HTML | return a simple map viewer


!!! Important
Expand Down
Loading