• Advertisement
Sign in to follow this  

Shapefiles with heightmap terrain?

This topic is 3389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya. I'm creating an app (DX10, XNA) that uses SRTM data downloaded from the USGS converted to greyscale heightmaps for terrain. I want to use USGS Shapefiles to determine where the water bodies are. I haven't even a vague clue of how to do this and haven't been able to find any relevant info....can somebody give me a basic idea of how this can be done, or point me in the direction of a good resource? THANKS

Share this post


Link to post
Share on other sites
Advertisement
This is not really a directx question.

One way is to rasterize the shapefile so you get a bitmap for water like you have for elevation.

Have a look at gdal_rasterize (http://www.gdal.org/gdal_rasterize.html) on how to
rasterize a vector shape file into a bitmap.

If you have both, elevation and hydro data, as geotiff, you can easily georeference both.

Another way is to actually use the polygons in the shape file. The gdal c++ library supports reading SHP files, so you could use it to parse the polygons and determine the water areas from the polys.

--
stephan



[Edited by - stephanh on January 12, 2009 7:42:16 AM]

Share this post


Link to post
Share on other sites
Thanks for the help, sounds like exactly what I need. I also notice that there's a C# implementation of gdal.

Sorry if this was off topic...spent a long time digging around for info before I posted without much luck. Heck, I'd use this forum for advice on how to fix my car....plenty of people here who know wtf they're talking about (and, of course, some who don't).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement