Proposal to connect NHD waterways in Oklahoma with a mechanical edit, requesting feedback

One thing that is useful to think about it how easy would it be to “undo” this if we discovered 6 months from now we have decide we want to backtrack. Given that this is all sourced from NHD, it’s pretty hard to do enough damage that a dedicated person couldn’t (through reverts or redo of import) patch things to how they were. It’s even easier to backtrack for solely tagging changes.

In contrast, updating all the geometry for a ton of varying and connected feature types over many weeks that would need to be hand entered? Much more to worry about.

They’ve been there a while, having them in for a while longer doesn’t hurt anything. As you’ve noted, there are some that may be useful to keep around for if the import is redo/extended etc. I’m glad you’re thinking about what happens for the next folks to come along. I don’t think the map is damaged hugely either way.

2 Likes

(just to comment on the original question)

To be honest, that looks like a bug in the initial import? Now that you’ve fixed it, this stream and this lake look OK to me.

1 Like

Yeah, this is a super common issue with older NHD imports.

1 Like

Ok, I think I’ve figured out what I’d like to do. Here are before and after zipped *.osm files, none of these changes have been uploaded. The files contain the objects to be modified and everything sharing nodes with them.

Edit: I made a mistake before, there are a lot of connections to be made where the nodes are exactly 7.2cm apart for some darn reason. The below is updated to reflect upping the range limit from 5cm to 8cm.

  • ok_before.zip - 18.3MB compressed, unzips to a 124MB osm file
  • ok_after.zip - 19.1MB compressed, unzips to a 141.0MB osm file

5,226 ways to delete (all ArtificialPaths inside of bodies of water, with nothing flowing into the body of water to connect to it, and nothing in the NHD to connect to it either.)

About 60% of them, the last node in the way is connected to the beginning of another waterway that would be left dangling, so that node is then merged with one belonging to the body of water (the nearest node within 8 cm).

Then the other 40%, the waterway flowing out of the body of water that our deleted ArtificalPath connects to is already connected to the lake edge, OR there’s just nothing the deleted way was connected to. So simply deleting the way is enough.

There are about 150 ArtificalPaths (already tagged as waterway=stream) inside of lakes I want to leave alone because of one of these cases:

  • The NHD shows something that could connect to it that doesn’t exist in OSM
  • The way inside the waterbody has a name tag
  • There’s a way outside the body of water flowing away from it that would be left connected to nothing because there isn’t a node belonging to the instance of natural=water within about 8cm to merge with
  • There are multiple ArtificialPaths connected to each other inside the same large lake
  • Any of the nodes in the way besides the very last one also belong to another way

20,159 node merges, all but 10 of which involve only two nodes, connecting the end of a waterway to the edge of a body of water where that end had connected to nothing previously. Then 10 instances of 3 nodes being merged because I found some canals I didn’t pick up before whose ends are touching.

And then there are JOSM validator warnings I’ll work through manually before committing changes to an area. I didn’t address them all yet in the files linked above.

I’m really grateful for all of this feedback, and for the ability to pursue this. It’s really satisfying doing this work.

Is it okay for me to create a wiki page, and begin making these changes, do you think? Or should I slow down, or work more on part of it?

Thank you thank you thank you.

2 Likes

This looks sensible to me. I would love to know what the other 200 are and if we can work through them manually. I haven’t had a ton of time the last couple weeks but may be able to work through some (and the dams! so many dams!) in coming weeks.

2 Likes

Thank you! I updated my previous post, there were a large number of instances of nodes being exactly 7.2 centimeters apart. By looking within 5cm, and then only if nothing is found upping it to 8cm there are a few thousand more connections to make.

I will put that list together of about 150 lone ways being left behind and post it here, later today probably.

Thank you for all of your time, I love the workflow of using MapRoulette for the dams. Any you’ve done or you do in the future (with or without MR, all is good) is wonderful, thank you. But don’t feel pressure! I’ll do them all eventually if nothing else. Your guidance has given me the freedom to work through them in a way that’s comfortable and efficient for me. So I appreciate it!

1 Like

[ok_ways_left · GitHub]

Here are the 147 ways in Oklahoma with NHD tags, inside of bodies of water, that don’t have anything connecting to their first node, that I didn’t want to delete automatically. Most of them, they have names and that’s why I left them. The rest should all be: the last node of the way was more than 8cm from the nearest node belonging to the body of water. I think. I haven’t looked at them all.

The columns mentioning old and new: old is “ways and relations the last node of the way is already connected to” and new is “ways and relations this way would become connected to if all nodes within 8cm of its last node were merged.”

