Subscribe to this thread
Home - General / All posts - Stream name transfer from NHD lines to DEM-extracted network
nmack

203 post(s)
#26-Feb-15 16:51

I have a vector stream network based on a DEM, and I would like to transfer the Name attribute from an NHD layer to my DEM network. The catch, of course, is the two don't necessarily match spatially.

Has anyone developed a process that works well with this dilemma?

ColinD

2,081 post(s)
#26-Feb-15 20:20

What is an NHD layer? Can you post a small example?


Aussie Nature Shots

nmack

203 post(s)
#26-Feb-15 20:29

Oh sorry, NHD is National Hydrography Dataset in the US. Here's a relatively simple screen shot. The NHD lines are blue and my stream network is black.

Attachments:
Capture.PNG

ColinD

2,081 post(s)
#26-Feb-15 22:47

You could try buffering the NHD stream then using Spatial Overlay to transfer the data you need. You would end up naming some of the side streams unless you selected the stream you wanted data transferred to. Otherwise there is likely to be an SQL method that is above my pay grade to code.


Aussie Nature Shots

tjhb
10,094 post(s)
#26-Feb-15 23:25

Ideally this first requires assigning Strahler order to the vector-based hydrology layer (NHD here)--having ensured that it is a true network (and having made any necessary repairs)--and likewise, if this is not already done, to the DEM-based stream network. (Followed by judicious dissolving on the resulting orders, segmentizing by known names, then matching by proximity and direction.)

There might be a case for doing this for the whole US NHD dataset, if there is also a definitive publicly-available DEM-derived stream network that is widely used. Is there?

Assuming it hasn't already been done I'd be happy to be involved, provided someone has a way of making the result available under CC-BY.

nmack

203 post(s)
#27-Feb-15 15:57

I'm curious how I would match by Strahler order. If the DEM stream network is farther reaching upstream, therefore more branches than the NHD network, wouldn't the Strahler orders be completely different.

So I guess I don't know what you mean by judiciously dissolving the resulting orders, and how I would use them to compare/contrast the two layers.

tjhb
10,094 post(s)
#27-Feb-15 19:47

If the DEM stream network is farther reaching upstream, therefore more branches than the NHD network, wouldn't the Strahler orders be completely different.

The numbers will be different yes. But in any given location, the relationships between the orders will be broadly the same between the two networks. We know that they have a very similar structure, and it is more promising to match on this shared structure than to match raw, atomised, geometry.

Picture the two networks, where Strahler order is shown by line thickness. We can see the match between the fat line here and the "same" fat line here. We can easily ignore the leaf edges, or all edges with an order lower than X.

This helps in matching, not between exact order numbers, but between the local main branch in A and the local main branch in B.

First, it is these branches that tend to be named.

Secondly, dissolving on Strahler order (subject to matching names, where they exist) in both networks means that instead of dealing with flat networks running edge-vertex-edge-vertex, we can deal with the main objects in their natural hierarchy. Fewer objects to process, that's one good thing, though trivial. More importantly, every object ranked and grouped in this way has more information useful in spatial matching.

KlausDE

6,410 post(s)
#27-Feb-15 21:26

Buffering is what came to my mind, too, as that's what I guess is the base of my pattern matching.

Lets try something like this to start (i.e. the final UPDATE .. SET [Name] ist still missing and no optimization at all)

--SQL

OPTIONS COORDSYS("Rivers" AS COMPONENT);

SELECT [RID], First([NHD_Name]AS [NHD_Name], First([rate]), Count(*) AS [touched NHD segments] FROM

SELECT [R].[ID] AS [RID]

        Length(ClipIntersect([R].[ID], BUFFER([NHD].[ID],[NHD].[Length (I)]/10)))/[R].[Length (I)]  AS [rate],

        [NHD].[NHD_Name]

    FROM [Rivers] AS [R][NHD]

    WHERE ((Length(ClipIntersect([R].[ID], BUFFER([NHD].[ID],[NHD].[Length (I)]/10)))/[R].[Length (I)])) IS NOT NULL

    ORDER BY [R].[ID], Length(ClipIntersect([R].[ID], BUFFER([NHD].[ID],[NHD].[Length (I)]/10)))/[R].[Length (I)] DESC )

GROUP BY [RID]

  • What we have is a drawing of your [Rivers] and another Drawing of [NHD] with a column called [NHD_Name].
  • What we'r doing here ist to create a buffer of one tenth of the length of each [NHD] line and create objects from your [Rivers] intersecting these buffers. An object may contain different branches.
  • We then evaluate the match by the proportion of (intersecting River length / total River length) and order by this rate
  • We discard all records without any intersection.
  • Grouping by [River].[ID] we reduce the dataset to the ones with the best match and just to get a feeling about possible mismatches we keep the selected matching rate and the number of NHD lines that have been touched

Do you really want to ruin economy only to save the planet?

Mike Pelletier

2,122 post(s)
#27-Feb-15 00:00

Your question reminded me of this thread that Tim and Klaus worked on. Perhaps there is something in there that would be helpful.

tjhb
10,094 post(s)
#27-Feb-15 00:32

Mike,

I think that question (link corrected) concerned areas to lines, and also did not involve networks or hydrology.

Mike Pelletier

2,122 post(s)
#27-Feb-15 16:37

Thanks for correcting the link Tim. Perhaps I didn't follow the task correctly, but I was thinking one could buffer the NHD line to create an area. Then the trick (discussed in that thread) is to transfer data from the largest area in the buffered NHD layer that touches each stream line. Based on nmack's png, it seems this would transfer the correct data to each stream.

tjhb
10,094 post(s)
#27-Feb-15 19:33

Quite right, sorry for being a bit terse there Mike. That would probably be a good approximation. As Colin points out, you'd have to do some extra work to avoid labelling side streams as if they were the main branch.

My feeling is that this is inherently a question of matching one network or graph to another, where there is known to be a very strong structural resemblance between them. So the best approach in my opinion is one that makes use of all of that information.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.