geo-spatial query (by elevation)

Dec 16, 2010 at 8:15 PM


I'm relatively new to GIS, so I hope the following question doesn't come as an annoyance to those with more experience.

I'm looking for a means of finding all regions of land above a given altitude. More concretely, I'm trying to develop a map rendering layer that warns the user (a pilot) of any land forms that are at or above their elevation, by simply shading those regions on the map with a red color. So, ultimately, I need to query some elevation data within a given radius very efficiently to generate polygons corresponding to these obstacles. I'd imagine this sort of thing has been done before, but I'm not familiar with the concepts and/or terminology involved. Is this type of querying something that DotSpatial might be able to handle, and is there a particular concept or term that I've described here?

For a little more background, we're using GTOPO30 DEM files for various parts of our map rendering software. We've considered a few options:

  1. At compile time, generate vector based shapes at various elevations, and split them into tiles. Using a custom binary format, it would be straightforward to achieve O(1) lookup per visible tile at a given elevation... but I'd imagine the amount of data would be huge.
  2. Create a quadtree of elevation points. Each node would contain the max and min elevation of all descendant nodes, so it wold be easy to preclude vast sets of points. Rendering would merely involve querying the quadtree to fetch lat-lon-elevation pairs, take the convex hull and render it as a filled polygon.
  3. [Right] Triangulated Irregular Networks were suggested to us, and while I would have no trouble generating a [R]TIN (there are plenty of libs out there), I am unaware of an algorithm to perform this type of query upon a [R]TIN ...

As you can see, I've given this some thought, but this is hardly my area of expertise. Any suggestions or pointers you can provide would be greatly appreciated - and if DotSpatial has such a feature baked-in, all the better!



Dec 16, 2010 at 11:41 PM

This is a neat problem.  I would not at all classify this as a novice question, and while ArcGIS and other professional apps have something built in, I don't think many open source systems are designed with your particular desire in mind at all, but we might be able to figure something out.  One way to think of your problem is the creation of a contour map from a DEM.  I think there is a straight forward function in ArcGIS that converts a DEM into a set of polygons where the polygons each represent a range of elevations.  In your case, once the polygons are created, you would symbolize them all as red, but then use a filter expression to remove the ones that have a maximum attribute below the pilots elevation (taking into account a safety margin of course).  For the case of the pilot scenario, the elevation change could even be quite large, as your safety margin is already going to mean the margin of error doesn't have to be down to the tolerance of your DEM elevation values or anything.

While we have some respectable feature to raster code, our raster to polygon code is probably not really what you need.  (My memory is that it was written in a way that will probably be extremely slow for large grids, generate boxy squared off edges along the bounds of the raster cells, assumes you want to represent unique values rather than a range of values, and has a significant chance of failing completely).  This is probably not really what you want.  To get started before I do anything heroic, you could write a script to bin your raster elevations into a small set of distinct values.  Then you could try out Raster to Polygon on that and see if it functions at all.  If it does, at least that can tide you over until we have something more elegant.  If you happen to have ArcGIS lying around you could probably crank it up and get the result after searching for the contour map function in there somewhere.  If you are a hard line open source advocate, you can attempt to get GRASS going, since they have a lot of analysis.  Not recommended for the feint of heart. 

This is actually a very commonly needed feature, and it might be worth some consideration for me to write up something tonight.  If I were you, however, I'd start poling the internet to see if anyone has posted an algorithm for doing this already.  It is something very heavily used in lots of GIS fields, so I suspect there is liturature out there.  I will see what I can dig up later tonight.




Dec 17, 2010 at 3:31 AM

As of change set 79b2fda8dc54 on 12/16/2010 you are one admittedly very small step closer.  I have created a raster binning tool and added it to the toolbox under Terrain Analysis.  What it does is let you take a starting raster that has more or less continuous values, and set up bins so that all the values within a bin range get re-assigned the middle value of the bin.  Basically it is like rounding with a little bit more freedom as to where the bins fall into place.  That way, one option you have would be to create raster bins, and use a different raster symbology schemes in order to create images.  You could then decide which image to show based on the elevation.  Alternately, you could test out the raster to polygon tool, but no promises there.