dylan's blog

Saving Chunks of SSURGO Data in SoilWeb for Google Earth

Submitted by dylan on Wed, 2011-06-29 00:07.

GE KML Thumbnail

SoilWeb is an interactive, multifaceted interface to USDA-NCSS soil survey information. Our SoilWeb application for Google Earth streams soil map units and point data as you navigate across the lower '48 states. Currently, our system imposes a 30,000 ac. limit (defined by the Google Earth viewport) for streaming detailed soil survey (SSURGO) map unit boundaries. This limit, combined with a 2 second delay before streaming is initiated, helps to reduce CPU load on our server. When viewing landscapes from directly overhead the 30,000 ac. limit is usually sufficient for most soils investigations. However, tilting the camera for oblique views of the landscape (an excellent way of visualizing soil-landscape relationships) causes the viewport to encompass much larger areas, usually exceeding SoilWeb's limit for detailed linework. The solution to this problem is summarized below, and can also be used to save "chunks" of detailed soil survey information for later use or offline browsing.

Terrain Classification Experiment 2: GRASS, R, and the raster package

Submitted by dylan on Tue, 2011-05-24 16:37.

Quick post on terrain classification, based on some trouble folks were having with a previous example on Windows. With the spgrass6 package, raster stacks are created by loading several GRASS files at once: x <- readRAST6(vname=c('beam_sum_mj','ned10m_ccurv','ned10m_pcurv','ned10m_slope')). This works well on UNIX-like operating systems and in cases where the entire collection of raster maps can fit within the system memory. A different strategy is needed when working with massive raster stacks or on other (less useful) operating systems. This post outlines one possible strategy that should work on massive data sets, and across operating systems.

 
Outline

  1. export terrain surfaces from GRASS to intermediate files
  2. import into R with raster package
  3. perform unsupervised classification on a sample of the cells using PAM
  4. apply clustering to unsampled cells with randomForest
  5. save results to intermediate file
  6. import results into GRASS for post-processing

Terrain Classification ExampleTerrain Classification Example

First-Cut Approach to Synchronizing Field Notes with GPS Data

Submitted by dylan on Mon, 2011-05-09 22:41.

After a week's worth of work in the field, I typically have several pages of hand-written field notes that are associated with GPS waypoints-- badly in need of some kind of transcription/organization. I have yet to find a simple approach for bringing together these non-spatial (field note transcriptions) and spatial (waypoints) data, linked only by a simple ID system. Also, I am somewhat limited by the software available on USDA computer systems. Here is a first-cut approach, implemented in R, that relies on CSV files. In a perfect world, I would implement something using python and PostGIS...

Importing Weather Data from Wunderground

Submitted by dylan on Mon, 2011-05-09 22:10.

Wunderground ExampleWunderground Example

The Wunderground.com website offers several creative interfaces to current and historic weather information. One of the more interesting features is the URL-based interface to personal weather stations. As far as I can tell, the Wunderground website only returns hourly data for a single day from personal weather stations... I wanted an entire year's worth of data, so it made sense to abstract the process of fetching a single day's worth of data from a named station into an R function. In this way, it is possible to quickly query the Wunderground website for arbitrary chunks of data. A semi-tested function, along with some examples are posted below. Enjoy!

( categories: )

Visualizing Terrain Surface Indicies with Scaled Arrows

Submitted by dylan on Sat, 2011-04-30 22:30.

Hamish Bowman recently posted a new GRASS module (d.barb) that can be used to depict the direction and magnitude components of some vector (e.g. wind) field along a raster surface or at points in space. An example (c/o Hamish):

GEOSTAT 2011 -- Canberra

Submitted by dylan on Mon, 2011-04-18 20:41.

Just got back from the 2011 GEOSTAT summer school that recently took place in Canberra, Australia. Thanks to Tom Hengl for the invitation to co-teach the course, to the great folks at ANU who made it possible, and to all of the students who participated. Most of the material from the class is available on the course website, including slides, R scripts, and other related demos. I have re-packaged some of my material on basic space/time analysis in R, and attached it to the bottom of this page. The self-contained demo includes in-line comments that closely follow the narrative from day 2 of the course. At some point I'll convert these examples into a proper web page... Enjoy!

( categories: )

A Lattice Panel Function for Filled Polygons that Accounts for Missing Data

Submitted by dylan on Mon, 2011-03-28 15:23.

This is a quick update to some code posted while back, related to plotting filled polygons within a lattice panel function. After attempting to use the originally described function to plot data with NA, I quickly realized that a more robust approach was required-- panel.polygon() does not deal well with missing data. A new function of the same name is attached at the bottom of the page, and some code demonstrating its use is presented below. The rle() function (run-length encoding) does most of the difficult work of identifying contiguous chunks of non-missing data. Each chunk is plotted as a separate polygon, resulting in a (mostly) generalized panel function for plotting filled polygons within the lattice framework. Comments welcome.

panel.tsplot() examplepanel.tsplot() example

( categories: )

Updates to SoilWeb Mobile: Distance from Nearest Map Unit Boundary

Submitted by dylan on Wed, 2011-03-16 18:41.

Working on some new ideas on how map unit data can be summarized on small screens-- particularly for our mobile version of SoilWeb. The distance from the nearest map unit polygon boundary is now printed above mini soil profile sketches. This gives the user a little more information that can be used to judge a relative degree of confidence in the returned soils data; the closer you are to the boundary the less likely you are actually standing in displayed map unit.

 
Here is an example:

( categories: )

Initial SoilWeb Concept on Paper

Submitted by dylan on Tue, 2011-03-08 03:49.

I found some of the original notes on what I envisioned our online soil survey interface would someday look like.

( categories: )

Tips for Using our Google Earth Interface to SoilWeb

Submitted by dylan on Mon, 2011-02-28 23:40.

GE SoilWeb DemoGE SoilWeb Demo

The folks in Lincoln recently changed the links to the OSDs from http:// to https:// style URLs... which seems to cause problems for new versions of Google Earth. I have noticed that when clicking on soil profile sketches an error is returned (something about an SSL handshake problem). This can be fixed by asking Google Earth to use an external browser for displaying data. Here are some instructions: