From 8adc1ce23903e0e39103d1e9e0cee6265e7f73c9 Mon Sep 17 00:00:00 2001 From: Will Roper Date: Thu, 1 Feb 2024 22:05:38 +0000 Subject: [PATCH] Update custom tms code example (#771) --- docs/src/examples/code/tiler_with_custom_tms.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/src/examples/code/tiler_with_custom_tms.md b/docs/src/examples/code/tiler_with_custom_tms.md index eb4edacc1..0813dee9c 100644 --- a/docs/src/examples/code/tiler_with_custom_tms.md +++ b/docs/src/examples/code/tiler_with_custom_tms.md @@ -20,15 +20,14 @@ from pyproj import CRS EPSG6933 = TileMatrixSet.custom( (-17357881.81713629, -7324184.56362408, 17357881.81713629, 7324184.56362408), CRS.from_epsg(6933), - identifier="EPSG6933", + id="EPSG6933", matrix_scale=[1, 1], ) - # 2. Register TMS -tms = tms.register([EPSG6933]) +tms = tms.register({EPSG6933.id:EPSG6933}) -tms = TMSFactory(supported_tms=tms) -cog = TilerFactory(supported_tms=tms) +tms_factory = TMSFactory(supported_tms=tms) +cog_factory = TilerFactory(supported_tms=tms) ``` 2 - Create app and register our custom endpoints @@ -44,11 +43,11 @@ from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers from fastapi import FastAPI -from .routes import cog, tms +from .routes import cog_factory, tms_factory app = FastAPI(title="My simple app with custom TMS") -app.include_router(cog.router, tags=["Cloud Optimized GeoTIFF"]) -app.include_router(tms.router, tags=["Tiling Schemes"]) +app.include_router(cog_factory.router, tags=["Cloud Optimized GeoTIFF"]) +app.include_router(tms_factory.router, tags=["Tiling Schemes"]) add_exception_handlers(app, DEFAULT_STATUS_CODES) ```