Skip to content

Commit

Permalink
Update custom tms code example (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoWill committed Feb 1, 2024
1 parent db8af9d commit 8adc1ce
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions docs/src/examples/code/tiler_with_custom_tms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
```

0 comments on commit 8adc1ce

Please sign in to comment.