voxcity.exporter.geotiff ======================== .. py:module:: voxcity.exporter.geotiff .. autoapi-nested-parse:: GeoTIFF export utilities for VoxCity 2D data layers. Exports land cover, building height, DEM, and canopy height grids as conventional north-up, single-band GeoTIFF files in EPSG:4326. Classes ------- .. toctree:: :hidden: /autoapi/voxcity/exporter/geotiff/GeoTIFFExporter .. autoapisummary:: voxcity.exporter.geotiff.GeoTIFFExporter Functions --------- .. autoapisummary:: voxcity.exporter.geotiff.export_grid_geotiff voxcity.exporter.geotiff.export_geotiffs Module Contents --------------- .. py:function:: export_grid_geotiff(grid, rectangle_vertices, meshsize, output_path, *, crs='EPSG:4326', dtype=None, nodata=None, color_table=None, category_names=None) Write a single 2D grid to a georeferenced, north-up GeoTIFF. :param grid: side_1/side_2 axes (either order supported for axis-aligned AOIs). :type grid: 2D array, VoxCity ``(nx, ny)`` grid indexed along the AOI's :param rectangle_vertices: :type rectangle_vertices: AOI geometry used for georeferencing. :param meshsize: :type meshsize: AOI geometry used for georeferencing. :param output_path: :type output_path: destination .tif path (parent dirs created as needed). :param crs: :type crs: output CRS string (default "EPSG:4326"). :param dtype: :type dtype: optional output dtype; grid is cast to it before writing. :param nodata: :type nodata: optional nodata value written into the file. :param color_table: Requires an integer `dtype` (e.g. "uint8") -- GDAL colormaps only support Byte/UInt16 bands. :type color_table: optional {int index: (r, g, b)} palette (categorical layers). :param category_names: :type category_names: optional {int index: str} or list[str] of class names. :returns: **str** :rtype: the written path. .. py:function:: export_geotiffs(city, output_directory, base_filename='voxcity', *, layers=DEFAULT_LAYERS, write_readme=True, **kwargs) Export a VoxCity object's 2D layers as one GeoTIFF per layer. Writes ``{base_filename}_{layer}.tif`` for each requested layer. Land cover is written as uint8 with an embedded color table + class-name tags; building height, DEM, and canopy height are float32 with NaN nodata (0 stays valid data). Missing layers are skipped with a warning. When ``write_readme`` is true (the default) a ``README.md`` describing the exported files (layer table, georeferencing, land-cover classes, and how to open them) is also written to ``output_directory``. Returns a dict mapping written layer name -> path. When a README is written its path is included under the ``"readme"`` key.