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

Unique constraint on geometry continued

An actual example of using the hashed geometry to uniquely constrain geometry (nothing really new here, just an example of using what we learned in the last post with a new problem): I’ve got a contours dataset from the county where I work that is in 20 different shapefiles ranging in size from 500MB to 2GB.  I want to put them into a PostGIS database … Continue reading Unique constraint on geometry continued

PostGIS Gripe—Limits to Postgre’s B-tree indexing—Followup

In an earlier post, I griped about the limits to Postgres B-tree indexing, in that for large PostGIS geometries, I couldn’t create a unique constraint for PostGIS geometry.  Abe Gillespie (blame me not him for any mistakes  in what follows), suggested that I hash the geometry and create an index on that.  In a follow-up e-mail, he suggested a series of tests in a trigger … Continue reading PostGIS Gripe—Limits to Postgre’s B-tree indexing—Followup

PostGIS Triggers

Yup, I’m going for hits with the above title.  So, I’ve been playing with triggers in PostGIS (PostgreSQL) trying to streamline a process that I go through quarterly.  We have a geographic boundary layer for our public entity: The green area is the area with public access.  The purple without.  I want to maintain a version of the boundary with this very simple distinction, and … Continue reading PostGIS Triggers

No Image– a very simple solution for calculating viewshed

Not much to say here. I had a bit of inspiration, remembering a Christoph Hormann tutorial http://www.imagico.de/pov/icons.html on making transparent icons in povray and realized that what he was describing was the final piece in the povray for viewsheds milleau: no_image option for an object forces it to interact with the scene in every way, but to be seen by the camera. I’ll post the … Continue reading No Image– a very simple solution for calculating viewshed