Closed davemfish closed 1 year ago
But I think that would require serving an RGB image rather than the singleband LULC.
This is what I had to do for the global web viewer, though because of a different issue with Mapbox limitations. I found it a bit tedious to have to generate the RGB images and track those as well. Hopefully we can work this out so we don't have to do something similar.
The server returning the 416 here is the vite dev server. And it may not be in compliance with the byte-range
spec. So this may not be an issue in production, but it's still an issue now nonetheless.
I added an nginx server to serve static files (and a bonus browseable index) at localhost:9000
in 338732c, which appears to work fine for me locally! But we will have to adjust URLs to point to a new port for those files.
The new server is working great. I think we can close this issue.
Thanks to #65 , we now have rasters created by wallpapering & parcel fill that we can display on the openlayers map. But I'm encountering this problem when loading these data sources in the same way we do the nationwide LULC -- that is as a
ol/source/GeoTIFF
as the source of aol/layer/WebGLTile
.Here's how the failed fetch looks in devtools.
I don't understand why we get a 416 here, since it seems like the range requested (
Range: bytes=0-65536
) is wider than the full size of the file (Content-Range: bytes */3356
). And what I've read suggests the intersection of the byte range should be returned. https://httpwg.org/specs/rfc9110.html#byte.rangesHowever we can modify the Headers to request a specific range, and when I do that with a range <= to the length of the file (e.g.
Range: bytes=0-3355
) the fetch completes successfully. So technically a solution could be to inform the client of the length of the file beforehand, but it really seems that shouldn't be necessary.Another option: Since these rasters tend to be fairly small, it could make sense to always fetch the complete file and load it as an
ol/layer/Image
rather than aTileLayer
withGeoTIFF
source. But I think that would require serving an RGB image rather than the singleband LULC.