splashblot / dronedb

Location Intelligence & Data Visualization tool
http://carto.com
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Allow dynamic raster colorisation based on index #56

Open apercas opened 7 years ago

apercas commented 7 years ago

Add a legend with the color steps in it when a raster layer is displayed. Coordinate with @agrosmartrural for data validation.

apercas commented 7 years ago
raster name (varchar) color type (varchar)
my_awesome_raster_field5_raster NDVI
second_raster_temperature Temperature

Current plan for once a user drags a raster dataset:

Ideas @jjmata @ivanprado?

ivanprado commented 7 years ago

Some thoughts:

apercas commented 7 years ago

Just as a reference, QGIS file for styling example (please note that we also have the opacity value in case we don't want to display them with the same transparency):

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="2.18.2" minimumScale="inf" maximumScale="1e+08" hasScaleBasedVisibilityFlag="0">
  <pipe>
    <rasterrenderer opacity="1" alphaBand="0" classificationMax="50.4219" classificationMinMaxOrigin="CumulativeCutSubExtentEstimated" band="1" classificationMin="29.2193" type="singlebandpseudocolor">
      <rasterTransparency/>
      <rastershader>
        <colorrampshader colorRampType="INTERPOLATED" clip="0">
          <item alpha="255" value="29.2" label="29.2" color="#d7191c"/>
          <item alpha="255" value="34.5" label="34.5" color="#fdae61"/>
          <item alpha="255" value="39.8" label="39.8" color="#ffffbf"/>
          <item alpha="255" value="45.1" label="45.1" color="#abd9e9"/>
          <item alpha="255" value="50.4" label="50.4" color="#2c7bb6"/>
        </colorrampshader>
      </rastershader>
    </rasterrenderer>
    <brightnesscontrast brightness="0" contrast="0"/>
    <huesaturation colorizeGreen="128" colorizeOn="0" colorizeRed="255" colorizeBlue="128" grayscaleMode="0" saturation="0" colorizeStrength="100"/>
    <rasterresampler maxOversampling="2"/>
  </pipe>
  <blendMode>0</blendMode>
</qgis>