titiler.application 1.2.1__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: titiler-application
3
- Version: 1.2.1
3
+ Version: 2.0.0
4
4
  Summary: A modern dynamic tile server built on top of FastAPI and Rasterio/GDAL.
5
5
  Project-URL: Homepage, https://developmentseed.org/titiler/
6
6
  Project-URL: Documentation, https://developmentseed.org/titiler/
@@ -23,9 +23,10 @@ Classifier: Topic :: Scientific/Engineering :: GIS
23
23
  Requires-Python: >=3.11
24
24
  Requires-Dist: pydantic-settings~=2.0
25
25
  Requires-Dist: starlette-cramjam<0.6,>=0.4
26
- Requires-Dist: titiler-core[telemetry]==1.2.1
27
- Requires-Dist: titiler-extensions[cogeo,stac]==1.2.1
28
- Requires-Dist: titiler-mosaic[mosaicjson]==1.2.1
26
+ Requires-Dist: titiler-core[telemetry]==2.0.0
27
+ Requires-Dist: titiler-extensions[cogeo,stac]==2.0.0
28
+ Requires-Dist: titiler-mosaic[mosaicjson]==2.0.0
29
+ Requires-Dist: titiler-xarray==2.0.0
29
30
  Provides-Extra: server
30
31
  Requires-Dist: uvicorn[standard]>=0.12.0; extra == 'server'
31
32
  Description-Content-Type: text/markdown
@@ -45,7 +46,7 @@ python -m pip install titiler.application
45
46
 
46
47
  # Or from sources
47
48
  git clone https://github.com/developmentseed/titiler.git
48
- cd titiler && python -m pip install -e src/titiler/core -e src/titiler/extensions -e src/titiler/mosaic -e src/titiler/application
49
+ cd titiler && python -m pip install -e src/titiler/core -e src/titiler/extensions -e src/titiler/mosaic -e src/titiler/xarray -e src/titiler/application
49
50
  ```
50
51
 
51
52
  Launch Application
@@ -13,7 +13,7 @@ python -m pip install titiler.application
13
13
 
14
14
  # Or from sources
15
15
  git clone https://github.com/developmentseed/titiler.git
16
- cd titiler && python -m pip install -e src/titiler/core -e src/titiler/extensions -e src/titiler/mosaic -e src/titiler/application
16
+ cd titiler && python -m pip install -e src/titiler/core -e src/titiler/extensions -e src/titiler/mosaic -e src/titiler/xarray -e src/titiler/application
17
17
  ```
18
18
 
19
19
  Launch Application
@@ -30,9 +30,10 @@ classifiers = [
30
30
  ]
31
31
  dynamic = ["version"]
32
32
  dependencies = [
33
- "titiler-core[telemetry]==1.2.1",
34
- "titiler-extensions[cogeo,stac]==1.2.1",
35
- "titiler-mosaic[mosaicjson]==1.2.1",
33
+ "titiler-core[telemetry]==2.0.0",
34
+ "titiler-xarray==2.0.0",
35
+ "titiler-extensions[cogeo,stac]==2.0.0",
36
+ "titiler-mosaic[mosaicjson]==2.0.0",
36
37
  "starlette-cramjam>=0.4,<0.6",
37
38
  "pydantic-settings~=2.0",
38
39
  ]
@@ -1,3 +1,3 @@
1
1
  """titiler.application"""
2
2
 
3
- __version__ = "1.2.1"
3
+ __version__ = "2.0.0"
@@ -45,10 +45,6 @@ from titiler.extensions import (
45
45
  stacViewerExtension,
46
46
  wmtsExtension,
47
47
  )
48
- from titiler.mosaic.errors import MOSAIC_STATUS_CODES
49
- from titiler.mosaic.extensions.mosaicjson import MosaicJSONExtension
50
- from titiler.mosaic.extensions.wmts import wmtsExtension as mosaic_wmtsExtension
51
- from titiler.mosaic.factory import MosaicTilerFactory
52
48
 
53
49
  logging.getLogger("botocore.credentials").disabled = True
54
50
  logging.getLogger("botocore.utils").disabled = True
@@ -172,6 +168,11 @@ if not api_settings.disable_stac:
172
168
  ###############################################################################
173
169
  # Mosaic endpoints
174
170
  if not api_settings.disable_mosaic:
171
+ from titiler.mosaic.errors import MOSAIC_STATUS_CODES
172
+ from titiler.mosaic.extensions.mosaicjson import MosaicJSONExtension
173
+ from titiler.mosaic.extensions.wmts import wmtsExtension as mosaic_wmtsExtension
174
+ from titiler.mosaic.factory import MosaicTilerFactory
175
+
175
176
  mosaic = MosaicTilerFactory(
176
177
  backend=MosaicJSONBackend, # type: ignore
177
178
  router_prefix="/mosaicjson",
@@ -188,8 +189,43 @@ if not api_settings.disable_mosaic:
188
189
  tags=["MosaicJSON"],
189
190
  )
190
191
 
192
+ # Add Mosaic specific error handlers
193
+ MOSAIC_STATUS_CODES.update(
194
+ {
195
+ MosaicAuthError: status.HTTP_401_UNAUTHORIZED,
196
+ MosaicError: status.HTTP_424_FAILED_DEPENDENCY,
197
+ MosaicNotFoundError: status.HTTP_404_NOT_FOUND,
198
+ }
199
+ )
200
+ add_exception_handlers(app, MOSAIC_STATUS_CODES)
201
+
191
202
  TITILER_CONFORMS_TO.update(mosaic.conforms_to)
192
203
 
204
+
205
+ ###############################################################################
206
+ # Zarr endpoints
207
+ if not api_settings.disable_zarr:
208
+ from titiler.xarray.extensions import DatasetMetadataExtension, ValidateExtension
209
+ from titiler.xarray.factory import TilerFactory as XarrayTilerFactory
210
+
211
+ md = XarrayTilerFactory(
212
+ router_prefix="/zarr",
213
+ extensions=[
214
+ DatasetMetadataExtension(),
215
+ ValidateExtension(),
216
+ ],
217
+ enable_telemetry=api_settings.telemetry_enabled,
218
+ templates=titiler_templates,
219
+ )
220
+ app.include_router(
221
+ md.router,
222
+ prefix="/zarr",
223
+ tags=["Zarr"],
224
+ )
225
+
226
+ TITILER_CONFORMS_TO.update(md.conforms_to)
227
+
228
+
193
229
  ###############################################################################
194
230
  # TileMatrixSets endpoints
195
231
  tms = TMSFactory(templates=titiler_templates)
@@ -217,19 +253,9 @@ app.include_router(
217
253
  )
218
254
  TITILER_CONFORMS_TO.update(cmaps.conforms_to)
219
255
 
220
-
256
+ ###############################################################################
221
257
  add_exception_handlers(app, DEFAULT_STATUS_CODES)
222
258
 
223
- # Add Mosaic specific error handlers
224
- MOSAIC_STATUS_CODES.update(
225
- {
226
- MosaicAuthError: status.HTTP_401_UNAUTHORIZED,
227
- MosaicError: status.HTTP_424_FAILED_DEPENDENCY,
228
- MosaicNotFoundError: status.HTTP_404_NOT_FOUND,
229
- }
230
- )
231
- add_exception_handlers(app, MOSAIC_STATUS_CODES)
232
-
233
259
  # Set all CORS enabled origins
234
260
  if api_settings.cors_origins:
235
261
  app.add_middleware(
@@ -337,15 +363,20 @@ if api_settings.lower_case_query_parameters:
337
363
  )
338
364
  def application_health_check():
339
365
  """Health check."""
340
- return {
341
- "versions": {
342
- "titiler": titiler_version,
343
- "rasterio": rasterio.__version__,
344
- "gdal": rasterio.__gdal_version__,
345
- "proj": rasterio.__proj_version__,
346
- "geos": rasterio.__geos_version__,
347
- }
366
+ versions = {
367
+ "titiler": titiler_version,
368
+ "rasterio": rasterio.__version__,
369
+ "gdal": rasterio.__gdal_version__,
370
+ "proj": rasterio.__proj_version__,
371
+ "geos": rasterio.__geos_version__,
348
372
  }
373
+ if not api_settings.disable_zarr:
374
+ import xarray
375
+ import zarr
376
+
377
+ versions.update({"zarr": zarr.__version__, "xarray": xarray.__version__})
378
+
379
+ return {"versions": versions}
349
380
 
350
381
 
351
382
  @app.get(
@@ -30,6 +30,7 @@ class ApiSettings(BaseSettings):
30
30
  disable_cog: bool = False
31
31
  disable_stac: bool = False
32
32
  disable_mosaic: bool = False
33
+ disable_zarr: bool = False
33
34
 
34
35
  lower_case_query_parameters: bool = False
35
36