Reprocessing imagery with GDAL and BASH — and then cleaning up afterward

I show a simple example today of using gdal tools to change from raster to polygons with Bash.  That’s right.  Still no pythonista here.  I have poked ever so gently at the surface of ruby and rails recently, while watching another coder re-tune his brain to a new set of principles of least surprise. By the way, for my regular readers, please be patient with … Continue reading Reprocessing imagery with GDAL and BASH — and then cleaning up afterward

Reprocessing imagery with GDAL and BASH — and then cleaning up afterward

I just can’t seem to get away from Bash. One day I promise to do the same work with Python, but for now, the following will take your directory of 3-band imagery, extract the first band, and if it succeeds, delete your original file. Seeing as I had almost 300GB of imagery, and very little space left, this kind of housekeeping was necessary (my other … Continue reading Reprocessing imagery with GDAL and BASH — and then cleaning up afterward

gdal_warp, cutlines, and cwhere– simple tip for use on Linux

Mini GDAL tip of the day: gdalwarp, especially in combination with gdal_merge, is a powerful tool for doing all sorts on nice aggregation (read: mosaic’ing) of spatial raster data.  Unfortunately, at least with a google search, there’s very little to be found on demonstrating the use of queries in conjunction with cutlines, probably because in general these queries are not difficult to figure out. In … Continue reading gdal_warp, cutlines, and cwhere– simple tip for use on Linux

Debian Configuration– Tomcat on Boot, revision

I revised my startup script for Tomcat to use a non-privileged user for security reasons. I used the following page as my resource: http://linux-sxs.org/internet_serving/c140.html #!/bin/sh # /etc/init.d/tomcat6: start Tomcat6 server. test -f /opt/apache-tomcat-6.0.32/bin/startup.sh || exit 0 PATH=$PATH:/opt/apache-tomcat-6.0.32/bin/ case “$1” in start) export JAVA_HOME=/opt/jre1.6.0_26/ logger -t Tomcat6 “Starting Tomcat 6…” exec su – tomcat -c /opt/apache-tomcat-6.0.32/bin/startup.sh | logger -t Tomcat6 ;; stop) export JAVA_HOME=/opt/jre1.6.0_26/ logger -t … Continue reading Debian Configuration– Tomcat on Boot, revision

Debian Configuration– Tomcat on Boot

Start-up scripts in Debian Linux aren’t exactly straight forward for the un-initiated.  Actually, if memory serves me, they aren’t any more straight forward on Ubuntu Linux either, but such is heredity. We are transitioning some of our GeoServer instances over to 64-bit Debian Linux.  In my test Ubuntu environment, I had a hack in place to force the Tomcat Java Servlet to launch on startup, … Continue reading Debian Configuration– Tomcat on Boot

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…).

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