generate
Parameters
DataFrame
required
the features to generate tiles from
GenerationConfig
default:"None"
the configuration for generating tiles
Returns
DataFrame
a DataFrame of tiles ready to be output as MVTs
generate_pmtiles
Parameters
DataFrame
required
the DataFrame of features to generate tiles from
str
required
the path to write the PMTiles file to
GenerationConfig
default:"None"
the configuration for generating tiles
PMTilesConfig
default:"None"
the configuration for generating the PMTiles file
Optional[StorageLevel]
default:"StorageLevel.MEMORY_AND_DISK"
the storage level to cache the tiles DataFrame at. If None, the DataFrame will not be
cached
generate_quick_pmtiles
Parameters
DataFrame
required
the DataFrame of features to generate tiles from
str
required
the path to write the PMTiles file to
bool
default:"True"
whether to return a Wherobots-GL
Map showing the generated tilesReturns
Optional[WbglMap]
a Wherobots-GL
Map showing the generated tiles if render is TrueGenerationConfig
Parameters
int
default:"0"
the lowest zoom for which to generate tiles
int
default:"15"
the highest zoom for which to generate tiles
int
default:"4096"
the resolution of the tiles to generate
float
default:"0.1"
the buffer (as a fraction) to apply to the tiles. the margin on a 1000
resolution tile with a buffer of .1 would be 100
Optional[Column]
default:"None"
a predicate Column for filtering features, optional
Optional[Column]
default:"None"
a Column for manipulating the array of features within a tile, optional
Optional[Column]
default:"None"
a Column for manipulating feature geometries, optional
Optional[int]
default:"50000"
the maximum number of features to include in each tile, optional
Optional[int]
default:"None"
DEPRECATED - no longer used. Tiles are now generated and checkpointed at
each zoom level. This parameter is retained for backwards compatibility.
Optional[StorageLevel]
default:"None"
the storage level to persist intermediate features at. Default is
MEMORY_AND_DISK
Optional[int]
default:"None"
the maximum size of the dataset from which to generate tiles, optional
Optional[int]
default:"None"
the number of partitions to use in tile generation. Default is 2x the number
of worker cores.
Optional[int]
default:"None"
the frequency (ie number of zoom levels) at which to repartition the
dataset. Default behavior not to repartition a certain zooms. Repartitioning
helps when the geometries are large relative to the tiles, for example
processing a collection of countries to zoom 16.
bool
default:"False"
Experimental, Unstable feature. whether to replace polygons with a point
in each tile the Polygon appears in. Default is false.
with_suggested_max_zoom()
Parameters
DataFrame
required
The dataframe that will be used along with this Config to generate tiles.
Returns
GenerationConfig
a new GenerationConfig with the maxZoom set based on heuristics of the input dataframe
with_suggested_min_zoom()
Parameters
DataFrame
required
The dataframe that will be used along with this Config to generate tiles.
Returns
GenerationConfig
a new GenerationConfig with the minZoom set based on heuristics of the input dataframe
get_pmtiles_config_builder
Returns
PMTilesConfigBuilder
an empty PMTilesConfigBuilder
get_quick_config
Returns
GenerationConfig
a default GenerationConfig for generating tiles
PMTilesCompressionType
Compress types supported by PMTiles format. Compression can be applied to both the tile data and internal structures such as directories in the PMTiles format.Attributes
int
unknown
int
none
int
gzip
int
brotli
int
zstd
Values
PMTilesCompressionType
3PMTilesCompressionType
2PMTilesCompressionType
1PMTilesCompressionType
0PMTilesCompressionType
4as_java()
PMTilesConfig
Parameters
TileType
required
The type of tile to generate
CompressionType
required
The compression type of the tile data. This should match with the actual tile data.
str
required
The metadata to include in the PMTiles. It should be a serialized JSON object.
CompressionType
default:"CompressionType.GZIP"
The compression type of internal structures in the PMTiles.
bool
default:"False"
Whether the tiles are clustered. Currently only false is supported.
float
default:"-180"
The minimum longitude of the tileset
float
default:"-90"
The minimum latitude of the tileset
float
default:"180"
The maximum longitude of the tileset
float
default:"90"
The maximum latitude of the tileset
int
default:"0"
The zoom level of the center of the tileset
float
default:"0"
The longitude of the center of the tileset
float
default:"0"
The latitude of the center of the tileset
as_java()
PMTilesConfigBuilder
Attributes
str
A name for the tileset
str
A description of the tileset
str
An attribution string for the tileset
str
A version string for the tileset
TilesetType
The type of tileset in this archive (baselayer or overlay)
List
The vector tile layer that are in the tiles
Dict
Extra metadata to include in the PMTiles header
TileType
The type of tiles in the archive
Polygon
The bounding box of the data in the tileset in lon/lat
Point
The central point of the tileset in lon/lat
CompressionType
The type of compression to apply to each tile’s binary
CompressionType
The type of compression to apply to internal structures in the archive
bool
Whether the tiles are clustered(ie ordered in the archive). Currently only false is supported.
add_layer()
Parameters
str
required
The name of the layer as it appears in the tiles
Optional[str]
default:"None"
An optional description of the layer
Optional[int]
default:"None"
the lowest zoom level the layer is visible at
Optional[int]
default:"None"
the highest zoom level the layer is visible at
Optional[Dict[str, str]]
default:"None"
the attributes that may be present on member features of the layer
Returns
The builder object with the new layer added
build()
Returns
A PMTilesConfig object based on the values set in the builder
from_features_data_frame()
Parameters
DataFrame
required
The DataFrame containing the features used to generate the tiles that will go in the PMTiles
Returns
PMTilesConfigBuilder
The builder object with the bounds, center, and layers set based on the features in the DataFrame
PMTilesTilesetType
The type of tile to generate.Attributes
str
The tileset is designed to be rendered below other layers
str
The tileset is designed to be rendered above the base layer
Values
PMTilesTilesetType
'baselayer'PMTilesTilesetType
'overlay'as_java()
PMTilesTileType
Tile types supported by PMTiles format. The tile type reflects the format of the tile data.Attributes
int
unknown
int
mvt
int
png
int
jpeg
int
webp
int
avif
Values
PMTilesTileType
5PMTilesTileType
3PMTilesTileType
1PMTilesTileType
2PMTilesTileType
0PMTilesTileType
4as_java()
show_pmtiles
Map.
The layers can be provided as a list of S3 URIs or dicts. The
dicts may contain some or all of the following fields:
- s3_uri: the S3 URI of the PMTiles file. string. required
- name: a descriptive name of the layer. string. defaults to the file name.
- fill_color / line_color: optional hex colors for the layer.
Parameters
Union[str, List[str], Dict[str, Any], List[Dict[str, Any]]]
required
the layers to show. see overview for more information
Optional[str]
default:"None"
optional basemap; the historical leafmap identifiers (e.g.
"xyz.CartoDB.DarkMatter") are mapped to the Wherobots-GL styles
(light / dark / terrain / satellite). Defaults to dark.Returns
Optional[WbglMap]
a Wherobots-GL
Map rendering the layers inline in the notebookwrite_pmtiles
Parameters
DataFrame
required
the DataFrame of tiles to write
str
required
the path to write the PMTiles file to
Optional[PMTilesConfig]
default:"None"
the configuration for generating the PMTiles file. If None, the config will be generated from the
features DataFrame
Optional[DataFrame]
default:"None"
the DataFrame of features that the tiles were generated from. This is used to generate the
config if one is not provided
Optional[StorageLevel]
default:"StorageLevel.MEMORY_AND_DISK"
the storage level to cache the tiles DataFrame at. If None, the DataFrame will not be
cached

