mapmaker.sources package

Subpackages

Submodules

Module contents

mapmaker.sources.add_alpha(image, colour=(255, 255, 255))[source]
mapmaker.sources.blank_image(size=(1, 1))[source]
mapmaker.sources.mask_image(image, mask_polygon)[source]
mapmaker.sources.not_empty(image)[source]
class mapmaker.sources.MapSource(flatmap: FlatMap, id: str, href: str, kind: str, source_range: tuple[int, int] | None = None)[source]

Bases: object

property annotator
property bounds: tuple[float, float, float, float]

The map’s (SE, NW) bounds in WGS84 metres. :rtype: tuple(float, float, float, float)

Type:

returns

property errors: list[tuple[str, str]]
property extent: tuple[float, float, float, float]

The map’s (SE, NW) bounds as decimal latitude and longitude coordinates. :rtype: tuple(float, float, float, float)

Type:

returns

property flatmap: FlatMap
property id: str
property kind: str
property layers: list[MapLayer]
property raster_source
property href
property source_range: tuple[int, int] | None
add_layer(layer: MapLayer)[source]
create_preview()[source]
error(kind: str, msg: str)[source]
filter_map_shape(shape)[source]
map_area() float[source]
properties_from_markup(markup: str) dict[source]
check_markup_errors(properties: dict)[source]
process()[source]
get_raster_source()[source]
class mapmaker.sources.RasterSource(kind: str, get_data: Callable[[], bytes], source_path: FilePath | None = None)[source]

Bases: object

property data: bytes | None
property kind: str
property source_path: FilePath | None