Giter VIP home page Giter VIP logo

Comments (11)

constantinius avatar constantinius commented on June 14, 2024

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.

skynice avatar skynice commented on June 14, 2024

@constantinius please download in http://182.92.155.46:81/geotiff.tif

from geotiff.js.

constantinius avatar constantinius commented on June 14, 2024

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?

image

from geotiff.js.

skynice avatar skynice commented on June 14, 2024

@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.

skynice avatar skynice commented on June 14, 2024

@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.

constantinius avatar constantinius commented on June 14, 2024

Alright, I see, I'll investigate further!

from geotiff.js.

constantinius avatar constantinius commented on June 14, 2024

@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.

skynice avatar skynice commented on June 14, 2024

@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.

jukkatolonen avatar jukkatolonen commented on June 14, 2024

Hi @constantinius,

Do you have an estimate when this issue with fromUrl method will be fixed?

from geotiff.js.

constantinius avatar constantinius commented on June 14, 2024

Hi @jukkatolonen

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.

jukkatolonen avatar jukkatolonen commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.