Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PostGIS 2.0 Raster on CartoDB for analytical we...

jatorre
April 11, 2012

PostGIS 2.0 Raster on CartoDB for analytical web mapping

The abundance of geographic data in raster form available on the web is growing. For those that want to build this data into applications or perform analysis, it can often be hard to use. CartoDB is built on top of the PostGIS 2.0, including raster support. This gives CartoDB users some simple ways to access and support raster data in their applications.

Here we will demonstrate a few of those methods. First, we will discuss the support of rasters in CartoDB, including import and manipulation. Next, we will discuss the development of algorithms that allow users to turn large raster datasets into vector representations that support visual communication, and then how to create beautiful visualizations using the existing CartoDB mapping tools.

Finally, we will highlight some of the SQL methods for accessing and manipulating raster data in the CartoDB environment. We will show examples using the CartoDB API for extracting raster regions, recomputed raster layers, and converting rasters to vectors for in GeoJSON format.

jatorre

April 11, 2012
Tweet

More Decks by jatorre

Other Decks in Technology

Transcript

  1. UPDATE hapctnpp_geotiff SET rast = ST_MapAlgebraExpr(rast, '8BUI', 'CASE WHEN [rast]

    = 0 THEN 10 WHEN [rast] = 255 THEN 11 ELSE floor([rast]/32)::int END') ; %PXOTBNQMJOH
  2. select st_multi( st_makevalid( (geomval).geom) ) as the_geom, (geomval).val as value

    from (select ST_DumpAsPolygons(rast) as geomval from hapctnpp_geotiff) f 3BTUFSUPQPMZHPOT
  3. WITH foo AS ( SELECT ST_AsRaster(triangle.the_geom, rast ) AS rast

    FROM triangle, hapctnpp_geotiff WHERE ST_Intersects(triangle.the_geom,rast) LIMIT 1) SELECT (ST_SummaryStats(ST_Union(ST_MapAlgebraExpr(m.ra st, f.rast, '[rast1.val]', '16BUI')))).* as rast FROM hapctnpp_geotiff m JOIN foo f ON ST_Intersects(m.rast, f.rast); 4QBUJBMRVFSZ