33from typing import Annotated , Optional
44from urllib .parse import quote_plus , urljoin
55
6- import jinja2
76import fastapi
7+ import jinja2
88import pystac
9- from pydantic import Field
10- from fastapi import Body , Depends , Query , Request , Response , Path
9+ from fastapi import Body , Depends , Path , Query , Request , Response
1110from fastapi .templating import Jinja2Templates
1211from geojson_pydantic .features import Feature
1312from html_sanitizer .sanitizer import Sanitizer
13+ from pydantic import Field
1414from starlette .responses import HTMLResponse
1515from titiler .core .dependencies import CoordCRSParams , DstCRSParams
1616from titiler .core .factory import MultiBaseTilerFactory , img_endpoint_params
17- from titiler .core .resources .enums import ImageType
1817from titiler .core .models .mapbox import TileJSON
18+ from titiler .core .resources .enums import ImageType
1919from titiler .pgstac .dependencies import get_stac_item
2020
2121from pccommon .config import get_render_config
@@ -131,6 +131,7 @@ def map(
131131 },
132132 )
133133
134+
134135# crop/feature endpoint compat with titiler<0.15 (`/crop` was renamed `/feature`)
135136@pc_tile_factory .router .post (
136137 r"/crop" ,
@@ -139,7 +140,7 @@ def map(
139140)
140141@pc_tile_factory .router .post (
141142 r"/crop.{format}" ,
142- operation_id = f"{ self .operation_prefix } postDataForGeoJSONWithFormatCrop" ,
143+ operation_id = f"{ self .operation_prefix } postDataForGeoJSONWithFormatCrop" ,
143144 ** img_endpoint_params ,
144145)
145146@pc_tile_factory .router .post (
@@ -235,9 +236,7 @@ def tile_compat(
235236 ],
236237 scale : Annotated [
237238 int ,
238- Field (
239- gt = 0 , le = 4 , description = "Tile size scale. 1=256x256, 2=512x512..."
240- ),
239+ Field (gt = 0 , le = 4 , description = "Tile size scale. 1=256x256, 2=512x512..." ),
241240 ] = 1 ,
242241 format : Annotated [
243242 ImageType ,
@@ -257,7 +256,9 @@ def tile_compat(
257256) -> Response :
258257 """tiles endpoints compat."""
259258 endpoint = get_endpoint_function (
260- pc_tile_factory .router , path = "/tiles/{tileMatrixSetId}/{z}/{x}/{y}" , method = request .method
259+ pc_tile_factory .router ,
260+ path = "/tiles/{tileMatrixSetId}/{z}/{x}/{y}" ,
261+ method = request .method ,
261262 )
262263 result = endpoint (
263264 z = z ,
@@ -297,9 +298,7 @@ def tilejson_compat(
297298 ] = None ,
298299 tile_scale : Annotated [
299300 int ,
300- Query (
301- gt = 0 , lt = 4 , description = "Tile size scale. 1=256x256, 2=512x512..."
302- ),
301+ Query (gt = 0 , lt = 4 , description = "Tile size scale. 1=256x256, 2=512x512..." ),
303302 ] = 1 ,
304303 minzoom : Annotated [
305304 Optional [int ],
@@ -321,7 +320,9 @@ def tilejson_compat(
321320) -> Response :
322321 """tilejson endpoint compat."""
323322 endpoint = get_endpoint_function (
324- pc_tile_factory .router , path = "/{tileMatrixSetId}/tilejson.json" , method = request .method
323+ pc_tile_factory .router ,
324+ path = "/{tileMatrixSetId}/tilejson.json" ,
325+ method = request .method ,
325326 )
326327 result = endpoint (
327328 tileMatrixSetId = "WebMercatorQuad" ,
0 commit comments