Skip to content
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

clip option has no effect #19

Open
LelandB opened this issue Apr 14, 2021 · 2 comments
Open

clip option has no effect #19

LelandB opened this issue Apr 14, 2021 · 2 comments

Comments

@LelandB
Copy link

LelandB commented Apr 14, 2021

Hello, I'm trying out clipping on the demo and I can't seem to make it happen. I've added the following clip array that should bisect the tif.

const windSpeedUrl = "http://127.0.0.1:5500/demo/wind_speed.tif";
  // const windSpeedUrl =
  //   "https://danwild.github.io/leaflet-geotiff-2/wind_speed.tif";

  const plottyRenderer = L.LeafletGeotiff.plotty({
    displayMin: 0,
    displayMax: 10,
    clampLow: false,
    clampHigh: false,
  });

  const clipArray = [[-33, 147], [-27, 147], [-27, 159], [-33, 159]]

  const windSpeedLayer = L.leafletGeotiff(windSpeedUrl, {
    renderer: plottyRenderer,
    clip: clipArray,
  }).addTo(map);

What am I doing wrong?

@danwild
Copy link

danwild commented Jul 25, 2022

What am I doing wrong?

Nothing, it seems.

Clipping was disabled a while back by commenting out the createMask call in leaflet-geotiff.js#L463:

// mask caused problems and seems to be not needed for our implementation
// var mask = this.createMask(size, args);

"caused problems" is obviously ambiguous. Next steps - someone needs to identify the problem that clipping was causing, then implement a fix.

The clip option was irrelevant to our immediate use cases when furthering the development of this plugin. This remains the case, so - a PR is welcome here however otherwise this issue is unlikely to receive much focus from our team any time soon.

We should at least document this for now tho!

@danwild
Copy link

danwild commented Jul 25, 2022

Also note to self - I think mask would be a more descriptive way to refer to this option (more differentiated from bounds, and proposed bbox options).

@danwild danwild changed the title Having trouble clipping clip option has no effect Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants