UI Sandbox - GED4GEM render the GeoTiff in the UI

Bug #952811 reported by Ben Wyss
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Medium
Ben Wyss

Bug Description

Once a GeoTiff of the gem_exposure data has been created, it then needs to be exposed to GeoServer and styled in a meaningful way, and then added as a layer in the applications JS.

Tags: ged4gem ui
Revision history for this message
Ben Wyss (bmwyss) wrote :

After a little bit of investigating I found that the data is organized into a kind of logic tree style format where there are 70 exposure solutions for each point.

It is however, required that we use data for the GeoTiff that has not been divided up into such a format. Because of this I need to build a query that will generate a temporary table that contains the total urban population per grid cell for 2010 for one country, and a second for the total rural population per grid cell for 2010 for one country.

To do this Paul is going to restore the whole GED4GEM database on his computer and build the temporary tables. After that I can use pgsql2shp (http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide_20.bqg) to generate a shapefile, and then GDAL to rasterize the vector (http://www.gdal.org/gdal_rasterize.html) to a GeoTiff.

Revision history for this message
Ben Wyss (bmwyss) wrote :

The scale for the urban should be from 0 to 149591
and the scale for rural should be from 0 to 17052

Revision history for this message
Ben Wyss (bmwyss) wrote :
Download full text (4.2 KiB)

to render the Geotiffs into a UI, I first registered the layers with GeoServer, than placed each urban and rural pair into a layer group.
Next I made a small JS application for GED4GEM exposure and added the layers.
Then I created a geosever style for urban:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" version="1.0.0">
  <NamedLayer>
    <Name>raster_layer</Name>
    <UserStyle>
      <Name>raster</Name>
      <Title>A boring default style</Title>
      <Abstract>A sample style for rasters</Abstract>
      <FeatureTypeStyle>
       <Rule>
       <RasterSymbolizer>
         <ColorMap>
           <ColorMapEntry color="#FFFFFF" quantity="0" opacity="0"/>
           <ColorMapEntry color="#f5f8f5" quantity="10" opacity=".7"/>
           <ColorMapEntry color="#e8f0e8" quantity="25" opacity=".7"/>
           <ColorMapEntry color="#d8e5d7" quantity="50" opacity=".7"/>
           <ColorMapEntry color="#c7d9c5" quantity="100" opacity=".7"/>
           <ColorMapEntry color="#b4ccb1" quantity="250" opacity=".7"/>
           <ColorMapEntry color="#9fbf9c" quantity="500" opacity=".7"/>
           <ColorMapEntry color="#a0bf9c" quantity="750" opacity=".7"/>
           <ColorMapEntry color="#8bb187" quantity="1000" opacity=".7"/>
           <ColorMapEntry color="#76a372" quantity="2500" opacity=".7"/>
           <ColorMapEntry color="#62965d" quantity="5000" opacity=".7"/>
           <ColorMapEntry color="#4d8847" quantity="7500" opacity=".7"/>
           <ColorMapEntry color="#397a32" quantity="10000" opacity=".7"/>
           <ColorMapEntry color="#095a01" quantity="17052" opacity=".7"/>
         </ColorMap>
       </RasterSymbolizer>
      </Rule>
     </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

and for urban:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" version="1.0.0">
  <NamedLayer>
    <Name>raster_layer</Name>
    <UserStyle>
      <Name>raster</Name>
      <Title>A boring default style</Title>
      <Abstract>A sample style for rasters</Abstract>
      <FeatureTypeStyle>
       <Rule>
       <RasterSymbolizer>
         <ColorMap>
           <ColorMapEntry color="#FFFFFF" quantity="0" opacity="0"/>
           <ColorMapEntry color="#f8f8fa" quantity="10" opacity=".7"/>
           <ColorMapEntry color="#eff0f3" quantity="25" opacity=".7"/>
           <ColorMapEntry color="#e5e6ec" quantity="50" opacity=".7"/>
           <ColorMapEntry color="#d9dbe3" quantity="75" opacity=".7"/>
           <ColorMapEntry color="#cccfd9" quantity="100" opacity=".7"/>
           <ColorMapEntry color="#bec2cf" quantity="250" opacity=".7"/>
       ...

Read more...

Changed in openquake:
status: New → Confirmed
Changed in openquake:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.