Overlap Analysis

739
8
Jump to solution
11-12-2013 07:02 AM
MatthewFriesen
New Contributor
Hello and thank you in advance for any suggestions to my question.
I am attempting to create an output that conveys locations with overlapping features. I have between 4 and 5 layers in polygon and polyline format. I would like to show areas that overlap on a scale base (areas that overlap 1-10 times using a graduated symbology format). The output may either be in raster or polygon form but I would like it to convey a type of "hot-spot" analysis where areas that overlap more times than others are described using a graduated symbology. Thanks.
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor
Hello and thank you in advance for any suggestions to my question.
I am attempting to create an output that conveys locations with overlapping features. I have between 4 and 5 layers in polygon and polyline format. I would like to show areas that overlap on a scale base (areas that overlap 1-10 times using a graduated symbology format). The output may either be in raster or polygon form but I would like it to convey a type of "hot-spot" analysis where areas that overlap more times than others are described using a graduated symbology. Thanks.


Hi Matthew,

You can go either way:

Raster (required Spatial Analyst)
You can convert each polygon and polyline to a raster, then for each raster you can convert it to a 1/0 raster (1 being present, 0 being non present). To do this use the Raster calculator or directly in the Python window with something like:

import arcpy from arcpy.sa import * myRas = 'NameOfRasterInTOC' myRes = Con(IsNull(myRas),0,1) myRes.save(r'C:\Path\To\Output\Folder\or\filegeodatbase.gdb\RasterName')


When all the occurrence rasters are created then simply sum them and the cell value will represent the number of feature classes (lines and polygons) that overlap that pixel. If you want to apply a weight you could also use something like weighted sum.


Vector
With vector you would have to use Union (repeatedly if you don't have access to Desktop Advanced). To also be able to include the polylines (and still have polygons as output), it's best to convert them to polygons by applying a small buffer. With each union you will obtain a feature class with the combined polygons. The output feature class will contain a FID_<name> attribute for each of the input feature classes. Use this field to determine if that featureclass was present for a certain feature. A value -1 will indicate that it's not present.

Use the field calculator to create occurrence fields based on these FID_<name> fields (-1 should be 0, rest of value should be 1) and sum these fields to obtain the number of features at a certain location. Symbolize on that field.

Kind regards,

Xander

View solution in original post

0 Kudos
8 Replies
XanderBakker
Esri Esteemed Contributor
Hello and thank you in advance for any suggestions to my question.
I am attempting to create an output that conveys locations with overlapping features. I have between 4 and 5 layers in polygon and polyline format. I would like to show areas that overlap on a scale base (areas that overlap 1-10 times using a graduated symbology format). The output may either be in raster or polygon form but I would like it to convey a type of "hot-spot" analysis where areas that overlap more times than others are described using a graduated symbology. Thanks.


Hi Matthew,

You can go either way:

Raster (required Spatial Analyst)
You can convert each polygon and polyline to a raster, then for each raster you can convert it to a 1/0 raster (1 being present, 0 being non present). To do this use the Raster calculator or directly in the Python window with something like:

import arcpy from arcpy.sa import * myRas = 'NameOfRasterInTOC' myRes = Con(IsNull(myRas),0,1) myRes.save(r'C:\Path\To\Output\Folder\or\filegeodatbase.gdb\RasterName')


When all the occurrence rasters are created then simply sum them and the cell value will represent the number of feature classes (lines and polygons) that overlap that pixel. If you want to apply a weight you could also use something like weighted sum.


Vector
With vector you would have to use Union (repeatedly if you don't have access to Desktop Advanced). To also be able to include the polylines (and still have polygons as output), it's best to convert them to polygons by applying a small buffer. With each union you will obtain a feature class with the combined polygons. The output feature class will contain a FID_<name> attribute for each of the input feature classes. Use this field to determine if that featureclass was present for a certain feature. A value -1 will indicate that it's not present.

Use the field calculator to create occurrence fields based on these FID_<name> fields (-1 should be 0, rest of value should be 1) and sum these fields to obtain the number of features at a certain location. Symbolize on that field.

Kind regards,

Xander
0 Kudos
MatthewFriesen
New Contributor
Thank you so much for your reply Xander. I will give this a try today and let you know how it goes.
0 Kudos
MatthewFriesen
New Contributor
Thanks Xander. I was able to convert all features to raster. I used the union tool to create a single output for the vector route as well. I am having trouble at the next step. I am looking to create a layer which describes how many times these features overlap (ie: if there are whales inside the critical region, and ships pass through it has 3 overlaps. Regions which have no whales but do have ships and critical areas only have 2 overlaps). I am unsure how to calculate this step.
0 Kudos
MatthewFriesen
New Contributor
Sorry for posting so much. I was able to sum the various raster layers using Raster Calculator. Thank you again Xander. Now my question is pertaining to adding raster layers with weighted fields. One of my layers contains data that is weighted between 0 and 1. Is it possible to add all other layers normally (as in adding them together using a value of 1) and add this special layer based on the spatial location of the weighted fields (ie: if an area with a weight of .5 overlaps with another area, it will be 1.5 and so on). Thank you in advance.

Side-note: Different areas within a single raster have differing weights.
0 Kudos
XanderBakker
Esri Esteemed Contributor
Sorry for posting so much. I was able to sum the various raster layers using Raster Calculator. Thank you again Xander. Now my question is pertaining to adding raster layers with weighted fields. One of my layers contains data that is weighted between 0 and 1. Is it possible to add all other layers normally (as in adding them together using a value of 1) and add this special layer based on the spatial location of the weighted fields (ie: if an area with a weight of .5 overlaps with another area, it will be 1.5 and so on). Thank you in advance.

Side-note: Different areas within a single raster have differing weights.


Hi Matthew,

If your individual rasters already contain a weight (e.g. values ranging from 0 - 1), you can simply add the rasters together. Maybe you will have to force integer rasters to float with "Float(myIntegerRaster)" to avoid that the values will be truncated.

I don't think a "Weighted Overlay (Spatial Analyst)" in that case is what you are looking for. Also the "Weighted Sum (Spatial Analyst)" let's you add a weight per raster, but that's not necessary if your raster values already contain that weight.

The weighted overlay and sum are meant for assigning a weight to each individual raster. So if the occurrence of a critical area is more important than the presence of ships, this can be done with these tools.

If you want to make things more complex there is a thing called "Applying fuzzy logic to overlay rasters". For now I would stick to simply summing the rasters.

Kind regards,

Xander
0 Kudos
MatthewFriesen
New Contributor
Thank you Xander. I was able to add the raster layers using the raster calculator and the Con(isNull(myraster) ,0 ,1) formula. This provides an output that sets the relative raster layer to 1. Would this code not set a raster layer with pre-determined values between 0 and 1 all to a value of 1? I would like to keep the values inside this raster, unless I add it at the end without applying the Con(isNull) , 0, 1) statement?
0 Kudos
XanderBakker
Esri Esteemed Contributor
Hi Matthew,

That is correct. The expression "Con(IsNull(myraster) ,0 ,1)" will create a binary output with only 0 and 1 values. This should only be used if you are interested in the number of rasters that have information at a cell.

In your case your would have to use "Con(IsNull(myraster) , 0 , myraster)". This creates an output where NoData is replaced by the value 0. Please note that if you would add rasters that hold NoData (NULL) values, that the result of a sum will be NoData, regardless of other rasters that may have values defined for that pixel.

See also: NoData and how it affects analysis

Kind regards,

Xander
0 Kudos
MatthewFriesen
New Contributor
Thank you again Xander. You have been a great help!
0 Kudos