LiDAR processing and analysis in PostGIS (I hope…).

Alright, so let’s begin again with some LiDAR processing in PostGIS.  I really liked this discussion of multipoint conversions of LiDAR and other point datasets, but we won’t address making things more efficient here (yet).  Besides, these aren’t just points– we do want to retain their attribution… . Now, any regular database user will recognize my nubeness reading this post.  If you are that person, … Continue reading LiDAR processing and analysis in PostGIS (I hope…).

Hillshade using PerryGeo’s ported GRASS utility

Using the same LiDAR DEM from which we generated the contours, we can create hillshade tifs using  http://www.perrygeo.net/wordpress/?p=7.  It compiles easily on a mac, probably even easier on a Linux machine following his directions.  Then another simple loop: #!/bin/bash x=0 for f in $( ls *.txt); do x=`expr $x + 1` echo $x $f hillshade $f $f.tif done I’d like this all in a single … Continue reading Hillshade using PerryGeo’s ported GRASS utility

Spreadsheet Fun– Excel

Suppose you had a list of addresses coded like this: 00014 SOUTH ST That you’d prefer coded like this: 14 SOUTH ST If you were addicted to modifying things programmatically in Excel, like I quite guiltily do, you could do this in MS Excel. =(MID(A1,1,FIND(” “,A1)-1))*1 & MID(A1,FIND(” “,A1),LEN(A1)) Everything before the ampersand (&) uses the =mid() function to grab everything up until the first … Continue reading Spreadsheet Fun– Excel

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