Skip to content

No color in the GeoTIFF #5

@ccalvosa

Description

@ccalvosa

Hello everyone,

I tried to develop a Radar Visor from AEMET images but I can't show the color of the radar. This is the code:
`

<style> #map { bottom: 0; left: 0; position: absolute; right: 0; top: 0; } </style>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> <script src="https://unpkg.com/georaster"></script> <script src="https://unpkg.com/georaster-layer-for-leaflet/georaster-layer-for-leaflet.browserify.min.js"></script> <script> // initalize leaflet map var map = L.map('map').setView([41.7, 0], 5);
  // add OpenStreetMap basemap
  L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
      attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
  }).addTo(map);

  var url_to_geotiff_file = "http://radarzgz.meteozgz.eu/last2.tif";

  fetch(url_to_geotiff_file)
    .then(response => response.arrayBuffer())
    .then(arrayBuffer => {
      parseGeoraster(arrayBuffer).then(georaster => {
        console.log("georaster:", georaster);

        /*
            GeoRasterLayer is an extension of GridLayer,
            which means can use GridLayer options like opacity.
            Just make sure to include the georaster option!
            http://leafletjs.com/reference-1.2.0.html#gridlayer
        */
        var layer = new GeoRasterLayer({
          attribution: "Planet",
          georaster: georaster,
          resolution: 300,
          opacity: 0.6
        });
        layer.addTo(map);

        map.fitBounds(layer.getBounds());

    });
  });

</script>
`

And you can enter to visor: http://radarzgz.meteozgz.eu/geotif.html The original is this: https://ama.aemet.es/o/estaticos/productos/scm/202004122300_r8za.gif

I don't know how to do to show the original colors...

Thank you very much.

Carlos C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions