How to divide raster into measured segments?

449
13
12-19-2018 06:37 PM
Labels (2)
Highlighted
New Contributor

I am working on a project that analyzes the correlation between land use and food web connectance of aquatic invertebrates in certain streams. In order to accurately analyze the data, I was planning on dividing the streams into four parts based on the length: 500 meters, 1000 meters, 1500 meters, and 2000 meters. I converted the polylines of the streams into rasters so that the distance in meters can be accounted for, but I'm not too sure how to divide these into measured segments. I tried clipping them to buffer rings, but because the streams are not straight, the length of the segments are not exact. Is there a tool I'm overlooking?

Reply
0 Kudos
13 Replies
Highlighted
Esri Esteemed Contributor

To split the lines up at certain distance is something that is better done in vector format (as lines and not rasters). You said that you converted the lines to raster so "that the distance in meters can be accounted for". If you work with you lines in a File Geodatabase, they will have an attribute showing the length of the polyline. In case the value is very small, your dataset is probably using a geographic coordinate system and you could project your data to a projected coordinate system to get the longitud of the lines. Using some Python code the lines can be split into segments at the distances you mentioned.

Highlighted
New Contributor

Thank you for the advise. I'm not familiar with Python code. What code would I use for shapefiles within a geodatabase file that have a coordinate system of NAD_1983_UTM_Zone_18N? How would I go about coding for this?

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

To prepare the data and convert your shapefile featureclasses into FGDB featureclasses you can use the Project—Help | ArcGIS Desktop tool. Just point your input to the shapefiles you may have and the output to a (new) file geodatabase (you can create one in the tool while specifying the output). This would be your first step.

Reply
0 Kudos
Highlighted
New Contributor

What is the next step?

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

If you have a polyline featureclass, you should verify if the lines are connected and not short parts, since that would make it difficult to cut them up in the lengths you mentioned. If you can share the featureclass (attach it to the thread) we can have a look at the next step and split the streams up using probably a few lines of python code, although there are many alternatives: Methods for splitting line features—Help | ArcGIS Desktop 

Reply
0 Kudos
Highlighted
New Contributor

I merged each polyline featureclass to make each polyline one path. When using the Editor tool for the polylines in the new geodatabase file, the "split" function was not an option. I would attach the featureclass, but I'm not too sure how to go about doing that.

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Elana Berlin ,

I think having access to the data would help a lot to see if it is fit for the process. To attach the data follow these steps:

  • Open the thread is a new tab (since the option will not be available when you answer from the inbox)
  • Reply to the thread
  • In the upper right corner of where you write your answer you will find a link "Use advanced editor":
  • In the advanced editor you will find in the lower left corner a link to "Attach" files:
  • Make sure you have zipped your file geodatabase or shapefile and attach the ZIP to the thread.
Reply
0 Kudos
Highlighted
New Contributor

Okay, thank you. Attached is the zipped folder.

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Elana Berlin 

You mentioned in your original question you want to devide the streams into 4 parts:

I was planning on dividing the streams into four parts based on the length: 500 meters, 1000 meters, 1500 meters, and 2000 meters.

I just opened a random stream and the length is more than 6000m. Do you want to devide it into x parts of 500m or how do you want to handle streams longer than 2000m?

Reply
0 Kudos