Polyline Overlap Count

2388
3
Jump to solution
05-16-2013 04:10 AM
DwightLanier
New Contributor III
Hi all,

I'm looking to use a file with GPS traces of animal paths through a study area and show places where they have passed more frequently.  Each path is a separate feature and counts a one journey through the area.  A simple case of this would be satisfied by giving each feature an attribute table value of 1, using the polyline to raster tool, and then summing all rasters (after recoding NoData to 0, of course).

But I do not have that simple case.  The problem comes when one path travels over itself at some point within the study area.  An example would be like something the shape of a lollypop.  An animal travels down the stick, loops around the candy, then travels back up the stick the same way it came in.  While this is one path, the animal used a certain section of the area twice in that traversal, and I am interested in capturing this.  I want the final cumulative raster to reflect even these intra-path overlaps.

Polyline to Raster will not cumulatively add these. 

A final raster would be one that has a simple count integer for the number of times a line passed through each grid cell.  Any ideas?

Thanks!
0 Kudos
1 Solution

Accepted Solutions
DwightLanier
New Contributor III
Okay, kept chipping away at it and figured out a solution.

So intersect seems to have the problem that it only represents overlapping parts of the same line as a single feature.  The good news is that the Clip tool does not do this!  It indeed creates a feature that can be exploded using the multipart tool into separate features within the same shapefile.

Knowing this now, here is how I think I will write a python script to get what I want...which is a grid where each cell tells me how many times a mover crossed that cell.  Whether it be from the same line feature, or other line features, and especially if the happen to exactly overlap:

1. From the fishnet over the study area, select out only the squares that actually contain a part of the path(s)

2. loop through each of these squares and use them to clip the input path(s)

2a. For each resulting clip, explode into single part features

2b. Perform feature count and then use this value to update the currently selected fishnet square in use.

View solution in original post

0 Kudos
3 Replies
markdenil
Regular Contributor II
You should create a fishnet with the same cell size and extent as the raster.
and intersect that with the line FC.
You can then explode the resulting multipart lines
( the bits of the original tracks that fell in the same cell )
so that all the segments (to and fro) are seperate features.

Now you can create a raster with the count of features in each cell.
0 Kudos
DwightLanier
New Contributor III
You should create a fishnet with the same cell size and extent as the raster.
and intersect that with the line FC.
You can then explode the resulting multipart lines
( the bits of the original tracks that fell in the same cell )
so that all the segments (to and fro) are seperate features.

Now you can create a raster with the count of features in each cell.


I have tried the fishnet method with intersect (since posting the original question).  The problem here is if the path is exactly the same going as coming the intersect only creates one line.  In every other way this method works, but if one part of the line identically overlaps itself, then the result is not a multipart in that cell, but a single feature...

Thanks for the reply...but still stuck  =)
0 Kudos
DwightLanier
New Contributor III
Okay, kept chipping away at it and figured out a solution.

So intersect seems to have the problem that it only represents overlapping parts of the same line as a single feature.  The good news is that the Clip tool does not do this!  It indeed creates a feature that can be exploded using the multipart tool into separate features within the same shapefile.

Knowing this now, here is how I think I will write a python script to get what I want...which is a grid where each cell tells me how many times a mover crossed that cell.  Whether it be from the same line feature, or other line features, and especially if the happen to exactly overlap:

1. From the fishnet over the study area, select out only the squares that actually contain a part of the path(s)

2. loop through each of these squares and use them to clip the input path(s)

2a. For each resulting clip, explode into single part features

2b. Perform feature count and then use this value to update the currently selected fishnet square in use.
0 Kudos