Working with the National Hydrography Dataset (or Not)
Posted by Kai Johnson on 8 December 2022 in English.Many of the features we had to deal with in the Sq___ renaming were small streams and creeks. For some reason, Sq___ Creek seemed to be a very popular name. In most cases, the creeks weren’t present on OSM, and as part of the renaming, we decided to add missing features with the new names so that future mappers wouldn’t unknowingly add the features with the old Sq___ names. So, we had to map a lot of small creeks.
One of the challenges with mapping named waterways is identifying the full extent of the waterway. Where is the mouth of the waterway? Where is the source? Of the many branches upstream from the mouth, which branch is the identified course?
If you’re just working with GNIS, the GNIS data has two or sometimes three sets of coordinates for waterway features. The first coordinate is the mouth. If there is a second coordinate, it falls somewhere in the middle of the waterway. The last coordinate is the source.
From there, you can use topo and aerial maps to trace the course of the waterway by hand.
Alternatively, you can download the local data file from the National Hydrography Dataset, find the waterway you want, merge it into an OSM layer, and clean it up before uploading it. Here’s how that works:
-
Go to The National Map downloader web site. Select “NHD” from the “Custom Views” menu at the top. Zoom to the area you’re interested in on the map. Select the National Hydrography Dataset (NHD) data set (not NHDPlus High Resolution), HU-8 subbasin (this gets you the smallest slice of the data set), and Shapefile format, then search for available products. This should hopefully give you a list of four or five results. Click each of the Thumbnail links in the results list to toggle the extent of the data sets. When you find the data set with coverage of the area you’re interested in, click the Download link.
-
Unzip the file(s) and use the opendata plugin in JOSM to open the .shp files. You want the Area (polygons for rivers, etc.), Flowline (ways for streams), Waterbody (polygons for lakes, etc.), Point (springs, etc.), and Line (dams, etc.) data files. Or maybe you just want the Flowline file if you’re just going to import a single creek.
-
Use GNIS and Topo maps to figure out where your feature is. Go to the relevant NHD layers that you imported and pick up the pieces you need for your feature. Most linear features are split into several ways so it helps to use the Find function in JOSM to select them. Alternatively, some features in the NHD files have relations that you can use to select all the individual ways. Once you have everything selected, use Merge Selection to copy the selected data to the OSM layer.
-
If you didn’t merge an entire relation into the OSM layer, create one for all the ways you just pasted in. This makes it much easier to find the ways and update them. Use the continuity check in the relation tool to make sure you didn’t miss any of the smaller ways. Make sure you have connected ways where they’re supposed to be connected.
-
Clean up the NHD attributes using this mapping: osm.wiki/NHD_Rules. It’s out of date, but I figure keeping some of the attributes isn’t harmful.
-
Check your OSM tags against the NHD FCode osm.wiki/National_Hydrography_Dataset#Attributes-to-OSM-tags. E.g. some streams have intermittent=yes
-
Use the Simplify Way command to reduce the number of points in the imported waterway. You probably want to use a 2 or 3 meter maximum error for the command. NHD waterways typically have a lot more points than are necessary to get good alignment with the natural watercourse. Simplifying the ways reduces the number of points you’ll need to check and correct in the next step.
-
Use Bing or another reasonably well-aligned set of aerial tiles to check the alignment of the NHD features. Sometimes they’re OK, sometimes they’re a little off, and sometimes they’re just plain wrong. Tweak all the ways so that they match up with the aerial imagery. This part is a lot of work.
-
Double-check everything before you upload the new feature.
All that sounds great, but the NHD data is often pretty poor. As in, waterways going up the sides of canyons. And even where the NHD data is close, you might have to go in and manually adjust every node in the waterway to align it with aerial and topo maps.
In practice, it’s often easier to just draw the waterway by hand than to use the NHD data. If you’re starting with GNIS coordinates, add them as nodes in JOSM, connect the nodes into a single way, then use the Improve Way Accuracy mode to fill in the remaining nodes to get a good fit to the aerial imagery. It’s still a lot of work, but it’s easier than cleaning up imported NHD data.
Meanwhile, work continues on mapping BLM Ground Transportation Linear Features in SoCal…
Discussion
Comment from watmildon on 9 December 2022 at 17:26
This is extremely helpful and always nice to have written down in an accessible location. Thanks for writing it up!
Comment from Kai Johnson on 10 December 2022 at 15:25
Yeah, after attempting to use NHD for several waterways, I came to the conclusion that it’s almost always easier to draw the ways by hand.
That said, the NHD Flowline data is useful as a reference if you need to confirm the extent of a smaller, unnamed waterway. And in forested areas where the aerial imagery isn’t useful, it may be a good source of data about waterways.
The other NHD data files can also be useful for reference.
The Waterbody data can be helpful where it’s difficult to distinguish between open water and wetland using aerial imagery.
The Point data can help locate springs, which are often not directly visible in aerial imagery.
And the Line data can help determine the location and extent of dams and other features.
But in every case you want to use the NHD data cautiously and attempt to confirm and correct it using other sources.