Select to view content in your preferred language

My flowlines all go uphill, why?

4534
24
Jump to solution
10-27-2016 01:59 PM
HillaryHudson
Deactivated User

I have created a set of flowlines using the Fill, Flow Direction, Flow Accumulation, and Reclass tools (in that order) from the spatial analyst toolbox in 10.3.1. I then converted them to polylines from the original raster data. When I looked at my flow directions in the vector data, they were all going uphill. I would like some help trying to figure out what I did wrong. Thank you.

0 Kudos
1 Solution

Accepted Solutions
ChrisDonohue__GISP
MVP Alum

Some ideas:

Just to confirm - the linework is definitely going uphill, not due to the line direction being reversed when symbolized?  Check the linework versus your rasters.

To convert from Raster to Vector, did you use Stream to Feature (Spatial Analyst)? 

ArcGIS Help (10.2, 10.2.1, and 10.2.2) How Stream to Feature works

ArcGIS Help (10.2, 10.2.1, and 10.2.2) Stream to Feature

Also, if they are all uniformly reversed, as a workaround, one can reverse the line directionality.

ArcGIS Help (10.2, 10.2.1, and 10.2.2) Flip Line (Editing)

caveats - requires at least a standard license.

              - alters the input dataset instead of making a new output, so back up your data before running.

Chris Donohue, GISP

View solution in original post

24 Replies
ChrisDonohue__GISP
MVP Alum

Some ideas:

Just to confirm - the linework is definitely going uphill, not due to the line direction being reversed when symbolized?  Check the linework versus your rasters.

To convert from Raster to Vector, did you use Stream to Feature (Spatial Analyst)? 

ArcGIS Help (10.2, 10.2.1, and 10.2.2) How Stream to Feature works

ArcGIS Help (10.2, 10.2.1, and 10.2.2) Stream to Feature

Also, if they are all uniformly reversed, as a workaround, one can reverse the line directionality.

ArcGIS Help (10.2, 10.2.1, and 10.2.2) Flip Line (Editing)

caveats - requires at least a standard license.

              - alters the input dataset instead of making a new output, so back up your data before running.

Chris Donohue, GISP

HillaryHudson
Deactivated User

Hi Chris,

Thanks for your reply. Here is a screenshot of my flowlines showing how I symbolized the directional indicators. I have also gotten a second opinion and confirmation of the issue from a co-worker.

My stream orders all made sense and seem to follow the correct flow direction, the flow direction output itself, however, is backward.. I am hoping that there is another way to correct them without having to flip one line at a time. I used a LiDAR dataset that was acquired by the county to generate the dataset. Thanks for your help!

0 Kudos
ChrisDonohue__GISP
MVP Alum

Not sure if this is a possible cause, but some of the results seem odd in ways other than the directionality you mentioned, at least compared to the Quad map displayed.

  • In the North, there are two areas where the derived stream lines seem to go parallel to the contour lines for a distance instead of traveling down the slope as expected.
  • Also, by the label "Upper Rock Tank" the lines go "horizontal" at first (which is a typical output result when derived streamlines cross a water body), but then seem to cross a ridge, which is not what one would expect.

Of course, the elevation data you used in deriving the stream lines may be different than the data used when the quads were constructed (time may have passed and the landscape may have changed, the resolution between the two datasets may be very different, etc), which may account for it.  Still, it seems odd.

Chris Donohue, GISP

DanPatterson_Retired
MVP Emeritus

got a picture?  are they pointing upstream from the outlet?

Don't like it? then you can either Flip Line—Help | ArcGIS for Desktop  if you have an appropriate license or just change the symbology in the layer so the arrow heads go in the other direction

HillaryHudson
Deactivated User

Hi Dan,

This is what a portion of the stream network looks like, and, yes, they are mostly pointing upstream from the outlet. There are an odd few that don’t. My stream orders all made sense and seem to follow the correct flow direction, the flow direction output itself, however, is backward. I used the from – to arrow direction so it is not a display issue. I am hoping that there is another way to correct them without having to flip one line at a time. I used a LiDAR dataset that was acquired by the county to generate the dataset. Thanks for your help!

0 Kudos
DanPatterson_Retired
MVP Emeritus

read the link I sent you carefully.... It does them all at once... And guess What!!! look at the example they use!  Do you think that there might be an association???

arcpy.FlipLine_edit("C:/data/project.gdb/streams")
0 Kudos
HillaryHudson
Deactivated User

Hi Dan,

Here is a more descriptive screenshot:

0 Kudos
DarrenWiens2
MVP Honored Contributor

Here's how you can flip lines with basic license:

>>> fc = 'lines'
... with arcpy.da.UpdateCursor(fc,'SHAPE@') as cursor:
...     for row in cursor:
...         new_part_arr = arcpy.Array()
...         for part in row[0]:
...             new_pnt_arr = arcpy.Array()
...             for pnt in part:
...                 new_pnt_arr.insert(0,pnt)
...             new_part_arr.insert(0,new_pnt_arr)
...         row[0] = arcpy.Polyline(new_part_arr)
...         cursor.updateRow(row)

HillaryHudson
Deactivated User

Thank you all for your helpful replies! I have been out of the office for most of the last week and I am finally getting a chance to sit down and review your responses. I will look these over and let you all know what I end up figuring out.

Cheers,

Hillary

0 Kudos