Leaflet.glify icon indicating copy to clipboard operation
Leaflet.glify copied to clipboard

Increase precision of points, lines and shapes by translating them clo…

Open RayLarone opened this issue 3 years ago • 7 comments

…ser to the Pixel Origin.

See this issue (#137) for an explanation of the code.

This branch aims to resolve #137, #54 and #119.

This is using the map center (map.getCenter()) as a best guess at where the "precision center" should be located. Other options could be to use the data/geojson centroid, or to pass in a LatLng pair as an argument.

RayLarone avatar Jul 06 '22 11:07 RayLarone

Hello, How about the global approach with emulating double-precision webGL shown in Double precision on WebGL for mapping centimetric points #54.

kkdd avatar Jul 19 '22 08:07 kkdd

Hi @kkdd. Yeh, double precision in WebGL would be a better solution overall as it would give high precision for the whole map. Although, I don't know enough about shaders to do this, also it might affect the performance of the plugin as a lot more computation is being done in the shader.

The solution in this pull request doesn't change the shaders in any way and will have a negligible impact on performance as it is only changing a few lines of code. It should be enough for most use cases.

Whatever the case, this is what I am using to plot high precision points, so thought I'd share it with the group.

RayLarone avatar Jul 19 '22 11:07 RayLarone

Hello, RayLarone. Thank you for your comment. I see that the performance should also be important factor, as you mentioned.

kkdd avatar Jul 19 '22 11:07 kkdd

This PR breaks unit tests. Could you fix those, and commit? Then I can merge.

robertleeplummerjr avatar Apr 14 '23 20:04 robertleeplummerjr

Hi @robertleeplummerjr. Sure, although apologies, I'm a data analyst not a programmer so maybe I'm not fully understanding the unit testing. What do you mean by this pull request breaks unit tests?

When I clone this branch, run npm i and then yarn test I get the message:

Test Suites: 11 passed, 11 total
Tests:       249 passed, 249 total
Snapshots:   0 total
Time:        5.696 s
Ran all test suites.
Done in 6.85s.

How can I see which unit tests need addressing so I can fix the issues?

RayLarone avatar Apr 17 '23 11:04 RayLarone

Perhaps I had a premature failure when I tested it. I'm away this week but next I'll look into merging.

robertleeplummerjr avatar Apr 17 '23 15:04 robertleeplummerjr

@robertleeplummerjr please look into merging again :)

hoixw avatar Mar 23 '24 18:03 hoixw

The build and tests run without errors for me.

trafficonese avatar Jun 02 '24 08:06 trafficonese