Skip to content

Commit 8adc1ce

Browse files
authored
Update custom tms code example (#771)
1 parent db8af9d commit 8adc1ce

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

docs/src/examples/code/tiler_with_custom_tms.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ from pyproj import CRS
2020
EPSG6933 = TileMatrixSet.custom(
2121
(-17357881.81713629, -7324184.56362408, 17357881.81713629, 7324184.56362408),
2222
CRS.from_epsg(6933),
23-
identifier="EPSG6933",
23+
id="EPSG6933",
2424
matrix_scale=[1, 1],
2525
)
26-
2726
# 2. Register TMS
28-
tms = tms.register([EPSG6933])
27+
tms = tms.register({EPSG6933.id:EPSG6933})
2928

30-
tms = TMSFactory(supported_tms=tms)
31-
cog = TilerFactory(supported_tms=tms)
29+
tms_factory = TMSFactory(supported_tms=tms)
30+
cog_factory = TilerFactory(supported_tms=tms)
3231
```
3332

3433
2 - Create app and register our custom endpoints
@@ -44,11 +43,11 @@ from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers
4443

4544
from fastapi import FastAPI
4645

47-
from .routes import cog, tms
46+
from .routes import cog_factory, tms_factory
4847

4948
app = FastAPI(title="My simple app with custom TMS")
5049

51-
app.include_router(cog.router, tags=["Cloud Optimized GeoTIFF"])
52-
app.include_router(tms.router, tags=["Tiling Schemes"])
50+
app.include_router(cog_factory.router, tags=["Cloud Optimized GeoTIFF"])
51+
app.include_router(tms_factory.router, tags=["Tiling Schemes"])
5352
add_exception_handlers(app, DEFAULT_STATUS_CODES)
5453
```

0 commit comments

Comments
 (0)