Making maps showing the distribution of data in OSM
Rust is required.
What percentage of all
cuisines are for Fish & Chips in Ireland & Britain
make data-ireland-and-britain make percent steps=0,5,65,10,12.5,15,20 cols=white_red key=cuisine value=fish_and_chips
White means less, red is more. There is a large hole in London, because it's a large city, so there is a greater choice of restaurants and take-aways, so as a percentage fish & chips shops are lower.
Often it will print out the filename that was generated. The file
last.png will be symlinked to that.
value parameters. Displays what percentage of items with that
key have that
key parameter. Heatmap of the distribution of
value parameters. Heatmap of the distribution of
The Spatial Reference System to use. it's units are used for the radius.
When generating the heatmap, use the value as the resolution of the image. Units of the SRS.
The radius of the heatmap, in units of the SRS
gdaldem color-relief is used to generate a coloured GeoTIFF file. the
cols parameter is a
_ separated list of colours to generate the ramp from, using
pastel's HSL colour ramp.
steps is a
, separate list of 'steps' in the colour ramp. Either raw values, or
%'s can be used.
% means gdal uses that percentage of the maximum value in the data. With
colour_mode=exact (the default) all input data from that value up to the next value are set to that colour value. With another
colour_mode value, the regular gdal colour smoothing & interpolation is done.
cols=white_red steps=0%,25%,50%,75%. Set it with
make steps=0,100,1000 (or use the
steps= Make variable)
generate_colour_ramp.py script creates a gdal colour ramp file with a name like
Comma separated list of step values. You probably want
0%) as the first entry.
The colour ramp is build from these value. Use
_ to separate values.
white_blue means “go from white to blue”.
white_blue_red: “From white to blue to red”.
white_502917: “From white to
Colour ramps are generated with
#ffffff) is set at the 0% value,
90%, and values at 10% are coloured with half way between them according to pastel (
On Ubuntu Linux, the image viewer
geeqie will reload a file when it changes. I open it, and display the
last.png file, and iteratively modify the
steps value and can see those changes quickly.
steps value, you can use percentages, or raw values.
gdalinfo -stats (e.g.
gdalinfo -stats heatmap_kv_sport__golf_srs2157_res1000_radius50000_bboxALL_imagebbox386592,235671,1311592,1585671.tiff) gives an overview of the values in the heatmap:
Band 1 Block=925x2 Type=Float32, ColorInterp=Gray Min=0.000 Max=1019.677 Minimum=0.000, Maximum=1019.677, Mean=24.859, StdDev=75.753 Metadata: STATISTICS_MAXIMUM=1019.6765136719 STATISTICS_MEAN=24.85914913463 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=75.753194758544 STATISTICS_VALID_PERCENT=100
Here the values of each pixel go from 0 to 1019.
Copyright 2020, Affero GNU General Public Licence v3 or later. Maps produced will be a Produced Work of OpenStreetMap, and hence require attribution.