34. Raster layer

34.1. Select raster layer

It allows users to enable a raster layer by clicking on it in the working area. It is necessary that the raster layer is visible.

It is available from the buttons bar of the raster layer.

As a result the layer will be automatically enabled in the TOC and its name will appear in the drop-down list of the toolbar.

34.2. Histogram

It allows to consult and modify the raster histogram.

It is available from the Layer” menu, the contextual menu of the layer in the TOC and the buttons bar of the raster layer.

The interface is the following one:


  1. With this option you can select the data source with which the histogram is generated:

  • Visualize data. Displayable data from the raster is used. The bands selector has just the R, G and B values. Every band will appear in the graphic with its corresponding colour (red for R, green for G and blue for B). This is the default option when the histogram dialog is opened.

  • Complete. With this option, the histogram for the whole raster is calculated. The image bands will appear in the band selector.

      Because of the amount of time that it would take to calculate the histogram for large images, the histogram is only calculated once, which allows that the access be much faster next times a histogram or other functions which need acces to the histogram data are requested. The result of this calculation is in a new associated file with .rmf extension (it is generated in the folder in which the origin data of the image are; if we remove the .rmf file attached to the image, this calculation will be lost).

  1. Type: You can select one of the following types:

  • Normal: This is the histogram in which for every pixel value on the X axis the number of pixels is shown on the Y axis.

  • Accumulated: Histogram which shows the accumulated number of pixels for every pixel value. The graph is therefore ascending.

  • Logarithmic: It assigns the logarithm's value of the histogram in every position. This allows to visualize a much more balanced histogram without excessive peaks which hide the rest.

  1. Bands. It allows to enable the bands that will be displayed in the graph.

    It allows users to select bands by clicking on them (with the “Control” key pressed we will be able to select several bands). When a band is selected, by hovering the mouse over a point in the graph the name and the value of the point will appear.

  2. Graph. Viewing area of the histogram.

    We can zoom in and out of the graph using the mouse directly over the graph. To zoom in one part of the graph draw a rectangle over it by pressing and dragging the mouse to the right. To return to the original graph click on the left mouse button on any point in the graph and drag to the left, then release the mouse button.

    The controls that appear under the graph allow the user to restrict the range of values (X axis of the histogram) on which the histogram is based. The default setting is the complete range so that, for example in a Byte data type image, the statistics are calculated for all the pixel valued from 0 to 255. You can enter the values directly in the text boxes or use the “+” and “-” controls next to the text boxes. You can also slide the triangles over the sliding bar to select the range of values.

    Right-clicking in any part of the graph, the context menu is shown.

  • Properties. This will open the properties dialog of the graph, where you can configure its characteristics. There are three tabs in this window:

    • Title. Options to define the title of the histogram.

    • Plot. It has three tabs. Two of them, “Domain axis” and “Range axis”, allow to define the caracteristics of the histogram's axes.

      The “Apparence” tab allows to define the border, the background and the orientation of the histogram.

    • Other. It allows users to define the rest of the visual caracteristics of the histogram.

  • Save as. To save the graph as an image with .png format.

  • Print. It allows to print the graph.

  • Zoom in. To zoom in on one or both of the axes.

  • Zoom out. To zoom out on one or both of the axes.

  • Auto Range. It adjusts the zoom automatically to the window size, for one axis or for both.

  1. Table. It shows the statistics that correspond to the selected range of pixel values. Each row of the table corresponds to one raster band as displayed in the histogram. The columns that are shown are:

  • Minimum. Minimum pixel value for the selected interval.

  • Maximum. Maximum pixel value for the selected interval.

  • Mean. The mean (average) of all the pixel values for the selected interval in the histogram.

  • Median. Median pixel value for this interval.

  • Number of pixels. The number of pixels included in the selected interval.

  1. Create table. It allows users to create a data table in .dbf format with the histogram values. The table is atomatically added to gvSIG.

  2. Hide statistics. It reduces the window's size hidding the options related with the statistics.

The Raster section of the “Preferences” in gvSIG, contains the option “Number of Classes” where you can set the number of intervals in which the histogram is divided when the data type of the image is not Byte. For Byte images, this value is 256. In the preferences dialog, the default value of this option is 64. The intervals are the parts in which the range of values is divided. For example, if we have a DTM with values between 0 and 1 and there are 64 intervals, each interval will have a range of 1/64.

The number of classes does not only refer to histograms but also to other functionalities that require a division in intervals of value ranges.

34.3. Colour table

It allows users to assign specific RGB values to a range of pixel values in a single band image. We can apply existing color tables or create new ones.

It is available from the “Layer” menu, from the contextual menu of layer in the TOC and from the buttons bar of raster layer.

To use this function, it is important to know the minimum and maximum values in the image. If these values are unknown, they will have to be calculated. Depending on the size of the image, this calculation process may take some time.

The interface is the following one:

  1. Activate color table. When this tool is launched for an image without any associated color table, all the components are shown as not active. To start working we should tick the check box.

  2. Library. List of color tables that are included in gvSIG. You can choose a colour table to apply to the image.

    Right-clicking on this area, a contextual menu appears, which can change the way to visualize the libraries.


List

Small Icon

Large Icon

    Below the colour table library there are buttons to add, export, import and delete colour tables. The supported formats are .rmf, .ggr and .gpl.

    When clicking on the button with the tooltip “New library”, a dialog opens which prompts for basic information of the colour table:

  • Name. Name of the new library.

  • Minimum. The default minimum value is 0.

  • Maximum. The default maximum value is 255.

  • The size and number of intervals. The intervals can be specified by two different methods. The first method is by assigning the interval size where we introduce the distance of an interval after which the number of intervals is calculated for the whole range of values. The second method is to specify the number of intervals, after which the distance of the intervals is calculated automatically.

  1. Preview. It allows to visualize the results, in real time, of the changes which are being applied.

    The Preview has the following options:

    • To move on the image using the left button of the mouse.

    • To center the layer in relation to the preview using the “C” key.

    • To adjust the zoom level to see all the layer using the “Space” key.

    • Predefined zoom levels using the “1” and “5” keys. The “1” key is used for a zoom level 1/1.

    • To zoom in or out using the mouse wheel or with the “+” and”-” keys.

    • To show or hide a grid as a background to better appreciate the images with transparency using the “B” key.

    • To show the informative help using the “H” key or clicking on the question mark of the preview.

  1. Central part. It allows to visualize the information of the color table associated with the image in tabular form (“Table” tab) or gradient form (“Gradient” tab).

  • Tabular view. Every row in the table corresponds to a range of pixel values and its associated RGB colour. This association is established by range of values. The column Value shows the first value of the range and the column Final shows the last value of the range. These values can be edited directly by double-clicking on the cell and typing a new value. The RGB column contains the RGB value to be assigned to the range of pixel values. The cells in this column are not editable, but if you want to change the colour you can go to the corresponding cell in the Colour column and click on it. The Class column contains associated labels that will not have any effect on the calculation and are just meant to add descriptive names to the range of values; this name will appear in the map legend. Finally, the column labelled Alpha shows a transparency selection dialog.

    To manage the rows on the table you can use the general table controls located below the table.

  • Gradient view. It contains the same information as the tabular view but presented in a different way, and with the possibility to obtain results that are difficult to achieve with the tabular view. The colour bar represents the range of values from minimum on the left to maximum on the right. At the start, the end and on intermediate points on the colour bar are a number of break points with a fixed colour value. These break points indicate the colour that will be assigned to the value that falls on that point.

    A click on a break point will activate the text boxes below the colour bar. These text boxes show the following information about the selected point:

    • Colour. Colour selector which can be modified.

    • Class. Label associated with the point.

    • Value. Pixel value at this break point.

    To add a break point, just click below the colour bar. After adding a break point you can modify its information. To remove a break point you can click on it and drag it away.

  1. Controls of minimum and maximum values, and the “Recalc statistics” button.

  2. In the lower part of the dialog are the controls of the tabular and gradient view:

  • Interpolated. When ticking this check box the transition between the colours of two ranges of pixel values will be smoother. If you disable this check box, the transition will be abrupt. The point where a colour ends and the next one begins is defined with a rhombus symbol.

  • Limits adjust. It allows users to adjust the ranges to the maximum and minimum values of the image. If this is turned off, the colour table will be applied to the whole range of values which is 0 to 255 by default.

  • Middle distance. It will result in break points that all hold the same distance between them. At the same time, the first and last values of the range of pixel values will be modified accordingly in the tabular view.

  • Save as default. The current colour table will be set as the default colour table for this image. The colour table information will be saved as a metadata file (.rmf) with the image, and the next time that the image is loaded in a gvSIG view it will have this colour table associated with it by default.

