Three New Soils-Related KMZ Demos

Submitted by dylan on Tue, 2010-12-07 18:25.

LCC KMZLCC KMZ
Soil Texture KMZSoil Texture KMZ

 
Updated versions of three soils-related KMZ files: 1-km scale, aggregate LCC, CA Storie Index, and soil texture data, derived from SSURGO. These are part of a series of KMZ / raster datasets that will be published soon. See attached files at the bottom of the page. Enjoy!

AttachmentSize
ca_lcc.kmz181.96 KB
storie.kmz601.45 KB
texture_rgb.kmz963.63 KB

Made in R?

Hi,

Do you create these kmz files in R? If yes, would a small R script example be possible?

Thanks and cheers,
Jan

RE: Made in R?

Hi Jan,
I used GRASS to produce the maps, the GRASS add-on r.out.kml to produce the kml structure, and finally R to produce the ternary legend. Here is an example, updated to produce a PNG with a transparent background:

# need this for soil.texture()
library(plotrix)

# generate all possible combinations of sand,silt,clay
# up to limits defined by original data
g <- expand.grid(sand=1:98, silt=1:80, clay=1:65)

# keep only those combinations that actaully add up to 100%
g.sub <- subset(g, subset=sand+silt+clay == 100 )

# compose an example figure
soil.texture(g.sub, col.symbols=rgb(r=g.sub$clay, g=g.sub$silt, b=g.sub$sand, max=100), pch=15, show.names=FALSE, show.lines=FALSE)

# save a PNG version with transparent background + white text
png(file='legend-test.png', width=400, height=400, bg=NA)
soil.texture(g.sub, col.symbols=rgb(r=g.sub$clay, g=g.sub$silt, b=g.sub$sand, max=100), pch=15, show.names=FALSE, show.lines=FALSE, col.axis='white')
dev.off()