spatial analyst
Post on 26-May-2017
239 Views
Preview:
TRANSCRIPT
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
1
This tutorial stems from the Spatial Analyst Tutorial prepared by ESRI for ArcGIS 10, but it is a simplified and a different one. It is recommended that once you have completed this tutorial, you go through the ESRI’s tutorial and further expand your understanding of the potential of Spatial Analyst. The town of Stowe in Vermont has experienced an increase of families with children and it is considering building a new school. As a citizen advocate for the public interest you are volunteering your GIS knowledge to help community organizations that represent children’s interests to propose a suitable site. To come up with some preliminary alternatives for the school site you have identified three simple criteria:
1. The new school should not be located close to existing schools 2. The new school should be located nearby recreational facilities 3. The new school should be built on suitable land use
You have also collected the appropriate GIS datasets that will support these criteria (courtesy of the state
of Vermont and prepared by ESRI), and you are now ready to start your analysis. It is also assumed that
you have copied the folder ‘sa’ and its files and subfolders somewhere accessible.
Step 0 - Enable Spatial Analyst and explore the datasets
Start ArcMap and click on menu Customize>Extensions, check Spatial Analyst and close the dialog
Extensions. This will load the Spatial Analyst extension.
Click on menu Customize >Toolbars and check Spatial Analyst. This will add a few Spatial Analyst
functions to the ArcMap interface via a new Toolbar.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
2
Now click over the red button for the ArcToolbox and take a look at the Spatial Analyst functions
organized in tools and toolsets. There are approximately 170 tools. These tools are not visible if the
Spatial Analyst extension is not loaded.
Now that you have enabled the Spatial Analyst we will add the data collected for our study area.
Close Tool Box and click on button ‘Connect to Folder’ to set a connection with the folder ~\sa
under which you stored the data for this tutorial.
Click on the Add Data button (plus sign icon) and bring all the data into ArcMap. Press shift key,
highlight them all and click on Add Data.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
3
You have added five datasets to ArcGIS. Two of them are in a raster format called grid (elevation
and landuse). The Elevation dataset is a continuous surface grid, the Landuse dataset is a discrete
values grid. ArcGIS draws the data with random symbols. Go over each of the data layers one by
one and explore them. You may want to re-arrange them and/or change symbols and set
transparencies. But you definitely want to view the information in their attribute tables. For this:
Right-click over each layer and Open Attribute Table. Scroll through fields and records to get a feel
for the data.
Save the project in the folder sa and name it sa.mxd.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
4
Step 1 - Set the Analysis Environment
Click on Geoprocessing > Environments.
Click on Workspace.
For Current Workspace navigate to ‘data_sa’ and click Add then OK. This is the workspace where
the data is coming from.
For Scratch Workspace navigate to ‘outputs’ and click Add then OK. This is the workspace where
the project will by default store the new data that you will create during the tutorial.
Click over Geoprocessing > Environments >Processing Extent and for Extent pick ‘Same as layer
elevation’. Click OK.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
5
Click over Geoprocessing > Environments>Raster Analysis and for Cell size pick ‘Same as layer
elevation’. Click OK.
Note: All raster outputs that will be created with this project will have the same cell size as your elevation layer. The elevation grid has a larger cell size (30 meters) than the landuse grid. It is very important to recognize that setting your analysis to the layer with the smaller cell size will not improve the accuracy of your results. Remember a cell is the unit to which the data is aggregated.
Now save the project one more time and let’s try to make it look a bit nicer. We will create a hillshade or a
shaded relief of the elevation layer in your project.
Click on ArcToolbox > Surface > Hillshade
Pick Elevation from the Input raster drop down, leave the rest to defaults except for the Z factor.
Enter 0.3048 for the Z factor and click OK.
After a few seconds of watching the status bar you should see this.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
6
And now drag the landuse on top of the hillshade you just created. Go under its Properties and
click the tab Display. Change transparency to 30% and click OK. You should now see smth like
this.
We will not be using the Elevation or the Hillshade any further in this tutorial but they helped us
visualize the town of Stowe a bit better. We are now ready to start our analysis. Time to save the
project again.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
7
Step 2 – Derive new datasets
In this step we will create two new datasets: one showing distance from recreation sites and one showing
distance from schools.
Go in the ArcToolbox > Spatial Analyst Tools > Distance > Euclidean Distance.
For ‘Input raster of feature source data’ pick ‘rec_sites’, leave the rest to default, click OK and
watch the status bar. After a few seconds a new layer must have been added to your project
looking smth like this.
Now repeat the same steps to create the layer showing distance from the schools. You should get smth like
this.
Save your project.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
8
Step 3 – Rank the datasets
The two grids that we just created are continuous surface grids. Their symbology defaulted to 10 classes by
ArcGIS. But that is just a visual representation of the datasets. In this step we will classify these two grid
datasets into 10 spatial categories. These categories will serve as a common measurement amongst them.
Each of these categories (1 to 10) will be defined based on distance from schools or recreation sites. We
will give a value to these distance based rings based on the criteria of our project. The more suitable the
area, the higher its value. Let’s get started.
Reclass school distance grid.
Go in the ArcToolbox > Spatial Analyst Tools > Reclass > Reclassify
For ‘Input raster’ pick EucDist_scho1
For ‘Output raster’ rename the default file to: Recl_schools (you can’t name grid files with more
than 13 characters, if you ask why, the answer trails back to the precursors of ArcGIS)
Click OK and watch the Status Bar.
You will get smth like this.
Click over Properties > Symbology > Color Scheme and pick a continuous scheme that better
represents our classification. Pick it so that the darker the shade the higher the suitability value.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
9
Reclass recreational sites distance grid.
Go in the ArcToolbox > Spatial Analyst Tools > Reclass > Reclassify
For ‘Input raster’ pick EucDist_rec_1
For ‘Output raster’ rename the default file to: Recl_rec
Click over button ‘Reverse New Values’ (as we want higher values for rings closer to the sites)
Click OK and watch the Status Bar.
Once the new grid has been added to your project, change its symbology as you did with the
reclassed distance for schools. The darker the shade the most desirable the location.
Reclass the landuse grid.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
10
We will reclass the landuse based on its use designation. Go in the ArcToolbox > Spatial Analyst
Tools > Reclass > Reclassify.
For ‘Input raster’ pick landuse, for ‘Reclass field’ pick ‘LANDUSE’, for ‘Output raster’ rename the
default file to ‘Recl_land’
Highlight ‘water’ and ‘wetland’ and click button ‘Delete’.
Change New Values as shown in the dialog below.
Now check the ‘Change missing values to NoData’ to set Water and Wetland values to NoData.
Change other symbols to better represent land uses. For ex. Build up (value 3) should be orange,
forests (value 4) dark green and all else somewhere in between.
Click OK, watch for the new layer to be added and Save project.
Once the layer has been added, highlight and right-clik on it to go under Properties > Symbology
and click over button ‘Display NoData as’. Pick color white. This will be your symbol for Water and
Wetlands. Remember, the areas represented by NoData cells are excluded from overlay analysis.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
11
And the map should look similar to this, with Agriculture being the most suitable land use.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
12
Step 4 – Weight and Combine reclassed grids into one suitability map
We will now combine the three reclassified grids to find the most suitable locations. But before, let’s also
set some priorities. Not all of these datasets are equally important. The advocates that you are representing
would like to place more emphasis to proximity to recreational sites making this a more influential criterion.
Therefore, you will give the following weight (or percent influence) to your grids.
Reclassed distance to recreational sites: 0.5 (50%) Reclassed distance to existing schools: 0.2 (20%) Reclassed landuse: 0.3 (30%)
The three grids should look smth like this in your project.
Reclassed landuse Reclassed distance to recreational sites Reclassed distance to schools
Go now in ArcToolbox > Spatial Analyst Tools > Overlay > Weighted Sum
For ‘Input rasters’ bring all three grids one by one and for ‘Output raster’ rename default file name
to suitmap.
Under ‘Weight’ enter weight coefficients as shown in the dialog below and click OK.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
13
After the process runs and the suitability grid gets added to your project, chances are that its legend has
defaulted into lighter colors for higher values. Let’s reverse that by going under Properties > Symbology >
Color Scheme and pick a color ramp that uses darker shades for higher values (map below was created by
picking the 7th ramp in the raw, you can pick anyone you like).
As it can be seen by the legend the highest value in this grid is 9.2. Please also note that this grid is a
continuous surface grid. Try to open its attribute table. The menu ‘Open Attribute Table’ is disabled.
We will now select out only those areas (cells) that have a value of 9 - 9.2.
At the Spatial Analyst toolsets go under Map Algebra > Raster Calculator.
Build the query as shown in the Raster Calculator dialog below, rename default output file to
‘topsuitmap’ and click OK.
suitmap
High : 9.2
Low : 3.4
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
14
Once a new grid has been added, change its symbol for value 0 to a hollow symbol and its symbol for value
1 to red (double click on symbol). The red area now shows the top suitable locations.
Although we see graphically where the best locations are, we do not know at this point whether there is
enough land to build a school. Our next steps are about finding just that.
Highlight/Right-click over the layer ‘topsuitmap’ and open it’s Attribute Table. You can now see that
the menu ‘Open Attribute Table’ is enabled, which means that the grid is a discrete grid.
In the attribute table the field Count stores the number of cells with a particular value. We see that
we have 1,971 cells in the red area. But what does this mean?
We know that the cell size of our Analysis Environment is 30 meters x 30 meters (to double check, go
under the tab Source of the Properties of the layer ‘elevation’). This means that each cell has an area of
900 square meters. By multiplying cell counts with the area of one cell we can find our total area. We will
now add a new field to the attribute table to calculate and store the total area.
Click over the top left button of your Table dialog and click on Add field menu.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
15
In the Add Field dialog, enter Acres for Name, pick Long Integer for Type and click OK.
Right click over the new field Acres and click over Field Calculator.
Enter the expression shown in the dialog below to calculate area in square meters and click OK.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
16
Right click again over the field Acres and click over Field Calculator. You will now convert square meters to
Acres knowing that 1 square meter = 0.000247105381 acres.
This time enter the expression: [ACRES] *0.000247105381 and click OK.
We can now see that there are 438 acres in the red area.
Let’s now zoom in closer to the red area. We can see that some of the cells are not contiguous and
therefore will not be of much use to us. So our next and last step in this project is to try to filter out as much
as we can the scattered small areas that are represented by one, two or more cells.
At the Spatial Analyst toolsets go under Generalization > Majority Filter. This function replaces cells
based on the majority value in their immediate surrounding cells. If one of our red cells is
surrounded mostly be cells with a lower value, this means that we do not much need that cell for
our school (too small area) and that we can safely assign it the same value as the majority of the
surrounding cells.
For Input Raster pick ‘topsuitmap’, for Output Raster rename default file name to ‘lastsuitmap’.
For Number of neighbors to use, pick FOUR, for Replacement threshold pick HALF.
Click OK.
University of Florida, School of Landscape Architecture and Planning, URP4273, Prepared by Juna Papajorgji
17
After the ‘lastsuitmap’ grid is added to the project, as you did with the ‘topsuitmap’, change its symbology to
look similar to the map below.
You can now see how we eliminated most of the scattered cells. Please note that this process can be
repeated again with the yellow areas to eliminate some more scattered cells. You can also look at the
attribute table of the ‘lastsuitmap’ grid (yellow area) to see the acreage we lost as compared to the
‘topsuitmap’ grid.
At this point your job as a GIS professional is done. This is just a preliminary stage in the process of
locating a new school. Site specific analysis will now be conducted by urban planners and then public
participation will be sought prior to making a final decision.
This tutorial ends here, but your work should continue. A useful follow up exercise could be to automate
this entire process via the Model Builder. The Model Builder can convert the sequences in this process into
a model. Once you have built a model, you can easily rerun this entire process with new data (when you
find better ones), with modified variables (such as for the weight and classes that we used), and you can
therefore optimize your results and/or also offer several alternate results for consideration.
top related