How to create a new colour ramp for a layer
    • 11 Aug 2022
    • 8 Minutes to read
    • Dark
      Light

    How to create a new colour ramp for a layer

    • Dark
      Light

    Article Summary

    An option provided in the Layer properties window within Flood Modeller enables you to assign a colour ramp to a layer in your map view. The multiple options provided for colour ramp setting enable you to produce significant variations in appearance for your data layer. This in turn can highlight particular aspects of your data that would not be visible otherwise, e.g. show only areas where a particular threshold is exceeded.

    In addition the colour ramp settings options enable you to ‘tidy up’ views created by the default colour ramps automatically assigned by Flood Modeller when each layer is loaded.

    1. Use the Add GIS DATA button (Home tab or Layers panel) to add your GIS data to the Flood Modeller map view. There are a number of file types that can be visualised with the use of a colour ramp:

      • Raster grids (‘.asc’) file – This will be a ground grid (DTM or DEM), a flood depth grid or other grids post-processed from flood model outputs (e.g. event duration or flood hazard data). Format will be in ASCII or binary format. The grid z values will be associated to the colour ramp colours.
      • Shapefiles – This can be a point, polyline or polygon shapefile. The colour ramp colours can be assigned to any numeric attribute field associated to your shapefile
      • TIN files – After you have assigned 1D model results data (e.g. water levels) to a TIN then you can apply a colour ramp to these data.
      • 2D model results (2dm/xmdf.sup/sup/dat files) – you can apply different colour ramps to each 2D model results parameter loaded, e.g. depth and velocity. Colour ramps for scalar data define the grid cell colours. Colour ramps for vector data define the colour of vector arrows.

      For some data formats when you load a new layer Flood Modeller will automatically assign a default colour ramp (which you can then edit).

      When you have defined you colour ramp steps you must then click the Generate button to recalculate your colour ramp steps (remember to click Generate before exiting the Properties window otherwise your changes will not be applied).

      2Dimagescolourramp1.jpg

      To add a new row first highlight the row that will be next to your new row and then use the appropriate add row button (above or below) to add a new blank row. Then double-click on each blank field and type in the upper value, lower value and associated label (that will appear in the table of contents of your map). Then use the set colour toolbar button to define the colour of your new row. Finally click the Apply button to see how your colour ramp affects the appearance of your data layer in the map view.

    2. To access the colour ramp settings for a layer right click on the layer name in Layers panel and select Properties from the displayed menu.

    3. The Properties window will then be displayed (in front of your map view). To access the colour ramp settings for the layer select the Symbology > Colour Ramp tab, as shown below:

      2Dimagescolourramp2.jpg

    4. Setting a value range – The properties window will display the maximum and minimum values present in the selected layer. These data will be used by default to set the range of values covered by your colour ramp. Often it will be the case that the max and min range values will not be rounded numbers (as they are from ‘real’ data). This will lead to a colour ramp of irregular values with many decimal places being produced. Although this will be a true representation of the data it will be less easy to read and understand and will not look very good in presentations.

      Therefore the value range settings include a Custom option where you can enter a range that will produce more readable step sizes, as shown by the example below:

      2Dimagescolourramp3.png

      The custom range option also allows you to set up a colour ramp to show a subset of your data, e.g. only show values that exceed a particular threshold. Data left outside of your specified range will not be visible in your map view, unless you tick the box to make no data values and data outside your range visible (see point 7 below).

      For shapefiles the default setting is to not apply a numeric colour ramp and instead apply a different colour to every feature. This is known as a Categorised colour ramp. A colour ramp type selection box is provided in the upper right corner of the colour ramp window for shapefiles with options Categorised and Graduated. If the latter option is selected you can then select a numeric attribute field (another dropdown selection box is provided entitled Field). The min and max range are then automatically calculated for your selected attribute. Note that this range is not editable for shapefiles so you just need to define the number of steps in your range to define a colour ramp.

    5. Selecting colour options – you need to specify the colours that will be assigned within your specified value range. The properties window offers three options for specifying colours, which are located on three tabs as shown in the example below:

      2Dimagescolourramp4.png

      The colour options are defined as follows:

      • 2 Colours – Separate colour palettes are provided to select colours for the upper and lower ends of your data range. Flood Modeller will then automatically interpolate between the selected colours
      • Light to Dark – Select a single colour using the provided colour palette. Flood Modeller will than calculate a colour range from light to dark shades of the selected colour. You can also select to reverse the range (from dark to light) or to fade to black off to white.
      • Spectrum – This is similar to the 2 colours option in that you select separate colours for upper and lower ends of your data range and Flood Modeller automatically interpolates between these colours. The difference in this option is that the upper and lower colours are selected from a spectrum. Select whether you are setting an upper or lower colour and then use the mouse to drag the slider up and down the displayed spectrum to select a colour. Finally drag the circle icon within the ‘brightness box’ to define the shade of the selected colour.
    6. Define the steps within your colour ramp – In addition to the minimum and maximum values and the colour settings the look of your colour ramp is also dependent on the number of steps defined within the range. The colour sets setting provides two options:

      • Number of Equal Breaks – The specified range will be divided into this number of equally sized steps. You can select a value from 1 to 20 in the dropdown selection box or type your own value into the box.
      • Fixed Interval – equal steps of this specified interval will be added to your colour ramp from the minimum range value until the maximum value is equalled or exceeded. You can select a value from 1 to 20 in the dropdown selection box or type your own value into the box (including non-integer values).
    7. Missing values flag – By default data set as missing (usually a value of -9999) will be excluded from your colour ramp and hence these data will not be visible in your map view. In addition data values that fall outside your specified range will also be not visible in the map view.

      2Dimagescolourramp5.jpg

    8. Add extra steps to colour ramp range – After you have generated a colour ramp you can manually add extra single rows or edit the calculated ranges, e.g. change a colour. A toolbar is located above the calculated colour ramp, which offers the following functions:

      • Add extra row above selected row – Adds a blank row that you then need to double click on to type in a data range and an associated label.
      • Add extra row below selected row – Adds a blank row that you then need to double click on to type in a data range and an associated label.
      • Move row up or down – allows you to change order of colours defining your colour ramp
      • Delete selected row – removes single row from your colour ramp (remember to correct ranges of adjacent rows to ensure no gaps in data range)
      • Reverse order – maintains data ranges but reverses the defined colours, e.g. light to dark would then go dark to light.
      • Delete all rows – leaves blank table. You need to then use the Generate button to create a new colour ramp.
      • Set colour – displays a colour palette for you set the colour of the selected row. This may be a new row added with no colour defined or it may be an existing row in an auto-generated colour ramp and you want to highlight a particular data range (with a bold colour).
      • Turn off selected rows in map view – un-tick the box on a particular row of your colour ramp and then data lying in the associated range will not be visible on your map.
    9. Saving and reloading a colour ramp – Once you have defined a colour ramp you can save all settings to a colour ramp file (a text file with file extension ‘.csh’). A saved colour ramp can then be loaded back into Flood Modeller to be applied to other data layers. This provides a quick way of setting up a number of layers with the same colour ramp. This scan be useful when comparing multiple simulations of a model (e.g. for different return period events).

      The colour ramp save and load functions are accessed using buttons located above the colour ramp toolbar, as shown in the above figure.

    10. Colour ramp manipulation - If you want to visualise a subset of your data range in detail then you may use a curtailed data range to avoid having an excessive number of steps in your colour range. Hence some data will not be visualised by default. Options to visualise the full range of your data in this case are as follows:

      • Turn on the no data visible option by ticking the adjacent box – This will also make all cells with the missing data flag assigned to become visible (which may not be beneficial). Therefore this is a better option for data layers that do not include any missing data, such as the example below:

        2Dimagescolourramp6.png

      • Manually add an extra step to your colour ramp – This will be one extra step at the end of the calculated range to cover the whole of the remaining range. This is a good alternative if your data contains a lot of missing data cells.

        2Dimagescolourramp7.png


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.