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

The interpolation result heatmap has abnormal deformation on the x-axis #11

Closed
StarWish365 opened this issue Oct 4, 2024 · 7 comments · Fixed by #13
Closed

The interpolation result heatmap has abnormal deformation on the x-axis #11

StarWish365 opened this issue Oct 4, 2024 · 7 comments · Fixed by #13

Comments

@StarWish365
Copy link

Hello, I encountered some problems when using your open source interpolation API, as shown in the figure below:

In theory, the interpolation result should present circular hot spots around the data points, but in my drawing results, the hot spots are distributed in elongated ellipses along the x-axis. My drawing is based on the Mapbox API, so I want to confirm whether this problem may be related to the coordinate system I use?

I have carefully checked the parameter settings of the interpolation calculation and found no obvious problems. Have you encountered similar situations? Or do you have a recommended solution?

Thank you very much for your help!
image

@Rylern
Copy link
Owner

Rylern commented Oct 4, 2024

I want to confirm whether this problem may be related to the coordinate system I use?

Do you use the Mercator projection? Only this projection is supported

@StarWish365
Copy link
Author

I want to confirm whether this problem may be related to the coordinate system I use?

Do you use the Mercator projection? Only this projection is supported

Yes! Mercator projection is the default projection and I didn't change it. The problem still exists.
image
image

@Rylern
Copy link
Owner

Rylern commented Oct 13, 2024

So I think this is related to the nature of the IDW formula. If the range of latitude of your points is bigger than the range of longitude of your points, then you see these elongated ellipses along the x-axis.

For example, here is what it looks with 5 points that have the same latitude:
image
The ellipses are elongated along the y-axis.

And here is what it looks with 5 points that have the same longitude:
image
The ellipses are elongated along the x-axis.

I'm not sure if this is the correct explanation though. Does it make sense to you?

@StarWish365
Copy link
Author

Yeah I think it makes sense. Because I tried setting my map size to a 1:1 aspect ratio and the heatmap stretching stopped happening. Thanks a lot.

@StarWish365
Copy link
Author

Hello, I found that whether my heat map is stretched or not is related to the map size I set. When my map‘s width is larger than height, the heat map is stretched on the x-axis, and when the height is larger than the width, it is stretched on the y-axis.
image
image

My current solution is to set the map width and height to 1:1. Do you have any solution so that I can get a normal heat map on a non-square map?

@Rylern Rylern mentioned this issue Nov 6, 2024
@Rylern Rylern closed this as completed in #13 Nov 6, 2024
@Rylern
Copy link
Owner

Rylern commented Nov 6, 2024

You're right. I spent a few days thinking of a solution and I came up with a very simple one. Could you try version 1.6.1 and tell me if it's good for you?

@Rylern Rylern reopened this Nov 6, 2024
@StarWish365
Copy link
Author

You're right. I spent a few days thinking of a solution and I came up with a very simple one. Could you try version 1.6.1 and tell me if it's good for you?

Hi, I tried the new version and it works perfectly now. Thanks!

@Rylern Rylern closed this as completed Nov 7, 2024
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

Successfully merging a pull request may close this issue.

2 participants