[Talk-us] What to do with unnamed NHD streams

Paul Norman penorman at mac.com
Mon Oct 29 06:41:21 GMT 2012

> From: Michal Migurski [mailto:mike at teczno.com]
> Subject: Re: [Talk-us] What to do with unnamed NHD streams
> On Oct 28, 2012, at 10:29 PM, Paul Norman wrote:
> > The problem is you need to convert to .osm and *then* simplify. If you
> > do this in the other order you have problems where one object
> > intersects another (e.g. because they share a geometry for a portion
> > of them). You end up simplifying away the intersection points and your
> > resulting ways won't end up correctly sharing nodes.
> There are ways around this, by first de-duping the shared edges or
> nodes. Topology preservation is not terribly difficult if you prepare
> your data, for example by splitting lines and polygons at intersections
> (as in your lake example), simplifying only the parts and then
> reconstructing the original geometries.

Do you have a link to an example of the PostGIS magic to do this? It's
beyond what I could do.

A slight complication I found is that you can't just go for intersections
but you also have to go to near intersections - sometimes the NHD data is
off by a couple cm. I don't know if this will pose a practical issue for the

> > I would *really* like to be able to simplify prior to ogr2osm as it
> > would dramatically decrease the size of the nodes data in-memory and
> > decrease conversion time, I just can't see how to do it prior to
> processing.
> >
> > JOSM's simplify ways function works okay, although it doesn't deal
> > with the case of two ways sharing nodes very well.
> Do you have any sample NHD extracts that might be usable for a test
> drive?

All of NHD can be found at on the USGS FTP site, but you need to compile
gdal with 3rd-party toolkits to be able to use them. This is quite often a

I clipped out a small part of Kansas I was testing with early, converted it
to a set of shapefiles and posted it at

I should note that some information is lost in the shapefile conversion
(long field names).

For space reasons I dropped the WBD_HU layers. The first step of my
converting is to remove them anyways.

More information about the Talk-us mailing list