Archive

Archive for September, 2009

SWARS Step-by-Step Video Instructions

SWARS Spatial Analysis, The Book: Present the Result

2009/09/18 1 comment

When you produced something, you need to find a good way to present it.  Pretty maps are always helpful.  Conventional wisdom says a picuture is worth a thousand words.  That, is very much true.

So here, I present you a “slightly fine-tuned” map I made from the priority data we just produced in our Palau SWARS example.

SWARS Example -- Palau Map Detailed

This map shows you not only the overall distribution of the three priority land classes (high, medium, low) across the entire island.  It also illustrates the distribution of the three classes within each watershed.  Better yet, the size of each pie is in propotion to the land area of that particular watershed.  I wish I had another adminstrative polygon layer, something like a village boundary.  Since I don’t, I used the watershed layer to run the stats.

Now, how would you tell this story?

SWARS Spatial Analysis, The Book (*About RCV*)

(*)

The Story about RCV

The concept of Raster Class Value(RCV) might be a bit confusing, understandably so.  It’s therefore necessary to paint some more ink on the subject.  I surely do hope this extra effort would be helpful.

Let’s use an example of car buying.  Say you are looking for a new car and have eyes fixed on 3 models B, F, and T.  All 3 of them look rather attractive overall, but each has its distinctive pros and cons.  B is a gorgeous car with great reputation but the price tag is kind of intimidating.  F has its quite unique history and some cultural fame attached, also lots of horsepower.  But F is notorious for its reliability.  T looks rather dull, even boring, but you pretty much get everything from it — reliable, great gas mileage, plenty of accessories, etc.

Obviously, if there is that one criterion you emphasize so much and would not give in a single inch, things would be easier.  For example, if you are absolutely fixed on your budget, then B is likely to be the first one out.  On the other hand, if you definitively do not want to deal with broken car and all that issues for the years to come, you might as well just kick out F first.  If you, however, are determined not to have a vehicle that looks just like the other 90% cars sitting in the shopping mall’s parking lot, I guess a T wouldn’t be your first choice. So you keep looking and comparing and just can’t decided which one is the clear winner.

You look it up on some “expert” websites, and you notice they all use this “comparing chart” thingy.  Basically, they all drum up this numeric “scale” say 1 to 5,  then they break a vehicle down into individual components or features and measure each feature using that numeric scale.  So, you would see model B has a measurement of horsepower-4, gas millage-3, styling-5, etc.  Then by adding up those individual numbers, you get a overall “score” for each model.  Whichever comes up the best would therefore be the number one recommendation for your purchase.  Simple enough.

That numeric scale, is our RCV scheme!

Just like the vehicle evaluation scale, it really doesn’t matter what are the numbers you use.  Using 1 through 5 (step by 1) doesn’t make that much of a difference from using 100 through 500 (step by 100).  The point here is to assess the relative performance/value of each vehicle in that particular feature.  They all have engine horsepower, but 500hp is obviously stronger than 200hp thus deserve 5; getting 45 miles per gallon is definitely more desirable than 15 miles per gallon thus also should be given the top ranking of 5.

For our project, the “vehicles” we are comparing are different locations in our project area.  What we are assessing is their relative importance/significance to the issue we identified to study.

Apparently we don’t seemingly have such distinctive individual “cars” to look at and compare.  What we deal with here, are the individual land cells/grids, say a 10 meter by 10 meter cell!  The features we are measuring are things like distance to river, existence of invasive plants, proximity to fire risk, and being able to contribute to public drinking water system, etc.

The Raster Class Value Scheme is, therefore, just like the numeric scale used to evaluate vehicle features, a common measurement system we create to compare the relative importance of land at different locations in a particular aspect in terms of natural resources or threats.

Having such a relatively objective value system would enable use to conduct an assessment that involves many features/aspects, apply simple but scientific mathematical calculations, and produce clear, understandable, and explainable results.

What is the exact numeric scheme to use?  Really, it doesn’t matter that much.  You should be able to produce the same result using either 1 through 5 or 100 through 500, as I have demonstrated during the Hawaii Workshop.  My only recommendation here is to use a scheme that contains more numeric values than you think you would absolutely need.  If you need at least 5 values, instead of using 1 through 5 (step by 1: 1, 2, 3, 4, 5), you should start by using 1 through 10 (step by 2: 2, 4, 6, 8, 10).
Another important point, you should always make sure you use the full range of the scheme, by at least assigning the highest value in the scheme to the most important class within each layer.  Because if you don’t, you are implicitly applying a layer weighting!!  Leave that to the layer weights!!!

SWARS Step-by-Step Video Instruction — Start

SWARS Spatial Analysis, The Book (9)

(9)

Let’s Model

Mm… That sounds a bit funny —  “let’s model”?

I feel it’s necessary to demystify the concept of “modeling” first, for it sometimes has a repelling effect on people new to it.

Yes, modeling can be a huge and extremely complex project involving thousands and thousands of data inputs and mathematically equations, that will take truck load of Phds to accomplish.  But, modeling can also be as simple as adding two entries together!

Our SWARS spatial analysis is luckily one of the simpler models.  Essentially, we are just adding a bunch of raster layers together to see their aggregated impact on the land.

In this example of studying Palau’s water quality issue, we only have 6 input layers and one mathematical equation!

Again, I throw out this very same point which I have made perhaps a million times: there are always multiple solutions to accomplish a task in ArcGIS! Do you feel a little bit of nausea yet hearing this again?

Remember I showed at least three different ways to implement the final SWARS Weighted Overlay Model Analysis during the Honolulu Workshop?  Well, I do not plan to mess up your brain again in this writing.  Instead, I will only provide one method here.  It’s not the simplest or fastest.  Nor is it the most comprehensive one.  But it is one that is clear and straightforward, and probably matches SWARS spatial analysis methodology materials you find elsewhere.  So, sit tight and fasten your seat belt!

First, we need to create a blanket new model.

Go to the ArcToolbox window (on the left here), select the <Favorites> tab, then right-click in the blank area to open the menu list.  Select <New Toobox…>.  Name the new Toolbox “Palau SWARS Model”.

Then, create a new model by right-clicking on the Palau SWARS Model Toolbox and selecting <New> then <Model…> as shown below.

Open the new Model, click and drag the six prepared input layers into the canvas.  You can do this click-and-drag one layer at a time or select them all first and then click-and-drag all at once.  You will now have the six inputs in the model as seen here.

Next, we need to get this magic <Single Output Map Algebra> tool (SOMA) into the model.

In the ArcToolbox window, switch to <Index> tab.  In the blank area, start typing “single output map algebra“.  You should see the <Single Output Map Algebra> tool (SOMA) poping up in the list at the bottom very quickly.

Now, click-and-drag the tool into the model canvas.  It appears as below.

Use the <Add Connection> tool to link the six input layers into the SOMA tool.

Select the tool fist.

Click on one input layer, then click in the SOMA tool box.  A link is established when you see that arrowed line show up going from the layer to the tool.

Next, open the SOMA dialog by either double-clicking on the tool or right-clicking it and select Open.

When the dialog opens, type Very Carefully in the Map Algebra Expression box this following equation:

prio_watshed * 25 + landcover_rec * 25 + river_rec * 15 + strmbuf_rec * 15 + invasden_rec * 15 + slope_rec * 5

Make sure you have a space/blank between every single layer name and symbol!  This is very important!!

Name the output SWARS_SOMA and click OK.

When the dialog closes and the active window returns to the model canvas, you should now see the SOMA tool box turned into color (as shown below)!  If not, that means you didn’t set the parameters right and the model will not run.

OK, all set and ready, execute the model by clicking the <Run> button or right-clicking the tool box and select <Run>!

One thing here, when the model is done, ArcMap won’t bring in the output raster automatically into the map, kind of strange.

So, I will open a new ArcMap project and add in the result SWARS_SOMA grid.  As you can see, I also put the hillshade layer (created from the DEM) underneath for later visual effects.

Reclassify SWARS_SOMA into a three-class grid using the Natural Breaks method in the reclassify tool.  Name the output raster SOMA_Rec.

Assign SOMA_REC a good symbology (maybe as shown here) plus 35% Transpanrency, and put ontop it the Watershed polygon layer.  Wah-Lah! This is what you will see.

Finally, we just need to calculate the acreage numbers for each priority classes.

Open the attribute table from SOMA_Rec.

Add a new field called “Acres” using Double data type.

Calculate the acres for all three rows/classes using the <Field Calculator…> tool.

Still remember what’s the calculation equation to use?

If you forgot, this is the equation that’s based on cell count, known cell size (10 by 10 meters) and the square meters to acres conversion factor.

And here are the results.

Let me also show you a little map I made from the data.

SWARS Spatial Analysis, The Book (8.5)

(8.5)

Prepare Input Layers
— Slope —

Having processed the previous layers, this one last layer should be just a piece of cake.

So, what do we need to do?  We have the DEM data and we need to make from it a raster valued by the RCV scheme.  Simple.  We take the DEM; create a slope layer first; then reclassify the slope layer using the RCV scheme.

Let’s go!

That’s the DEM, plenty of data but not much to see.

Start the <Slope> tool from <Spatial Analyst> -> <Surface Analysis>.

Setting parameters in the <Slope> tool dialog is pretty simple.  Make sure your input is the DEM; use Degree for measurement; leave the Z Factor as “1“; output cell size should already be 10; and name the output Slope.

Just for a note here, among the 6 input layers I’m using here, this Slope layer is the one which I couldn’t quite figure out how to assign the RCV values for the water quality issue I chose as example.  There are a number of different angles to approach the slope factor when it comes to its impact on water quality and I just can’t justify convincingly ranking the slopes either direction.

So, I chose a kinda weird reclassification: classifying the slope layer into three RCV values with the mid-range slope being the most important.  See the image below.

The result would be a new slope_rec layer as shown below.

We now have all of the six chosen input layers prepared!

Yeah!!

SWARS Spatial Analysis, The Book (8.4)

(8.4)

Prepare Input Layers
— Invasive Species —

How to use the Invasive Species layer is a tricky but very real question.  From what I learned, this is what many islands have that is most close to a Forest Health layer.  The problem is, it is a point layer!  How do we go from a bunch of points to a surface?

One easy to reach answer is, to buffer the points.  Excellent, that is indeed a solution.  If you should choose to go this route, just take pretty much the same steps as in the previous chapter.

But I will introduce a second approach here: use point density.

Using buffer will give you a rough idea where are the areas possibly affected by invasive species.  But using point density will better tell you how are the lands affected.  This opinion might deserve a much longer discussion which I might return to later.

Here is what I will do, technically.

Take a look at the Invasive Species layer I literally made up!

I applied the symbology based on a “ID” field in the attribute table.  This “ID” attribute is something I imagined that would reflect the intensity of the damage at that point, for example, by greater damaging power of certain species.  The higher the ID number, the greater the area is being impacted by the invasive species problem and thus require more attention and more resources for remedy.

A density surface is to be created from this Invasive Species point layer based on that ID field.

First, with the Invasive Species layer highlighted in TOC, locate the <Density> tool under <Spatial Analyst>.

Now, when the Density tool dialog opens, set the parameters as following.

  • Use the Invasive species layer for Input Data.
  • Set the Population Field to “ID“.
  • Choose option Kernel as the Density Type.
  • Type in 2000 (meters) for Search Radius.
  • Area Units will be “Square Kilometers“.
  • 10 (meters) for Output Cell Size should already be used if you set the Analysis Environment appropriately as discussed before.
  • Finally, name the Output RasterInvasDen_R“.

The result looks like this.

Next, same thing again, we need to get it into the RCS scheme.

The way to accomplish that?  Ding! Ding!! Ding!!

Reclassification!!!!

Open the <Reclassify> tool in <Spatial Analyst>.

In the <Classify…> dialog, select Natural Breaks (Jenks) as Classification Method and create 5 Classes.

Type in the New Values according to our RCV scheme with 0 assigned to NoData.

Name the output InvasDen_Rec and run!

Color the result raster up using similar symbology as previously created layers. It should show like this.

Make a copy of the layer into the Palau SWARS Model data frame.

SWARS Spatial Analysis, The Book (8.3)

(8.3)

Prepare Input Layers
— River & Stream —

River and Stream usually would be one layer.  In our example here, they are actually seen differently and separated.  I could merge them together first and then treat it as one layer.  But I left them as two layers and just used different buffers.

However, I will only go through the techniques for the river layer.  Same steps apply to the Stream layer.

The first process is to run a <Multiple Ring Buffer> on the river layer.

Again, go to the <Index> Tab in ArcToolbox and type in “Multiple Ring Buffer” in the keyword blank.  You should see the tool lised already just a few letters into the phrase.

Open the <Multiple Ring Buffer> dialog; select River layer as your Input Features, name the output River_Buf; provided 4 buffer distances at 50, 100, 150, and 200; then select “Meters” as the Buffer Unit; and OK.

When the River_Buf layer is ready, convert it to a raster using the <Features to Raster..> tool and use the Distance field as the conversion value field.  Name the new raster “River_R”.

