The New California Water Atlas

Making water understandable in California


Visit Interactive Crop Map

Attended HackMeat, hosted at the Stanford dSchool in Silicon Valley. Learned from Susana Crespo, Industry Agriculture Specialist (ESRI) about CropScape.

Found the data in CropScape to be potentially useful for the Atlas -- since one hog farmer I spoke with said that there will be groundwater metering soon, though he knew that there was a particular carrot farm that used quite a lot of groundwater.

So I wanted to make it easier to see where the carrots are grown.

The CropScape data is a raster image of satellite data, where the colors of the crops are guessed using a computer program. Some agricultural ground truth was used to verify the likelihood that this information is correct.

The CropScapa data itself had problems. Mainly that a lot (~90) of the crops had the same colors as other crops. This makes it hard to read the map. Also, the legend is not obviously interactive - which makes it harder to understand the significance of the data.

After some futzing around (since I had never done anything with raster data before), I managed to create a new interactive of crops grown in CA in 2012.

It still needs an interactive color picker, but this will require a lot of coding so that might be a while, in the meantime, there is a color key that you can drag to the area, and see the match. I can also work on the colors to make them a little more distinct.

I plan to write a more indepth review of my steps to create this, but for now these were the basic steps:

  • Download data from Cropscape (with the correct mapping)
  • Import into QGIS, change the color map
  • Re-export GeoTFF with new colors (testing the basic colors)
  • Bring into TileMill
  • Create CartoCSS with exact color stops for the Raster data
  • Export Tiles, upload to Tilemill
  • Create javascript map interactive, host on OpenShift

I've already added this new "crops" layer to the Water Rights interactive. It will also be very helpful to combine with the groundwater as a way of understanding situations where the groundwater is likely to be more pumped.

At the very least, this gives us all a finer understanding of where crops are in our state.

Stay tuned for a more detailed post about how to do this for your state.


Thanks to Sophia Parafina, Nick Doiron, Susana (ESRI), Lefty, John Firebaugh and Dane Springmeyer & Aaron Ogle's walkshed.js for tips and examples of working with raster data on maps.

Subscribe to RSS - Mapbox