Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Archive for September, 2008

POV-Ray for viewsheds (with trees?)

Posted by smathermather on September 26, 2008

In some of my first posts, I discussed the possibility of using povray for viewshed analyses, since it is a more flexible tool, and can better handle complex analyses, like terrain + vegetation, something which most GIS tools cannot.  In the end though, I just produced a simple terrain based viewshed analysis.  Now, I’m getting ready to go deeper.  Now, I’m ready to put some 28,000 trees on our viewshed terrain.

So, why not just use a digital surface model instead (an elevation model that shows us the top of all vegetation, buildings, ground, etc.)?  Well, trees, especially if there is a single row of them, are not going to necessarily block all views, so a digital elevation (or terrain) model in conjunction with an estimate of tree locations is a far better solution for accurate estimations of viewsheds.

So how do we get there?  I started with a dense LiDAR dataset with 3 returns.  I performed my analysis only on points that were either return 2 or 3, which tells me I very likely am dealing with canopy vegetation.  Then I take a moving average using (yes, I know) ArcGIS’ Spatial Analyst Point Statistics tool to determine canopy heights.

Now, to make things easy, rather than figuring out where the trees really are, I’m going to then generate random points approximately 30 feet apart, and use the elevation from my raster from the Point Statistics tool to determine the heights of my canopy.

To save on parsing time in povray, I’ll generate 28,000 non-unique trees across the landscape and see how things look.

First the code for the placement of the 28,000 random trees (written in BASH):

Now we have some random tree locations.  We make an include file of it (called “tree_coords2.inc”) that looks like this:

Now we need some trees.  I don’t want my machine to use too much memory, so a good tree “include” would be the ticket.  Pov-Tree seems the ticket here, and I’ll even use one of the pre-built trees, the Linden.

I forgot before to include the pov file for rendering:

So here’s the canopy close up:

Which doesn’t look too bad… .

And now far out:

So now we have a start for putting trees on our landscape (coming next…).

Posted in POV-Ray | Tagged: , , , , | Leave a Comment »

Follow-up (#1) for Camera Calibration in POV-Ray (Porro-Koppe Principle in Virtual)

Posted by smathermather on September 7, 2008

Ok, so projecting an image isn’t hard at all in POV-Ray.  I’m not sure what I was thinking.  In my first post on camera calibration in POV-Ray, I suggested that we could analytically solve for lens and topographic distortion in POV-Ray.  I haven’t gotten far as I don’t have a work project to take advantage of this yet, but I projected a false color infrared image from a Landsat image over Argentina onto the walls of virtual building.  The walls would be replaced with topography, the camera with an orthographic camera, and some lenses would be in-between, but at least it is a start.  It is basically just a modified version of some example code from Boris van Schooten.  Just so long as a photon scene does something similar, the rest of the problem shouldn’t be too hard to solve.  With my schedule as it is right now, about 3 hours of coding is probably about 3 months though… .

Projected Satellite Image

Projected Satellite Image

union {
polygon {5, <0,0,0>, <0,1,0>,<1,1,0>,<1,0,0>,<0,0,0>}
disc {<0.5, 1, 0>, <0, 0, 1>, 0.5}
pigment {
image_map {jpeg “landsat-argentina.jpg” interpolate 2 filter all 1.0 }
scale <1,1.5,1>
}
finish{ambient 1.0}
translate x*-0.5
scale <20,20,1>

translate z*13.9
}

Posted in Camera Calibration, POV-Ray | Tagged: , , , , , , | Leave a Comment »