Previous Page Table of Contents Next Page


13. Raster data


Raster data is a method for storage, processing, and display of spatial data. Each given area is divided into rows and columns, which form a regular grid structure. Each cell within this matrix contains an attribute (a characteristic of a geographic feature described by numbers or characters, typically stored in tabular format, and linked to the feature. For example, attributes of a well, represented by a point, might include depth, pump type, location and liters-per-minute).

A grid is commonly used to refer to a raster data model. A grid is a fully integrated grid (cell-based) geoprocessing system for use with ArcInfo (another ESRI GIS program). The term grid cell is often used to refer to a single element of a raster data structure. In other words: A grid layer consists of small squares (pixels or cells) of equal size with certain criteria attached to them (Figure 13.1).

FIGURE 13.1
Grid files with pixels

In the left grid, blue pixels represent water and brown pixels represent dry area. In the right grid light green represents a rice species with a short stem, while the dark green represents a longstem rice species. From this very rough picture, you could conclude that a long stem rice species needs to be flooded, while the short stem species needs its ‘feet’ to be dry. Of course it is possible to draw lots of other conclusions, making it clear that a crude picture alone is not enough to draw substantial conclusions.

The level of detail, or level of accuracy of a grid layer depends on the size of the raster cells also called resolution. Smaller pixel sizes also means increased number of pixels and increased size of the files. Raster files of 1-2 megabytes are quite common in a GIS analysis and a fairly simple GIS analysis easily requires about 200-300 megabytes of free hard disk space to store all the generated raster files.

Raster data can be derived from:

13.1. Overlay

Data from different locations (points) can be interpolated to generate raster data files, surface plots. We all know examples of these from the pre-GIS period, like contour lines made from topographic maps, salinity lines in the coastal areas.

GIS has a number of powerful mathematical tools to create these raster data files. Once a number of these files (of different parameters for the same area) are made, interactions or relations between the different layers, or data sets can be explored with GIS.

For example, GIS could be used to analyse whether in a certain area there is a relation between the occurrence of White Spot disease in shrimp farming and parameters such as water quality in the ponds or major canals, salinity level, feeding levels, stocking density of post larvae, etc. Figure 13.2 gives a graphical representation of this concept, which is also known as the overlaying principle. This principle is the basis of many raster analyses.

FIGURE 13.2
Example of different grid layers

It can not be stated enough that GIS is much more than a sophisticated tool to make nice maps for reports. It is a tool for spatial analysis of data.

To work with raster data in the ArcView program you need the Spatial Analyst extension. Extension are plug-ins that you can load and unload as you need them. The ArcView Spatial Analyst is an extension for ArcView 3.x. This extension allows you to create, query, map, and analyse cell-based raster data and to perform integrated vector analysis.

13.2. How to set your defaults for the use of Spatial Analyst and change the working directory

13.2.1. Settings of Spatial Analyst

The Spatial Analyst extension needs to be purchased, as it does not come with the ArcView Package. To work with this extension you first have to install Spatial Analyst and then activate it in the ArcView program. After you have started ArcView, go to File/Extensions... via the menu bar (Figure 13.3), which opens the Extensions window, check the Spatial Analyst box, then check the box ‘make default’ and select OK (Figure 13.4).

FIGURE 13.3
Opening the ArcView Extensions window

FIGURE 13.4
Activating Spatial analyst

13.2.2. Changing the working directory

If you create new files in ArcView in most cases they will be automatically saved in the working directory ‘C:\windows\temp’. In the next chapters we will start to work with grids and learn how to make grids. If you keep the defaults of ArcView these files will be all saved in ‘C:\windows\temp’. However other, non-ArcView files, will also be saved in this directory. Therefore it is recommended to store all the new data in a separate folder, like for instance ‘C:\FAO_FISH_GIS\Temp\’, but you can also think of another more appropriate folder name for you of course. If you start a new project you have to set the working directory to this directory of your choice by:

1. In View go to File/Set Working Directory via the menu bar (Figure 13.5).

2. The working directory window will popup and you need to change the name of the working directory to ‘C:\FAO_FISH_GIS\temp’ or any other directory of your choice (Figure 13.6) and click OK. Whenever the directory C:\FAO_FISH_GIS\temp is mentioned, you can also read the folder name you have designated for temporary files.

FIGURE 13.5
Setting the working directory

FIGURE 13.6
Changing the working directory name

13.3. Making surface plots

