Skip to content

nets create-archive

Reads (n_samples, height, width, bands) CNN samples from raster data and writes to numpy archives.


usage: nets create-archive [-h] [--response filepath]
                           [--features filepath [filepath ...]]
                           [-o OUTPUT_DIRECTORY] [--rmin value] [--rmax value]
                           [--window-size width height]
                           [--valid-fraction percent]
                           [--resolution RESOLUTION] [--crs CRS]
                           [-r resampling] [--dstnodata value]
                           [--ot data_type] [--cores CORES] [--no-upload]
                           [--tempdir directory] [--keep-temp]
                           output_id sample_centroids

positional arguments:
  output_id             Unique identifier used to generate output files (like
                        {id}.features.npy, {id}.archive.meta.yml).
  sample_centroids      Path to point-format vector file with the sample
                        centroids to draw samples from.

optional arguments:
  -h, --help            show this help message and exit
  --response filepath   Path to raster-format response data to extract.
                        (default: None)
  --features filepath [filepath ...]
                        Path(s) to raster-format feature data to extract
                        (default: None)
  -o OUTPUT_DIRECTORY, --output_directory OUTPUT_DIRECTORY
                        Path for output files. Will be written as
                        {output_directory}/{id}.{filetype}.{extension}
                        (default: ./)
  --rmin value          The minimum response value to include. Values below
                        this will be set to nodata. (default: None)
  --rmax value          The maximum response value to incude. Values above
                        this will be set to nodata. (default: None)
  --window-size width height
                        The 2D shape of each window to sample in pixel sizes.
                        (default: [64, 64])
  --valid-fraction percent
                        The amount of valid data in a window required for
                        inclusion. (default: 0.25)
  --resolution RESOLUTION
                        The resolution to sample from. You can pass a number,
                        'response' to use the response data resolution, or
                        'features' to use the feature data resolution.
                        (default: features)
  --crs CRS             The spatial projection to sample from. You can pass a
                        string (like 'EPSG:32610'), 'points' to use the vector
                        crs, 'response', or 'features'. (default: features)
  -r resampling         GDAL resampling option (default: average)
  --dstnodata value     Output nodata value (default: -9999)
  --ot data_type        GDAL data type (default: float32)
  --cores CORES         number of processing threads (default: 3)
  --no-upload           Don't upload outputs to cloud storage (default: False)
  --tempdir directory   the path to write tempfiles to (default: None)
  --keep-temp           dont delete intermediate files (default: False)