In ArcMap, open the Layer Properties dialog for River_R layer and go to <Symbology> tab.

** You might be asked to run the raster stats calculation first.  If asked, run it.

Set the layer symbology as shown in the image below.

Make sure you choose “Unique Values” method from the list on the left.

Other than making it look better, there is one important reason and trick why I’m doing this.  Remember, we will need to reclassify this raster into our designated RVC scheme.  This River_R layer as created is a “continuous floating raster” (see below).  It makes is kinda messy to directly use the Reclassify dialog but can be done once you are used to it.

Having the symbology set up as we did will make the reclassify just a notch easier.

Now when you open the <Reclassify> dialog from <Spatial Analyst>, it should be pretty much ready to go, just don’t forget to make sure you assign the right RCV to the Old Values.  For this layer, the closer it is to the river, the more important the land will be!  Thus you need to give higher RCV value to shorter buffer distance.  Shown here is how I assigned the values.

Run the reclassification, name the new raster River_Rec, and bring the new layer to the Palau_SWARS_Model data frame.  Here is what it looks like in a zoomed in area.

For the Stream layer, I only used two buffer distances, 50m and 100m, and reclassified them to RCV of 10 and 5 respectively.  The final Strmbuf_Rec layer should show as below. (zoomed into the same area as the previous image with the River-Rec layer shown underneath.)

SWARS Spatial Analysis, The Book (8.2)

(8.2)

Prepare Input Layers
— Land Cover —

For the Land Cover layer, there isn’t much trick involved.  What we need to do is to first prioritize the land cover classes, and then just make a raster out of it.

So, how do we prioritize the cover classes?  This is one of the two ranking/prioritizing tasks that we need to do through this analysis.

Well, basically, you just need to rank the land cover classes based upon their relative importance to the issue you are trying to address.  That’s about the only principle there is.

Technically, here is how I go about accomplishing the task.

First, I will create a dbf table that lists all the land cover classes the layer has, suppose you don’t already have that master table.  The tool to use is table <Summarize…>.

Open the attribute table of the Land Cover layer.

Right-Click on the Type field, then select <Summarize…> tool.

Pretty much leave the options as default and name the output dbf table “LandCover_Value”.

Once the new Landcover_Value table is brought into the ArcMap project, open up the table, create a new attribute column by using the <Add Field…> tool and call it “ClassValue“.

Now start an Edit session and type in the RCV class values to each land cover class in the new “ClassValue” field.  This is what I used.

Again, I just assigned values almost “casually” here only for the purpose of demonstrating the techniques!

Now, join the new dbf table back into the attribute table of the LandCover layer.

Open the Join Data dialog.  This time, choose “Join attributes from a table” in the first drop-down option; then make sure you select the Landcover_Value table as the table to join to this layer.

Hit OK and run the join.  Open the attribute table of Landcover layer, you should see the columns from the Landcover_value table appended to the end.

We can now convert the polygon landcover layer to a raster grid.

See, you can use a field that is NOT physically in the attribute table to run the conversion as well as other operations.  In this example, we are using a column that is in a joined table.  The field shows up here as if it was part of the table but it’s not physically stored within.  This is a beautiful and useful thing — relational system.  This means we don’t always have to have all information stored in all tables, saving tons of file space.

With Landcover layer highlighted, open the <Features to Raster> conversion tool from <Spatial Analyst>.

Select the Landcover_Value.ClassValue from the Field drop-down list.  Note there is a “.” in the field name?  Why??

Name the output “Landcover-R”.  Run the conversion.

Nice!!  But, are we done with this layer?

The answer would be, “NO”!  Remember, we still got those data gaps to deal with.

NP (no problem), we just use the “Reclassify” tool.  But this time, we don’t need to change the existing values.  We just need to give a new value of “o” to “NoData”!!

Name the output “Landcover_Rec”, and run the tool.  Problem solved!!

Now, move the new layer into the Palau SWARS Model data frame.

Move on!

Add New Points to Existing Layer from GPS Coordinates

I made a short video demonstrating how to add new points to an existing point layer using GPS coordinates.  This is in response to a question fom our friend Francis in Yap. 

 

Part 1 of 2

 

Part 2 of 2

You can access the original video site at: http://www.utipu.com/app/tip/id/16335.

Hope it helps.

Happy Friday!

Categories: GIS Technique, learning
Follow

Get every new post delivered to your Inbox.