Surface plots have many applications in fisheries, therefore more detailed information on how to make surface plots/grids is given in this chapter. The basic characteristics of a surface plot or grid are similar to those of contour lines; it connects data points with similar values. The large difference of a grid, if compared with contour lines, is that the areas in between two points also have a value added to their pixels, by an interpolation.

13.4. How the interpolation of the data works

In Figure 13.7, topographic levels in the coastal area of Pais Pesca are presented with two values highlighted; one low value of 1 metre in the south and one of 40 metres in the north.

FIGURE 13.7
Two topo levels in the coastal area of Pais Pesca

In Figure 13.8 the theoretical topographic levels of 12 points between the two extreme points (the extremes in green, data point 1 and 14) are calculated. It is assumed that the topographic gradient is linear in relation to the distances between the two points. The exact way ArcView interpolates is more complex as it interpolates between all data points or a selected number of data points simultaneously so that you get a kind of web of calculation. For more details on the interpolations, see the notes below.

FIGURE 13.8
Theoretical example of Interpolation

Note 1: Surface interpolators

The surface interpolators in ArcView make certain assumptions about how to determine the best estimated values. The values represent how the sample points are distributed. No matter which interpolator is selected, the more input points and the greater their distribution, the more reliable the results.

The Inverse Distance Weighted (IDW) interpolator assumes that each input point has a local influence that diminishes with distance. It weights the points closer to the processing cell greater than it does those further away. A specified number of points, or optionally all points within a specified radius, can be used to determine the output value for each location.

The Spline interpolator is a general-purpose interpolation method that fits a minimum-curvature surface through the input points. Conceptually, it is like bending a sheet of rubber to pass through the points, while minimising the total curvature of the surface. It fits a mathematical function to a specified number of nearest input points, while passing through the sample points. This method is best for gently varying surfaces such as elevation, water table heights, or pollution concentrations. It is not appropriate if there are large changes in the surface within a short horizontal distance, because it can overshoot estimated values, and no barriers can be set.

Note 2: Kriging

