Great work with the library.
I have an issue with opacity/clarity of tiles, thumbnails and overall Geotiffs/COGs as well as COGs not getting tiled.
Opacity Issue: When using the swagger API to get a thumbnail of an existing COG, if I include "EPSG:3857" on the request, I get a washed out image
However, if I omit the EPSG Code, I get a clear image thumbnail. I have tested with multiple COGs and raw GeoTiffs
In Django Admin, the same Geotiffs and COGs are also washed out
I have also used a separate Leaflet html page to access the /api/maps/{id}/{z}/{x}/{y}.png and I get the same washed out images
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta charset="utf-8" />
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ=="
crossorigin=""
/>
<script
src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ=="
crossorigin=""
></script>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map("map").setView(
[-0.24511062205544606, 34.87011481076246],
16
);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxZoom: 18,
}).addTo(map);
L.tileLayer(
"http://localhost:8000/api/maps/1/tiles/{z}/{x}/{y}.png?projection=EPSG%3A3857",
{
attribution:
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxZoom: 23,
opacity: 1,
}
).addTo(map);
</script>
</body>
</html>
However, in the above example, if I do not append the EPSG code on the url in html, then I get an error (no map rendered) and a 400 bad request
As for individual tiles, if I include the EPSG Code in the request body in swagger UI, i get a washed out tile
However, if I omit the EPSG code, I get a bad request error
An example COG metadata is
{
"geospatial": true,
"levels": 8,
"sizeX": 32465,
"sizeY": 28586,
"sourceLevels": 8,
"sourceSizeX": 32465,
"sourceSizeY": 28586,
"tileWidth": 256,
"tileHeight": 256,
"bounds": {
"ll": {
"x": 34.85392278135806,
"y": -0.23501171685313998
},
"ul": {
"x": 34.85392278135806,
"y": -0.2273338589976692
},
"lr": {
"x": 34.86258419062559,
"y": -0.23501171685313998
},
"ur": {
"x": 34.86258419062559,
"y": -0.2273338589976692
},
"srs": "EPSG:4326",
"xmin": 34.85392278135806,
"xmax": 34.86258419062559,
"ymin": -0.23501171685313998,
"ymax": -0.2273338589976692
},
"sourceBounds": {
"ll": {
"x": 34.85392278135806,
"y": -0.23501171685313998
},
"ul": {
"x": 34.85392278135806,
"y": -0.2273338589976692
},
"lr": {
"x": 34.86258419062559,
"y": -0.23501171685313998
},
"ur": {
"x": 34.86258419062559,
"y": -0.2273338589976692
},
"srs": "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs",
"xmin": 34.85392278135806,
"xmax": 34.86258419062559,
"ymin": -0.23501171685313998,
"ymax": -0.2273338589976692
},
"bands": {
"1": {
"min": 55,
"max": 255,
"mean": 193.05740298087738,
"stdev": 72.13546456636203,
"units": "metre",
"interpretation": "red",
"maskband": 4
},
"2": {
"min": 63,
"max": 255,
"mean": 194.14802446569178,
"stdev": 70.6158617103163,
"units": "metre",
"interpretation": "green",
"maskband": 4
},
"3": {
"min": 41,
"max": 255,
"mean": 182.4484673790776,
"stdev": 84.39825325395805,
"units": "metre",
"interpretation": "blue",
"maskband": 4
},
"4": {
"min": 0,
"max": 255,
"mean": 109.17366774465692,
"stdev": 126.17604981162934,
"units": "metre",
"interpretation": "alpha"
}
},
"magnification": null,
"mm_x": 2.969893339423529,
"mm_y": 2.969893339423529,
"proj4": [
"+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs"
],
"frames": false
}
bug