mapchete.formats.default.vector_file module¶
Vector file input which can be read by fiona.
Currently limited by extensions .shp and .geojson but could be extended easily.
- class mapchete.formats.default.vector_file.InputData(input_params, **kwargs)¶
Bases:
InputData
Main input class.
- Parameters
- input_paramsdictionary
driver specific parameters
- Attributes
- pathstring
path to input file
- pixelbufferinteger
buffer around output tiles
- pyramid
tilematrix.TilePyramid
output
TilePyramid
- crs
rasterio.crs.CRS
object describing the process coordinate reference system
- sridstring
spatial reference ID of CRS (e.g. “{‘init’: ‘epsg:4326’}”)
- METADATA = {'data_type': 'vector', 'driver_name': 'vector_file', 'file_extensions': ['shp', 'geojson'], 'mode': 'r'}¶
- bbox(out_crs=None)¶
Return data bounding box.
- Parameters
- out_crs
rasterio.crs.CRS
rasterio CRS object (default: CRS of process pyramid)
- out_crs
- Returns
- bounding boxgeometry
Shapely geometry object
- cleanup()¶
Cleanup when mapchete closes.
- in_memory_features()¶
This property can be accessed once the preprocessing task is finished.
- open(tile, **kwargs)¶
Return InputTile object.
- Parameters
- tile
Tile
- tile
- Returns
- input tile
InputTile
tile view of input data
- input tile
- class mapchete.formats.default.vector_file.InputTile(tile, input_data, in_memory_features=None, cache_task_key=None, **kwargs)¶
Bases:
InputTile
Target Tile representation of input data.
- Parameters
- tile
Tile
- kwargskeyword arguments
driver specific parameters
- tile
- Attributes
- tiletile
Tile
- input_datastring
path to input vector file
- tiletile
- is_empty()¶
Check if there is data within this tile.
- Returns
- is emptybool
- read(validity_check=True, clip_to_crs_bounds=False, **kwargs)¶
Read reprojected & resampled input data.
- Parameters
- validity_checkbool
also run checks if reprojected geometry is valid, otherwise throw RuntimeError (default: True)
- clip_to_crs_boundsbool
Always clip geometries to CRS bounds. (default: False)
- Returns
- datalist