Postgis for breakfast: ST_Donut — Revision

A commenter on my last ST_Donut post pointed out that we were essentially using not one but two buffers and and ST_Intersection to test where a point lay.  Bad Spatial SQL. Very bad Spatial SQL. Actually, at Paul Ramsey’s PostGIS for Power Users presentation at FOSS4G this year, I think he mentioned not doing that very thing, and I chuckled to myself, “Well, even I … Continue reading Postgis for breakfast: ST_Donut — Revision

Postgis for breakfast: ST_Donut

This post typed into my iPod as an homage. Assisted today by my collegue, J. Stein. Moderate obfuscation of locations is an important technique for the protection of data, say something sensitive like the nesting locations of the very rare and strange fuzzy-bellied gnat catcher. We still want to display the data, but want to make it slightly wrong. A naive approach would place it … Continue reading Postgis for breakfast: ST_Donut

Cleaning PostGIS Geometries — Revised

In a previous post: “Another short post. Got self intersecting geometries? Want to fix them inside PostGIS? Me too. Fortunately, someone has already written the code, so you and I don’t have to: http://linfiniti.com/2010/07/cleaning-geometries-inside-postgis/ Now, let’s see how long it takes to run on my 760,000 record landcover table… .”   As usual, there’s a better way.  With PostGIS 2.0, you can (will be able … Continue reading Cleaning PostGIS Geometries — Revised

PostgreSQL Views within GeoServer, GetFeatureInfo with Freemarker Templates, etc.

GeoServer now has the ability to consume database views from PostGIS, not just raw tables. I say it “now” has that ability– I think that came online with GeoServer 2.x series, but I’m just “now” starting to take advantage of it. You can also create views on the fly within GeoServer, but I prefer to apply the logic at the database level, just in case … Continue reading PostgreSQL Views within GeoServer, GetFeatureInfo with Freemarker Templates, etc.

Dialog– What qualifies as a benchmark? Part 1

Normally, my blog is a bit of a monologue.  It’s not a bad thing, but can be a little lonely.  Every now and then I get a great (and often doubtful) comments, which enhances things considerably. What follows is some dialog about the LiDAR shootout series, largely between Etienne and Pierre, posted with their permission: Pierre: “Etienne, Stephen, “I really appreciate the benchmark work you … Continue reading Dialog– What qualifies as a benchmark? Part 1

LiDAR Shootout! — New Chart, Final Results

In reviewing the final numbers and charts from Etienne and Pierre, above are the results we see.  The only revision is a moderate increase in speed for the PG Raster query. Final results in speed for lastools– ~350,000 points per second.  In other words– off-the-charts fast.  And the initial RMSE of ~25 feet was a mistake– it is probably closer to 0.2 feet. Stay tuned … Continue reading LiDAR Shootout! — New Chart, Final Results

LiDAR Shootout!

For a couple of months now I’ve been corresponding with Etienne Racine and Pierre Racine out of Montreal Laval University in Quebec City.  They decided to take on the problem of finding the speed and accuracy of a number of different techniques for extracting canopy height from LiDAR data.  They have been kind enough to allow me to post the results here.  This will be … Continue reading LiDAR Shootout!

Contours– Symbolized from a single table

In a previous post, I restructured the contour data for display in GeoServer, e.g.: UPDATE base.contours_2 SET div_10 = CAST( contours_2.elevation % 10 AS BOOLEAN ), div_20 = CAST( contours_2.elevation % 20 AS BOOLEAN ), div_50 = CAST( contours_2.elevation % 50 AS BOOLEAN ), div_100 = CAST( contours_2.elevation % 100 AS BOOLEAN ), div_250 = CAST( contours_2.elevation % 250 AS BOOLEAN ); The SLD styling … Continue reading Contours– Symbolized from a single table

Contours– Structuring PostGIS data for viewing with GeoServer

Naively structured data is my bane– the desire (and need) to get stuff done so often overtakes the time needed to do things the better way. So, we bootstrap. A long time ago, we managed to load in a few tens of gigs of contour data into PostGIS, partitioned it into 2ft, 10ft, 20ft, 50ft, 100ft and 250ft tables using select queries with a modulus … Continue reading Contours– Structuring PostGIS data for viewing with GeoServer