GeoTIFF / GeoTIFF/georaster-layer-for-leaflet-example
No color in the GeoTIFF
- Dominant language
- JavaScript
- Stars
- 98
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
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:
`
#map {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
// 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: '© <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());
});
});
`
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the inline HTML example in the issue and reproduce the result using the linked GeoTIFF URL. Inspect how GeoRasterLayer renders the parsed raster and compare it with the linked original image. Done means the radar overlay displays colors matching the original; the issue does not identify a repository file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100