-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to change band number #31
Comments
I've just started using this library, since it seems to plot GeoTIFF data nicely, but I've been having the exact same 2 problems. I've been using an 8 band TIF image: 8band.zip and am unable to plot anything but the first band. The maximum data value is around 158 if you want to try using the attached file (zipped, since github won't allow .tif attachments), but I am seeing the same missing data issue by setting the maximum data value to about 80, since that's what I'm interested in visualising. For what it's worth, I can get the desired effect by setting Looking at the code, I don't know why line 266 doesn't say something like:
but I presume that's to do with how you want RGB plotted images to behave. I'm also unable to get the |
I also ran into this issue. I don't think the If I change the options value for |
Hi there. I'm running into a couple potential errors (could be on my end). I'm hoping you can help me understand what's going wrong. I have a local geotiff with 4 bands that I'm visualizing. 2 unexpected errors:
Here is my code if helpful:
JAVASCRIPT
import "leaflet-geotiff-2";
import "leaflet-geotiff-2/dist/leaflet-geotiff-plotty";
var map = L.map('map').setView([38, -98], 5);
var streetMap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: 'Map data © OpenStreetMap contributors, Imagery © Mapbox',
maxZoom: 18,
id: 'mapbox/streets-v11',
tileSize: 512,
zoomOffset: -1,
accessToken: '..........'
});
streetMap.addTo(map);
var renderer = L.LeafletGeotiff.plotty({displayMax: 15, colorScale: "viridis"})
var layer_options = {renderer: renderer, band: 3} //change band number here!!
var layer = L.leafletGeotiff("./dist/imgs/test_sept.tif", layer_options).addTo(map);
HTML
<style> body { padding: 0; margin: 0; } html, body, #map { height: 100%; width: 100%; } </style> <script src="node_modules/leaflet/dist/leaflet.js"></script> <script src="node_modules/geotiff/dist-browser/geotiff.js"></script> <script src="node_modules/plotty/dist/plotty.js"></script> <script src="./dist/main.js"></script>I'm unable to attach a geotiff (although I can email it if helpful). Here is the converted png:
The text was updated successfully, but these errors were encountered: