[Talk-us] NHD Conversion

Paul Norman penorman at mac.com
Sat Jul 7 07:28:07 BST 2012


I have been working on a conversion for NHD data to .osm and decided it's
time to post something. 

A few warnings

- The conversion is not yet done. I estimate that the FCode conversions are
about 90% done

- This is designed to work on the pre-staged subregion files which are
FileGDB or PersonalGDB. It is not designed to work on shapefiles. If you
need to clip these files I have had success writing to a FileGDB.

- The translation is written for NHD data model 2.1 and not all areas have
been converted

- The conversion process will only work with the latest version of ogr2osm.
When writing these I implemented a few new features and fixed a few bugs

- Post-processing is needed but I haven't figured out exactly what yet

- The exact process for generating these files is not yet documented. It
requires compiling gdal to support additional file formats

I know there are multiple NHD translations written, but none that make use
of the 2.1 data model
I wrote this translation to deal with NHD data as it appears in the NHD
database, not as it is documented on paper. It appears that some of the
existing translations used the NHD FCode descriptions without checking them
against real data. 

Without further ado, the translation is at
https://github.com/pnorman/ogr2osm-translations/blob/us_nhd/us_nhd.py

To use it:
1. Compile gdal with PersonalGDB support
2. Download a subregion
3. Download ogr2osm and fetch the us_nhd branch of ogr2osm-translations
4. Run it on a sub-region

As this is a difficult process, I've prepared some samples of small areas at
http://maps.paulnorman.ca/imports/nhd/20120706/

0413: Rochester, New York
0310: Punta Gorda, Florida
1026: Manhattan, Kansas
1501: Hoover Dam
1711: Blaine, Washington

gnis:fcode is in for debugging purposes. I am not sure about keeping FDate
but have left it in for now.

Significant post-processing is still required. I intend to simplify ways,
join ways (glom) based on ReachCode then strip out ReachCode.

It would be nice if when I finished this work there was a way for it to be
used. I could create .osm files for all of the US easily enough but I'd like
to avoid repeating the mistakes that were made with CanVec.




More information about the Talk-us mailing list