MCPcopy
hub / github.com/protomaps/PMTiles / pmtiles

Function pmtiles

python/rio-pmtiles/rio_pmtiles/scripts/cli.py:226–484  ·  view source on GitHub ↗

Export a dataset to PMTiles. The input dataset may have any coordinate reference system. It must have at least three bands, which will be become the red, blue, and green bands of the output image tiles. An optional fourth alpha band may be copied to the output tiles by using th

(
    ctx,
    files,
    output,
    name,
    description,
    attribution,
    layer_type,
    img_format,
    tile_size,
    zoom_levels,
    num_workers,
    src_nodata,
    dst_nodata,
    resampling,
    rgba,
    silent,
    cutline,
    open_options,
    creation_options,
    warp_options,
    exclude_empty_tiles,
)

Source from the content-addressed store, hash-verified

224)
225@click.pass_context
226def pmtiles(
227 ctx,
228 files,
229 output,
230 name,
231 description,
232 attribution,
233 layer_type,
234 img_format,
235 tile_size,
236 zoom_levels,
237 num_workers,
238 src_nodata,
239 dst_nodata,
240 resampling,
241 rgba,
242 silent,
243 cutline,
244 open_options,
245 creation_options,
246 warp_options,
247 exclude_empty_tiles,
248):
249 """Export a dataset to PMTiles.
250
251 The input dataset may have any coordinate reference system. It must
252 have at least three bands, which will be become the red, blue, and
253 green bands of the output image tiles.
254
255 An optional fourth alpha band may be copied to the output tiles by
256 using the --rgba option in combination with the PNG or WEBP formats.
257 This option requires that the input dataset has at least 4 bands.
258
259 The default quality for JPEG and WEBP output (possible range:
260 10-100) is 75. This value can be changed with the use of the QUALITY
261 creation option, e.g. `--co QUALITY=90`. The default zlib
262 compression level for PNG output (possible range: 1-9) is 6. This
263 value can be changed like `--co ZLEVEL=8`. Lossless WEBP can be
264 chosen with `--co LOSSLESS=TRUE`.
265
266 If no zoom levels are specified, the defaults are the zoom levels
267 nearest to the one at which one tile may contain the entire source
268 dataset.
269
270 If a name or description for the output file are not provided,
271 they will be taken from the input dataset's filename.
272
273 This command is suited for small to medium (~1 GB) sized sources.
274
275 Python package: rio-pmtiles (https://github.com/protomaps/PMTiles).
276
277 """
278 log = logging.getLogger(__name__)
279
280 output, files = resolve_inout(
281 files=files, output=output, num_inputs=1,
282 )
283 inputfile = files[0]

Callers

nothing calls this directly

Calls 10

zxy_to_tileidFunction · 0.90
EntryClass · 0.90
optimize_directoriesFunction · 0.90
serialize_headerFunction · 0.90
resolve_inoutFunction · 0.85
guess_maxzoomFunction · 0.85
unwrap_tilesFunction · 0.85
addMethod · 0.80
tilesMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…