-
Notifications
You must be signed in to change notification settings - Fork 27
Large polygons are bad for performance #9
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
Comments
Is this using poly? |
Yep, just |
Hm...If you give it a connectivity, that shouldn't be a problem. |
Not sure to which degree the projection part is responsible. But would be good to set that up such that it doesn't allocate a length 2 Vector for each coordinate. |
I guess it might be? I get a lot of mouse stutter, and typing speed slows to a crawl. Replotting something else, like |
The projection isn't, per se, but we have to deform the image - since projections are a black box, we need to know where the x, y coordinates of the image's grid map to. Therefore it's unfortunately necessary to allocate that length-2 vector. On the plus side, though, it only needs to be allocated once, and as long as the data isn't some ridiculously large resolution it should be fine to at least save to png. |
Do you have an mwe for pure Makie? |
Nevermind, figured the mesh thing out, forgot to set shading to false. |
Whoa, this is really fast now...what happened to |
btw, surface also works with gridlike but distorted data like this, and has an optimized shader ;) |
What's the method signature for that? |
dang...I've been missing out I guess :D...thanks Simon! Will try that now. BTW, is it possible to use a 2D surface? |
Yup! |
Huh, transforming this will be interesting :D - will have to figure some way out of transforming subarrays. Will be interesting for sure....is there any way to provide a Matrix of Point2f0 or something to the surface instead? |
Figured it out - just hacked the underlying proj4 implementation :D |
Again - thanks a lot @simon! @visr, the situation is a little better now - instead of materializing |
You can't realistically go above 720x360 in a polygon without running into serious performance issues, at least the way I've implemented it currently. @SimonDanisch is there any way this could be done in the backend, as a nonlinear projection? It would have to be sort of black-boxed, though.
To give a brief explanation of what's going on now, what I've done is to simply define a mesh based on a regular grid in input space (usually untransformed lat-long), and then transform the points into projected space (whatever target projection is given). Then, an image is provided as the colour for the mesh.
As I understand it, this is similar to the approach which most people take to deforming images; however, it is much less performant. Any help optimizing this would be really appreciated.
The text was updated successfully, but these errors were encountered: