Save formats

csv

Writes data to a CSV output file.

Name

default

Description

include-geometry

FALSE

Determines if (and how) geometry attributes are saved. One of:

  • FALSE: geometry attributes are not included
  • TRUE: geometry attributes are included in WKT format
  • CENTROID: only the centroid of any geometry is included in WKT format

geojson

Writes spatial data to a GeoJSON output file.

Does not support any save() step options

geopackage

Writes spatial data to a GeoPackage output file.

Does not support any save() step options

geotiff

Writes spatial data to a geotiff file.

For each row of data, or ‘feature’, all pixels that lie beneath the feature’s geometry are set to the feature’s value. If several different features overlie the same pixel, then the value for that pixel will be determined by the pixel-statistic strategy in use.

Name

default

Description

bounds

Expression that yields a polygon that defines the extent of the GeoTIFF file. For example: bounds(bookmark('foo.tif')). Any features that fall outside the bounds will be ignored.

geometry

The geometry to use when writing the GeoTIFF, if multiple geometries are present. If not provided, the first geometry value found will be used.

grid-resolution

The size of each pixel in metres. For example, if grid-resolution is 100, then each pixel will represent 100x100m (10,000m²). Note that if the CRS of the geometry being saved is based on degrees, such as EPSG:4326, then the actual pixels produced will not be exactly square and will distort as latitude increases.

pixel-statistic

MEAN

Determines how pixel values are set when multiple features overlap the same pixel. One of:

  • OVERWRITE: sets the pixel to the value of the last feature written
  • MAX: sets the pixel to the maximum value seen across any overlapping features
  • MIN: sets the pixel to the minimum value seen across any overlapping features
  • MEAN: combines the values for any overlapping features and uses the average
  • SUM: combines the values for any overlapping features and uses the total

template

A text-string path to an existing GeoTIFF file to use as a template for the new output GeoTIFF file. The grid-resolution, bounds, and CRS of the template GeoTIFF will be used, and so the ‘grid-resolution’ and ‘bounds’ options can be omitted (specifying these options will override the template’s setting). The grid-resolution is based on the pixel height of the template GeoTIFF, and so may not match the template GeoTIFF exactly if the template’s pixels are not square

value

The value to write to the GeoTIFF pixel(s) that lie beneath each feature. This can be any RiskScape expression, such as consequence.Life_Safety_Risk or exposure.Repl_Cost. If not provided, the first numeric value found will be used.

kml

Writes spatial data to an output file in KML format.

Does not support any save() step options

shapefile

Writes spatial data to an output file in shapefile format.

Does not support any save() step options

shapefile-zip

shapefile_geotools

Deprecated: Writes spatial data to a file in shapefile format.

Does not support any save() step options