github mbloch/mapshaper v0.8.0

23 minutes ago
  • Added -fetch command, with presets for importing DEMs and imagery from public sources. Running -fetch sources lists the presets. Tile URL sources are also supported.
  • Added -hillshade command, with options for controlling level of smoothing and various effects, including ambient light from the sky, texture shading and smoothness. Hillshades can use translucent black/white for shadows/highlights or an opaque grayscale with settable base-color. Support for user-defined shadow and highlight colors.
  • Added -sharpen command, for sharpening images and hillshades with an unsharp mask.
  • Added -tone command for adjusting lightness, saturation, contrast, gamma and opacity. A hue-shift option moves hues towards or away from a given hue.
  • [web] Added a panel with sliders for adjusting image tone.
  • -tone adjusts 8-bit grayscale images (lightness, contrast, gamma and opacity), which stay gray. In the web UI, "adjust colors" opens the Tone panel on grayscale images too, without the saturation and hue sliders.
  • -classify sets a color palette on data rasters (e.g. DEMs and land cover rasters), using the same options as for vector layers. The palette is a display setting that survives -clip, -proj and -blur; -style clear removes it. A new categorical flag is a shortcut for method=categorical.
  • [web] New color palettes panel for coloring data rasters. An Elevation tab contains hypsometric tints for a list of preset palettes, including a "Blended" palette, which mixes presets by climate zone, using Köppen-Geiger climate data (Beck et al. 2023). There is a separate selector for bathymetric colors. A "Customize" button opens a dialog for moving the elevations and recoloring them. Elevation palettes, including the Blended palette's colors for each preset, can be exported to JSON, edited and imported again.
  • -classify hypsometric= option supports tinting in the CLI, with presets for six climate zones and three others (atlas, lowland and highland). colors= recolors a preset and breaks= moves its elevations. You can customize the component palettes of the blended option with a special syntax: colors=desert:...,polar:.... Sea colors can be customized using the same syntax: colors=sea:... breaks=sea:.... The classed flag colors a preset in classes instead of continuously. Elevations at or below 0 that are connected to the edge of the raster are treated as sea.
  • -style sets opacity= on raster layers, and -style clear removes a raster's palette and opacity.
  • Added -blend command for combining hillshade layers with a raster image.
  • The -blend chroma= option gives variable control over how the hillshade's shadow and highlight colors are blended into the image. chroma=0 reduces color saturation in shadow and highlight areas by blending in the hillshade's (default) black and white shadow and highlight colors. chroma=1 maintains the color saturation of the target image, only blending in the hillshade's lightness variation. chroma=0,1.5 mixes in the hillshade's color in the shadow areas and boosts the saturation of the image in highlight areas.
  • The -blend strength= option modifies the strength of the hillshade, with variable shadow,highlight control using strength=[shadow,highlight].
  • An experimental -deshadow command removes shadows and lightens dark slopes in aerial imagery, e.g. before applying a hillshade.
  • [web] Added place search when the basemap is turned on.
  • [web] Feature selections are persistent when switching between inspection, selection and style/edit modes.
  • Support for importing images that lack any georeferencing (including ordinary JPEGs and PNGs).
  • -classify no longer treats a field containing one unique value as a data error.
  • -clip now clips rasters to the exact boundary of vector shapes. Removed areas are transparent by default.
  • Breaking change: -classify interpolates colors in OKLCH by default, giving evenly spaced lightness steps and avoiding the dull midtones of RGB mixing. This changes the colors of continuous output, of stops=, and of colors= lists stretched to more classes. Use interpolation=rgb for the previous colors.
  • -classify breaks= accepts percentages of the data range, alone or mixed with values, e.g. breaks=0,30%,60%. With outer-breaks=, percentages are of that range. Previously, a value like 30% was silently read as 30.
  • Breaking change: raster bands are numbered from 1, as in GDAL and in -join expressions (band1). The band= option of -contours and -hillshade was 0-based; band=0 is now an error, and band=2 means the second band. Band numbers are those of the source file, so they still name the same band when only some bands were imported.
  • GeoTIFF data rasters (imported with raster-type=continuous or categorical, or with values wider than 8 bits that aren't a color image) import every band, displaying the first in gray. Previously only the first band, or the first three, were imported. The new -i bands= option chooses the bands to import, e.g. bands=1,4,5 or bands=all.
  • Breaking change: when projecting image rasters with unprojectable areas, the nodata areas are transparent by default (instead of white).
  • -join can join a raster to a polygon layer, using calc= expressions to aggregate band values, e.g. -join population.tif calc='pop = sum(band1)'. By default, pixels are weighted by the fraction of their area inside each polygon; the point-method flag joins pixels by their centers instead.
  • Faster import of LZW-compressed GeoTIFFs.
  • Fixed a half-pixel offset when importing GeoTIFFs whose pixels are tagged as points (PixelIsPoint, common in DEMs).
  • -add-shape has a new offsets= option, for adding vertices relative to the previous vertex.
  • -shape is deprecated in favor of -add-shape.
  • Fixed GeoTIFF import treating the fourth band of a four-band image (such as the near-infrared band of RGB + NIR aerial imagery) as alpha. A band is now imported as alpha only if the file's ExtraSamples tag declares it as alpha.

Don't miss a new mapshaper release

NewReleases is sending notifications on new releases.