Below is my metacode for iterating through a grid of images to render the vegetation surface model from povray. The real code will be implemented in BASH and AWK, although this would be a perfect use of Python, if I knew how to use it… .
PostGIS Tables:
cuy_veg_points: Load veg points into database and make 2D geometry
cuy_terrain_points: Load terrain points into database and make 2D geometry
cuy_veg_height: Use nearest neighbor to calculate tree height into veg point database
e.g. http://www.bostongis.com/?content_name=postgis_nearest_neighbor_generic
cuy_tile_centroids: Generate tile centroids and load into table– contains coordinates and record area name
Process:
Read cuy_tile_centroids For each centroid record, query view extent for cuy_veg_height output temporary tree_coords.inc write worldfile for image output from povray write povray file with camera position at centroid render povray file