Skip to content

Preprocessing and Smoothing Land Use

Karl edited this page Aug 14, 2019 · 2 revisions

Because of the low resolution (10m per pixel), the original land-use data has very visible jagged edges. We want to smooth it so that things like the edges of fields look more natural.

Given: The land-use data sentinel-invekos-combined.tif

  1. Turn the spread out float32 values into more compact bytes: gdal_calc.py -A sentinel-invekos-combined.tif --outfile=only_low.tif --calc="A*(A<131)+(A-1850)*(A>2000)" --NoDataValue=0 --debug --type=Byte (the result is consistent with our updated ID table)
  2. Load the resulting only_low.tif into QGIS
  3. Polygonize the image
  4. Run v.clean on the resulting polygons (they're not valid otherwise)
  5. Run v.generalize with the Snakes algorithm to smooth the polygons - the default parameters seem fine
  6. Rasterize the polygons back (again into bytes) with the desired resolution

The result can be used for adding additional polygon data and tiled afterwards.