Kriging is an interpolation method available in Spatial Analyst, however you need to be able to do a bit of Avenue programming to be able to apply this. Readily available Kriging tools can be downloaded from the internet (at for instance: http://gis.esri.com/arcscripts/index.cfm, or http://www.absc.usgs.gov/glba/gistools for Spatial Tools [Spatial Tools is an ArcView extension that contains a collection of 32 tools that extend the capabilities of Spatial Analyst]). Kriging is based on the regionalized variable theory, which includes drift, random correlated components and noise. Kriging produces a statistical optimal surface grid and indicates with a variogramme where your plots are getting into problems. More information on Kriging is provided in Annex C: Kriging on page 155.

13.4.1. The topographic map of Pais Pesca

The best way to explain how to make a surface plot is to carry out an example, and for this we use the elevation levels of Pais Pesca. In 1999 the Department of Geography of Pais Pesca carried out a topographic survey all over the country. The data collected are presented in Figure 13.9.

FIGURE 13.9
Histograms of elevation of Pais Pesca

You will see immediately that the elevation levels in the northwest are highest, as the area is hilly. The elevation decreases in the south, as here are the coastal plains. Make a topographic map of Pais Pesca by interpolating the values lying in between the data points in Figure 13.9. This is done by making a surface plot with Spatial Analyst.

1. Start ArcView.

2. Start new Project.

3. Make sure that Spatial Analyst is set to default in the Extensions window (menu bar: File/Extensions...).

4. Open a new View.

5. Set the projection of the view to Projections of the world/Equal area cylindrical and set the distance units in meters.

6. Set the working directory to your directory of choice, for instance: ‘C:\FAO_FISH_GIS\temp’. (menu bar: File/Set Working Directory...).

7. Add the Theme ‘Pais_pesca country.shp’ from the folder \11_PPTopo from the CD.

8. Add the Theme ‘Pais pesca elevation.shp’. This is a point shapefile with elevation values as measured by the Department of Geography.

9. Activate the ‘Pais Pesca elevation’ Theme.

10. Go to Surface/Interpolate Grid... via the menu bar (Figure 13.10).

11. The Output Grid Specification window will pop up (Figure 13.11). In this menu the characteristics of the newly created grid are specified. Select ‘Same as View’ in the Output Grid Extent box, which means that the new grid will cover the whole View, including the areas not visible on the screen. If you select ‘Same As Display’ the grid will only be made for the area we see at that moment on the screen.

FIGURE 13.10
Start surface interpolation

FIGURE 13.11
The Output Grid Specification window

12. Enter as output grid cell size 1000 metres. Each created pixel will have a size of 1000 x 1 000 metres or 1 square kilometre. The number of rows and columns will automatically adjust according to the specification of this cell size, after you press the enter key on your keyboard. Click OK. Attention!: You need to realize that the lower the Output Grid Cell Size is, the higher the number of cells to be calculated is. Later on in this chapter you will have to make interpolations, calculations, and queries with cell sizes of 100 metres (giving a cell area of 10 000 m2, or 1 hectare). If you do this for the whole of the ‘Pais pesca country.shp’ Theme, your PC has to calculate approximately 3 800 cells times 4 000 cells (depending on the projection) meaning 15 200 000 cells! While now with the cell size 1000 metres (meaning a cell area of 1 000 000 m2, or 1 km2) the PC only calculates 412 cells times 371 cells, 152 852 almost thousand times faster!

13. The Interpolate Surface window will pop up (Figure 13.12). In the method we can choose between ‘Inverse Distance Weighted’ (IDW) and the ‘Spline Interpolator’ In this case we select ‘IDW’ as we have irregular variation in the hilly area in the northern part of the country.

14. As Z-value, the value to be interpolated, we select ‘Elevation’. The other settings i.e. Number of Neighbours, Power and Barriers we do not change[8].

FIGURE 13.12
Progress of surface interpolation

FIGURE 13.13
Interpolate Surface window

15. Click OK, the interpolation starts, and a blue bar in the right bottom corner indicates the progress of the interpolation (Figure 13.13).

After some time the interpolation is complete and the created grid file will be added automatically to the View. Move the Pais_Pesca_Country.shp theme above the surface plot theme. (Figure 13.14).

FIGURE 13.14
The generated grid for the topography of Pais Pesca

Note:

When you create new grid files, they are automatically stored in the default temporary directory, often ‘C:\windows\temp’ or ‘C:\temp’. If you carry out a number of different analyses, they are all stored there and are later difficult to separate. Therefore it is strongly recommended to make for each analysis a separate directory, e.g. if you work with a shrimp theme you could make a temporary directory ‘C:\temp\shrimp\’ and set the working directory for each project you carry out for the shrimp analysis to this temporary directory. Set the working directory in a project by going from the view of a project via the menu bar to File/Set Working Directory.

For all our exercises we need to set the working directory to a directory of your choice, for instance C:\FAO_FISH_GIS\temp.

In the example you created a new Grid called ‘Surface from topography’ this is stored as ‘C:\FAO_FISH_GIS\temp\sface1’ (if you used the working directory C:\FAO_FISH_GIS\temp\). The next interpolation you make will be saved as ‘C:\FAO_FISH_GIS\temp\sface2’. As you understand, the numbering is done automatically by ArcView. If you make a number of interpolations and you want to use one of them later in another project, you will have difficulties finding it again. You can, however, save the newly created surface grid under a name of your own choice just after you have made it by going to Theme/Save Data Set... via the menu bar. If you forget this, it is not easy to change the names later.

Naming convention:

The maximum number of characters of a name in ArcView is 13. No spaces or periods are allowed, and you must not put an extension. ArcView will not recognize grids located in paths containing periods (“.”) or spaces (“ “). This applies to all new grids made by Map calculation, Surface interpolation, Queries and Reclassification.

In the following exercises you will see how to convert a shapefile to a grid file. The new created grid is automatically saved as ‘C:\FAO_FISH_GIS\temp\nwgrd1’; the second one as ‘C:\FAO_FISH_GIS\temp\nwgrd2’, etc. You can give the grid a name of your own choice by changing the name, ‘nwgrd1’, in the window once it appears. Again, changing the name later and finding your files is difficult.

The topographic level of Pais Pesca varies from 1 to about 700 metres. After the generation of the surface grid ArcView automatically divides the grid level in equal intervals. In our case it means that small differences in the topography in the plains and coastal area are not visible. Appropriate legend and classification is something you have to do yourself. If you do not remember how to do that, have a look at page 15, Changing the number of classes in a legend. Our selection is presented in Figure 13.15.

FIGURE 13.15
Topography Pais Pesca

Tip: Saving and Loading a legend style

Creating a legend is usually time consuming. Hence, once you have created a legend it is recommended to save these legends so that it can be later used for the same grid or with a newly generated grid (Figure 13.16) by opening it in the legend menu. To save a legend of the active Theme, open the Legend Editor (either by double-clicking the Theme, or by going to: Theme/Edit Legend...), click on Save. The Save Legend window will pop-up. Give the legend style an appropriate name, and navigate to an appropriate folder where you want to save the file containing the legend style. Once you have done that, click OK. The file will now be saved with the name you have given it, and the extension ‘.avl’.

Loading a legend style you have made before is easy: activate the Theme which you want to use the saved Legend for, open the Legend Editor (either by double-clicking the Theme, or by going to: Theme/Edit Legend...). Click on Load, and navigate to the correct file in the correct folder (remember that the file needed will have the extension ‘.avl’). Select the file, and click OK.

FIGURE 13.16
Saving a legend style

The generated topography grid from Pais Pesca looks fine. However, we see immediately something strange; the interpolation is carried out over the borders of Pais Pesca. To solve this situation the generated grid can be improved by setting a mask before carrying out the surface interpolation.

13.5. How to set a mask in a GIS analysis

We will carry out the same exercise as before, but now with the Pais Pesca borders giving the boundaries of the analysis. First we have to know how to set the boundaries for a GIS analysis.

There are two ways to set the boundaries for an interpolation or analysis, and the way they work are fundamentally different.

FIGURE 13.17
The difference between a mask and a barrier during interpolation in ArcView

Masks can only be set with grid files. The next example shows how to convert a shapefile into a grid file.

13.5.1. Pais Pesca: Topography with mask set

Making the mask

1. Start ArcView.

2. Start a new project.

3. Open a new View. Set the projection of the view to Projections of the world/Equal Area Cylindrical and set the distance units in meters.

4. Set the working directory to ‘C:\FAO_FISH_GIS\temp’, or another directory of your choice.

5. Add the ‘Pais_pesca_country.shp’ Theme from the ‘11_PPTopo’ folder.

6. First we will make a mask by converting this polygon shapefile to a grid file. Activate the Pais_pesca_country shapefile. Go to Theme/Convert to Grid... via the menu bar (Figure 13.18).

FIGURE 13.18
Going to Theme/Convert to Grid

FIGURE 13.19
The Convert to gridname window

7. The Convert to gridname window will popup (Figure 13.19). If you have set the working directory correctly the new grid will be saved as ‘nwgrd1’ in the subdirectory ‘C:\FAO_FISH_GIS\temp[9]. Change this name in the Grid Name box to Pais_pesca[10] and click OK.

8. The Conversion Extent window will popup. As Output Grid Extent we keep ‘Same As Display’ in the Output Grid Cell Size box we fill in 1 000 (Figure 13.20) This will again gives us pixels with a real size of 1 square kilometre. If meters are not indicated after the cell size box it means that you forgot to set the proper projection or distance units in the View Properties window. Click OK.

9. The Conversion Field window will popup, select ‘ID’ as Field (Figure 13.21) and click OK.

10. The conversion will start and you will be asked: ‘Join feature attributes to grid?’ and ‘Add grid as theme to the view?’ in both cases you click Yes and the generated grid will appear in the View. Zoom in at the borders and you will see the pixels (Figure 13.22). You can increase the resolution by decreasing the pixel size to 100 metres[11] but this will increase file size from 90000 bytes to 500000 bytes and therefore will take almost ten times more time to be ready.

Interpolation with the Pais Pesca grid set as mask

FIGURE 13.20
Setting the output extent

FIGURE 13.21
Selecting the field used in the grid conversion

FIGURE 13.22
The created grid file of Pais Pesca

The interpolation is carried out as described before (on page 48), first we set the mask[12].

1. Go to Analysis/Properties via the menu bar (Figure 13.23).

FIGURE 13.23
Opening the Properties of an analysis

2. The Analysis Properties window will popup. Here we only[13] fill in the last window Analysis Mask (Figure 13.24) where we select ‘Pais Pesca’ the grid we just made before, Click OK.

FIGURE 13.24
Selecting the mask for an analysis

The mask is set and we carry out the analyses exactly as before.

3. Check if the working directory is set properly.

4. Add the ‘Pais Pesca elevation’ Theme, and activate it. Activating a Theme means that the legend of this Theme looks elevated (higher than the rest). It does not matter whether or not the check box is checked.

5. Go to Surface/Interpolate Grid via the menu bar.

6. The Output Grid Specification window will pop up. Select ‘Same as View’ in the Output Grid Extent box. Enter Output Grid Cell Size again as 1 000 meters, click OK.

7. The Interpolate Surface window will pop up. Select ‘IDW’ as topographic levels can change quickly, especially in the hilly areas. As Z-value we select ‘Elevation’, click OK.

8. The interpolation will start and the created grid will be added to the view.

9. Manipulate the legend and the colours and you will find the grid as presented in Figure 13.25. Do not forget to make the no data legend without colour.

10. Click with Identify on the grid outside the borders of Pais Pesca. What do you see?

11. Do not forget to save your surface grid now under a different name (menu bar: Theme/Save Data Set...). Once you have saved a grid with the name you choose, add that grid to your View and delete the original Theme, so that there will not be any confusion later on (see also page 52).

FIGURE 13.25
Topographic map of Pais Pesca created with a mask set

Note:

Once the mask is set it will remain attached to this view. With all other analysis carried out in this view this mask will be considered. If you do not want a mask in another analysis, you will have to remove it. Check always before you carry out an analysis the Analyses Properties otherwise you can get unexpected results. Imagine what will happen if you have set your mask for the coastal districts and afterwards you want to carry out an analysis for the whole country.

13.5.2. Histogram of created grid files

To get a quick look at the characteristics and distribution of a grid we can use the Histogram function. Activate the newly create grid, click on the Histogram Icon, the histogram of the distribution of pixels over the different classes will appear. On the X-axis you will find the different classes of elevation, while the Y-axis shows the number of pixels (Figure 13.26).

FIGURE 13.26
Distribution of land with different elevation in Pais Pesca

In our case the area of each pixel is one square kilometre as we selected 1000 metres as output pixel size. It can be deducted from the histogram that the elevation class 5-10 metres has the largest area, 20 000 km2. Fill in the following table (Table 13.1):

TABLE 13.1
Areas of different elevations

Land elevation

Area
(Km2)

1-5


5-10

20 000

10-15


15-20


20-50


50-100


100-150


150-200


200-400


400-700


13.5.3. Pais Pesca salinity grid and water depth grid

Open a new Project, and a new View. In the View, Add the Themes from the ‘11A_Salinity_Grid’ folder: ‘pais_pesca_country.shp’, ‘salinity.shp’, ‘Pais pesca coastal depths.shp’, ‘Pais pesca sea boundary.shp’, and ‘pais pesca salinity boundary.shp’.

1. Check the working directory (for instance: ‘C:\FAO_FISH_GIS\temp’).

2. Set the Projection of the View to Projections of the world/ Equal-Area cylindrical and set the distance units in meters.

3. Convert the two Themes ‘pais pesca salinity boundary.shp’ and’ Pais pesca sea boundary.shp’ to a grid (via menu bar: Theme/Convert to Grid...) with a grid size of 100 metres, give them an appropriate name[14].

4. Make a salinity grid by interpolating the Theme ‘salinity.shp’ (menu bar: Surface/Interpolate Grid...), with 100 metres output grid cell size and the Salinity boundary grid set as mask (Figure 13.27). Be patient with the interpolation, this might take a long time. If it takes too long for you, try a grid cell size of 1 000 metres. Of course, the area of a pixel will change then as well.

5. Make a histogram of the grid. What is the real area of 1 pixel[15]?

6. Make a coastal depth grid, with 1 000 metres grid size and the Sea boundary grid set as a mask (Figure 13.28).

7. Make a histogram of the grid, what is the area of 1 pixel?

FIGURE 13.27
Salinity levels in the coastal areas of Pais Pesca

FIGURE 13.28
Depth of the Bodor sea


[8] Please read the more specialized reference books for information on these settings and when to change them.
[9] If you do not see C:\FAO_FISH_GIS\*.* (or another directory of your choice), you forgot to set the working directory. Start again after you have set it.
[10] Do not forget the naming convention! Just try to type ‘Pais pesca’ and see what happens.
[11] Try this out yourself.
[12] In ArcView 3.0 the mask is set in the interpolation menu.
[13] The rest of the options are not discussed in this manual. Please refer to the handbooks.
[14] Do not forget the naming convention.
[15] As the pixel is 100 metres * 100 metres, the area is 10 000 m2, which equals to 1 hectare.

Previous Page Top of Page Next Page