Computing View Distance in One Direction from Point on Elevation Raster in PostGIS?

المشرف العام

Administrator
طاقم الإدارة
I'm a software developer just getting into GIS, so please forgive me if I don't use proper lingo, or if I use proper lingo incorrectly!

I have a raster of elevation data. For a given point in the raster, I'd like to compute how far one can "see" from that point in each of the 4 cardinal directions.

I'm assuming that all obstructions are accounted for in the elevation data, that the Earth is flat, and that the whole region I care about is represented in the raster. Also, let's assume the viewer is 5 feet tall. So, we can reduce this to a problem of "How many squares in the raster can I 'see' before I either (a) hit a square that has elevation>=myelevation+5ft, or (b) leave the rasterized region?"

If I simply had to write a program to compute this, I'd do a simple traversal in each direction until I hit a square that matched my criteria. Or, if I wanted the 360° view, I could use a "flood fill"-style algorithm to do that, too. However, I have no idea how to do this in a "GIS-y" way!

Based on what I've read, it feels like there should be a ST_MapAlgebra solution, but I haven't been able to put my finger on it.

If I could get a "visible region" that looks out in 360° -- so all the continguous raster squares I can see from the given square -- that would be even better!



أكثر...
 
أعلى