Edit: Here’s a bonus, the 18 ways where the NHD has another way that doesn’t exist in OSM that might connect to it. Their ends are all about 1 meter apart though. And in one case I think the way in the NHD is the same way in OSM but its ids are different. I haven’t looked at all of these.

[ok_ways_left_nhd_conn · GitHub]

Query to view a way by object id for convenience (?) - https://hydro.nationalmap.gov/arcgis/rest/services/nhd/MapServer/6/query?where=OBJECTID%3D10292735&outFields=*&returnGeometry=true&geometryPrecision=&outSR=4326&f=geojson

1 Like

All done :slight_smile:

[Mechanical Edits/AutoMatt/Connecting NHD Waterways in Oklahoma 2 - OpenStreetMap Wiki]

[Changesets by AutoMatt_ | OpenStreetMap]

2 Likes

This is a huge amount of cleanup and greatly appreciated!

2 Likes

Thank you for letting me! I want to provide an update, and ask about one last mass mechanical change please (setting intermittent=yes on streams, more info at the end). First, I’ve been manually connecting things, there’s less confetti in the north now.

It’s not perfect but it’s a lot better. What I found was, there were many streams with big chunks missing. Here’s an example from Overpass. In green are the segments that I created manually.

Here’s another example. Green were missing, now created by hand.

Lastly, here are the waterway relations in Oklahoma, with thew new ones I created in green. After verifying a named waterway end to end, it made sense to me to throw a relation on it. I didn’t do it for all of them, I did about 30, each long enough to have 20+ segments.

Question about a mass edit please:
There are 59,443 waterways in Oklahoma with NHD:FCode=46003 that don’t have an intermittent tag. Can, or should, I set intermittent=yes on them?

Thank you for your time!

2 Likes

Really curious how there’s that many sections missing. Probably lost to time why…

I think adding relations for longer waterways is totally fine. It’s very common and makes a nice single place to grab the whole thing.

Features with that FCode should be marked as intermittent and, given the grography of OK, I’m not surprised at the large number of ways. In case you haven’t seen this, the wiki has a page talking generally about NHD imports that mentions this. There may be other FCodes that could use some scrutiny while you’re there.

For some of the missing waterways I created manually, it looked like the NHD had the stretch as a polygon that either didn’t get imported, or did but was tagged as some kind of river bank and got deleted after the fact. And the ArtificialPath down the middle never existed. But then, yeah, a lot of the missing segments, there’s nothing in the way…

Looking at lakes and streams in Oklahoma, there are:

NHD:FCode Count Count currently having intermittent Wiki
46003 60,224 885 STREAM/RIVER waterway=stream intermittent=yes Hydrographic Category intermittent
46006 26,457 335 STREAM/RIVER waterway=stream Hydrographic Category perennial
39004 109,721 29 LAKE/POND natural=water Hydrographic Category perennial
55800 16,814 13 ARTIFICIAL PATH
39001 6,756 15 LAKE/POND natural=water intermittent=yes Hydrographic Category intermittent
39009 530 2 LAKE/POND natural=water Hydrographic Category perennial; stage average water elevation
33400 250 1 CONNECTOR

So, I think that would be (?)

  • 59,399 waterways with NHD:FCode=46003 that need intermittent=yes
  • 6,741 water bodies with NHD:FCode=39001that need intermittent=yes

What do you think?

2 Likes

That seems sensible to me.

1 Like

Thank you! Done!

https://wiki.openstreetmap.org/wiki/Mechanical_Edits/AutoMatt/Setting_Intermittent_on_NHD_Waterways_and_Lakes_in_Oklahoma

I’m personally fine with this and believe it would be greatly useful. I’m on the assumption that the NHD code you mentioned is equivalent or near enough to it to be reasonably synonymous.

From experience? A lot of the hydrology at the headwaters here is alluvial, intermittent or otherwise completely I obvious when not currently innundated.

Generally nhd will have those segments though so it’s a bit odd they are left out no?

Armchair mappers? When you got a dry plowed field with a crop on it, it’s unlikely they are to notice an intermittent body of water that floods part of the field, especially if it was imported and has no intermittent indicator. Just looks like human terraforming killed the stream. Other segments fell out of the downloaded scope.

Ah, the portion I was asking about has ways that are from NHD. Seemed odd to have dropped a bunch of middle segments. Perhaps we will never know.

I should have been more clear. I was talking about specifically a situation where I would assume the data source imported ate something bogus myself, and therefore consider the most likely scenario. I generally know my region fairly well but I’m obviously not going to go spend a day driving to some field halfway across the state to doublecheck a wet spot for a possible stream that should be there but isn’t.

1 Like