GDAL Contours (cont.)

Well, I made some mistakes in the last post, not the least of which is I used the wrong flag for creating an attribute field with elevation.  What follows is a little more sophisticated.  It takes us from a series of DEM tiles from which I want 2-foot and 5-foot contours (using gdal_contour), and then dumps those shapefiles into PostgreSQL using shp2pgsql. First we prep … Continue reading GDAL Contours (cont.)

GDAL Contours

Just another quick vignette.  From the Ohio Statewide Imagery Program (OSIP) there is a 1-meter DEM for all of Ohio.  To get contours from this dataset, one approach is to use GDAL tools, i.e. gdal_contours.  As I’m working on a Mac today, I used Kyng Chaos pre-compiled Frameworks: http://www.kyngchaos.com/software:frameworks Then I needed to update my path variable in the BASH shell: export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH Now we … Continue reading GDAL Contours

LiDAR data in BASH using libLAS

At home, I work on a Mac, so when I want to do work here, my scripting language changes.  In this case, I prefer BASH as my control script.  I downloaded libLAS and did the standard Unix ./configure, make, sudo make install dance in the decompressed libLAS directory ./configure make sudo make install Now I have some tools to manipulate LiDAR las files at home.  … Continue reading LiDAR data in BASH using libLAS

COPY command psql– loading large LiDAR Point Dataset

Ok, so the INSERT statements were too numerous for inputing the LiDAR point dataset (about a billion points… .)  They kept crashing the postgres daemon.  So, I used copy from a CSV file: COPY base.cuy_lidar_all FROM ‘c:/path/cuy_lidar_ground_veg.insert’ WITH CSV Keep your fingers crossed… . Continue reading COPY command psql– loading large LiDAR Point Dataset

Limitations to Trigger Based Unique Constraint

A unique constraint implemented as a trigger checking hashed geometry seems like a good idea, that is until I applied it to a multi-10GB dataset.  Not surprisingly, it starts off fast on inserts, and slows down a lot as time goes on.  So, I thought I’d approach duplicates another way, by deleting them once they exist.  So for my table: base.cuy_contours_2 I have hashed my … Continue reading Limitations to Trigger Based Unique Constraint

Rendering a vegetation surface model using PovRay (cont.)

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 … Continue reading Rendering a vegetation surface model using PovRay (cont.)

Rendering a vegetation surface model using PovRay

Early on, I was working on the problem of rendering a virtual forest based on real LiDAR data in order to do things like a detailed, vegetation included, viewshed.  There are other things we can do with this data, including discovering the boundary of the canopy (and thus find canopy gaps) and rendering a vegetation surface model. Let’s start with a single tree.  If we … Continue reading Rendering a vegetation surface model using PovRay

Loading LiDAR data in PostGIS

For a variety of reasons, I want to load my whole LiDAR vegetation dataset into PostGIS.  I have it in raw, unclassified LAS files, and broken into classified, space delimited text files as well.  The unclassified LAS is nice, if I ever want to hone the data, but for now, we’ll assume the classified data are correctly classified by someone smarter than I am (a … Continue reading Loading LiDAR data in PostGIS