Skip to content

Commit

Permalink
Minor documentation updates (#155)
Browse files Browse the repository at this point in the history
* Valid stack name in documentation; including example for requester pays

* Updating ref to cmap registration; fixing custom TMS example

* Review for new version
  • Loading branch information
fredliporace authored Nov 26, 2020
1 parent 0944821 commit a5744b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions docs/concepts/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,25 +221,25 @@ class PathParams(DefaultDependency):

```python

import morecantile
from morecantile import tms, TileMatrixSet
from rasterio.crs import CRS

from titiler.endpoint.factory import TilerFactory

# 1. Create Custom TMS
EPSG6933 = morecantile.TileMatrixSet.custom(
EPSG6933 = TileMatrixSet.custom(
(-17357881.81713629, -7324184.56362408, 17357881.81713629, 7324184.56362408),
CRS.from_epsg(6933),
identifier="EPSG6933",
matrix_scale=[1, 1],
)

# 2. Register TMS
morecantile.tms.register(custom_tms.EPSG6933)
tms = tms.register([EPSG6933])

# 3. Create ENUM with available TMS
TileMatrixSetNames = Enum( # type: ignore
"TileMatrixSetNames", [(a, a) for a in sorted(morecantile.tms.list())]
"TileMatrixSetNames", [(a, a) for a in sorted(tms.list())]
)

# 4. Create Custom TMS dependency
Expand All @@ -248,9 +248,9 @@ def TMSParams(
TileMatrixSetNames.WebMercatorQuad, # type: ignore
description="TileMatrixSet Name (default: 'WebMercatorQuad')",
)
) -> morecantile.TileMatrixSet:
) -> TileMatrixSet:
"""TileMatrixSet Dependency."""
return morecantile.tms.get(TileMatrixSetId.name)
return tms.get(TileMatrixSetId.name)

# 5. Create Tiler
COGTilerWithCustomTMS = TilerFactory(
Expand Down
4 changes: 2 additions & 2 deletions titiler/custom/cmap.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Titiler Custom colormaps.
Custom colormaps needs to be register in titiler/api/deps.py
e.g `cmap.register("above", custom_colormap.above_cmap)`
Custom colormaps needs to be register in titiler/dependencies.py
e.g `cmap = cmap.register({"above": custom_colormap.above_cmap})`
"""

Expand Down

0 comments on commit a5744b0

Please sign in to comment.