Comments (11)
Hi @skynice
Thanks for submitting this issue. This seems like an error with LZW decoding. Could you please provide the TIFF file where this error occurs? Maybe I can have a look at it.
from geotiff.js.
@constantinius please download in http://182.92.155.46:81/geotiff.tif
from geotiff.js.
hm... when I try to open it with the basic testing html file it seems to load correctly (see image below; it is colorized using a color scale). What version of geotiff.js have you installed? Can you show me some code how you use it?
from geotiff.js.
@constantinius i clone the git project , in my project ,i use like this:
<title>Title</title> <script src="./geotiff.bundle.js" type="text/javascript"></script> <script> let filename = "geotiff.tif"; let pool = new GeoTIFF.Pool(); GeoTIFF.fromUrl(filename).then(function(tiff){ tiff.readRasters({interleave:true},pool).then(function(raster){ console.log('a') }); }).catch(function(error){ console.error(error) }); </script>
my browser is chrome 61.0.3163.79
please download in http://182.92.155.46:81/localhost.zip .see my chrome request deatials
from geotiff.js.
@constantinius if i use like this, the worked...
<title>Title</title> <script src="./geotiff.bundle.js" type="text/javascript"></script> <script> let filename = "geotiff.tif"; var xhr = new XMLHttpRequest(); xhr.open('GET', filename, true); xhr.responseType = 'arraybuffer'; xhr.onload = function(e) { let arrayBuffer = this.response; GeoTIFF.fromArrayBuffer(arrayBuffer).then(function(tiff ){ tiff.getImage(0).then(function(image){ let bbox = image.getBoundingBox(); console.log(bbox); let width = image.getWidth(); let height = image.getHeight() image.readRasters().then(function(rasters){ console.log('a') }); }).catch(function(error){ console.log(error) }) }) } xhr.send(); /* GeoTIFF.fromUrl(filename).then(function(tiff){ tiff.getImage(0).then(async function(image){ let bbox = image.getBoundingBox(); console.log(bbox); let width = image.getWidth(); let height = image.getHeight() let data = await image.readRasters(); console.log(data.length) }).catch(function(error){ console.log(error) }) }).catch(function(error){ console.error(error) });*/ </script>
from geotiff.js.
Alright, I see, I'll investigate further!
from geotiff.js.
@skynice
Okay, I think I now know what the issue is.
The problem seems to be twofold.
First: your server does not seem to understand HTTP Range requests, as it seems to answer with the complete file, when it actually only should respond with a portion of it.
Second: there seems to be a bug in handling exactly that case in the fromUrl
method within geotiff.js
If you are looking for a solution right now, you can use your second approach (downloading beforehand and using fromArrayBuffer
) or use a different server that understands HTTP Range requests.
In any case, I'll try to fix the issue, but I cannot promise that it will be in the near future, as I'm quite involved in other tasks.
Please let me know if you have found a suitable solution. Thanks again for reporting this issue!
from geotiff.js.
@constantinius thank you very much. i use webstorm nesting web server found the problem.today i receiver your reply ,i try iis or node express ,the function correctly
from geotiff.js.
Hi @constantinius,
Do you have an estimate when this issue with fromUrl
method will be fixed?
from geotiff.js.
Do you have the same issue? If yes, you could mitigate it by switching to a server that properly supports range requests and the issue should not arise.
Regarding the issue itself: the response size is not actively enforced, but it is handled in a more robust way when unexpectedly the whole file is returned.
I think there need to be more configuration options for those cases (like raising errors, when the whole file is returned unexpectedly or just continue).
There is currently no direct plan to fix the issue, as there are currently no resources to address this issue.
from geotiff.js.
Ok, thanks. I have some what similar issue but nothing that can't be worked around. Was just curious about the plans regarding this issue.
from geotiff.js.
Related Issues (20)
- The exports `package.json` needs a new paint job HOT 3
- How do I use compression? HOT 3
- Typescript compilation error in BaseClient HOT 14
- Writing GeoTiffs HOT 3
- Reading files larger than 4gb? HOT 1
- image.readRasters() HOT 3
- Exceeds max_safe_integer. Precision may be lost. HOT 2
- Type error at build time HOT 1
- Abort signal should be extended to `getImage` when performing slice's fetch action
- Property 'headers' does not exist on type '{}'
- Pool workers lead to memory leak? HOT 3
- using geotiff.js with react-native HOT 6
- 请升级一下lerc依赖 HOT 2
- credentials option is ignored HOT 3
- idenify does not work on GeoTiff float (Digitales Höhenmodell Oberfläche NRW) HOT 2
- Generating a geotiff from an image and a list of ground control points.
- readRGB() does not always return an interleaved array HOT 2
- Support also CommonJS HOT 4
- BlockedSource: Duplicated HTTP range requests
- capturing world coordinates form the tiff imaegs using geotiff.js HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geotiff.js.