34.4. Information by point

It shows a window with the pixel information when clicking on it on the raster layer.

It is available in the raster toolbar and in the generic toolbar.

The interface is the following one:

In some cases, such as WMS layers, this window can have aditional information about the type of layer.

34.5. Area of interest

This tool allows to define regions of interest (ROIs) on a raster layer. This regions can be used to extract statistics, in classifications processes, to mask, etc.

It is available from the “Layer” manu, from the layer contextual menu in the TOC and from the raster toolbar.

The interface is the following one:

  • ROIs table: This table shows the defined regions of interest for the layer. For every ROI the table shows a name, the number of geometries (displayed by types) and the colour associated with the ROI. The name and the colour can be changed by the user.

  • New. It creates a new ROI.

  • When the ROI has been created we can add the geometries. We can add polygons, points or lines (depending on the selected tool) on the raster in the View. Each click adds a vertex to the geometry of the ROI; to finish drawing a line or polygon just double-click. To add geometries to a ROI, select the corresponding entry in the table and draw the new geometries on the view as we just described.

  • Delete. It removes the selected ROI in the table.

  • Apply or Accept. The defined list of ROIs gets associated with the raster layer.

  • Save ROIs to shp. file. It allows users to save the ROIs as a shape file.

  • Load ROIs from shp. File. It allows to use a shape file as ROIs.

34.6. Generate overviews

It allows to create pyrimids. The pyrimids are versions of the image with lower resolution, which allow the rapid load of very big images (in a general zoom the lower resolution image is displayed, while when you zoom in, the more resolution image is loaded).

It is available from the “Layer” menu, from the layer contextual menu and from the raster toolbar.

The Raster section of the “Preferences” in gvSIG, contains the options that allow to generate “overviews”: overviews number, ratio and algorithm.

34.7. Analysis view

It is a tool for a quick inspection. It has two effects. It loads the same image in the TOC and it opens a new window where a detail zoom appears and where we can see the image's values in real time.

It is available from the raster toolbar.

With this functionality you can zoom in on the current layer with three different zoom levels:

  • Level 1. General view of the layer. The layer is added to the locator map.

  • Level 2. Visualization area of the View.

  • Level 3. Floating window with the highest zoom level. The zoom level is fixed and always centered on the mouse point. By moving the mouse over the gvSIG view, you will see contents change.

    Also it shows a text at the bottom right of the window, showing the RGB values of the pixel on which the cursor is currently located.

    When right-clicking on the floating window a contextual menu appears. It allows to change the relation between the zoom level of the floating window and the gvSIG view. Also it allows to change the text colour of the RGB values as well as the colour (red, green) of the central cross.

    When the cursor is outside the view, the content of the floating window appears black.

There can only be one analysis view open at any time in gvSIG.

The button “Analysis view” is re-labelled as “Close Analysis view” when the analysis view is already open.

This Page