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

Add bbox parameter to @turf/interpolate #1031

Closed
stebogit opened this issue Oct 19, 2017 · 8 comments · Fixed by #2768
Closed

Add bbox parameter to @turf/interpolate #1031

stebogit opened this issue Oct 19, 2017 · 8 comments · Fixed by #2768

Comments

@stebogit
Copy link
Collaborator

Currently @turf/interpolate defines the area on which to interpolate the values as the bounding box surrounding the input points.
It would be useful to be able to define your area of interest, which might be different than the current (then default)bbox(points), like this:

screen shot 2017-10-19 at 8 11 05 am

or this:
screen shot 2017-10-19 at 8 19 22 am

@DenisCarriere
Copy link
Member

We can pass the same options from the grid modules, I've added mask for each of them, that might work?

@stebogit
Copy link
Collaborator Author

Yep, mask would definitely work 👍

Now that I look at it we should also rename cellSize to cellSide as we did in the grid modules

Also, I was wondering why was clone introduced in here

var newFeature = clone(gridFeature);
newFeature.properties[property] = zw / sw;
results.push(newFeature);
...
return featureCollection(results);

@DenisCarriere
Copy link
Member

Clone was used because it mutates the properties, I'm sure there might be a way to remove the clone.

newFeature.properties[property] = zw / sw;

@DenisCarriere
Copy link
Member

  • Change to cellSide 👍
  • mask works 👍

@romick101
Copy link

Hello, is there any progress with mask parameter? Maybe I'm overlooking some other way to achieve custom interpolation boundary?

@iamtekson
Copy link

iamtekson commented May 13, 2024

Is the mask parameter already implemented? I haven't seen that parameter in documentation.

EDIT: Even though the mask parameter is not mentioned in the documentation, it is there and working properly. But mask option doesn't seem like an option. For example, in below image, I am trying to interpolate 4 points within the polygon (pink background) but I got the values only for the bbox of the input points not for the whole polygon.

image

@smallsaucepan
Copy link
Member

Hi @iamtekson. Could you please clarify if this is currently just a documentation issue ...

mask parameter [...] is there and working properly

or an actual problem with the result you get back from the function ...

but I got the values only for the bbox of the input points not for the whole polygon

Or both?

@smallsaucepan
Copy link
Member

This will be resolved as part of #2444 so the user can pass an optional bbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants