keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.4k stars 1.74k forks source link

[Bug] GridLayer grid tiles overlapping, render issue. #1475

Open BremzeLV opened 3 years ago

BremzeLV commented 3 years ago

Describe the bug When Rendering Grid Layer, if I use data that is close toghether then it renders okay. About 10 datapoints somewhere in Berlin: image

If I add one more Item to the dataset that is somewhere far away from the first 10 datapoints, it renders with overlapping grid layers. For example points: "latitude": 1.520008, "longitude": 179.404954 image

To load data I pass it to processRowObject() then KeplerGlSchema.load() and then addDataToMap(). Map is rendered before we get data and after that its updating map styles, configs and adding data.

Expected behavior Would render without overlapping

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Its not this dataset specific problem, it can be reproduced with different datasets too.

May be linked to this one https://github.com/keplergl/kepler.gl/issues/887

chrisgervang commented 3 years ago

Thanks! Adding the relevant slack thread with more pictures. https://kepler-gl.slack.com/archives/CLTV06E20/p1620476006015600

chrisgervang commented 3 years ago

image

ibgreen commented 3 years ago

@igorDykhta FYI

igorDykhta commented 3 years ago

I guess it is a known issue when the size of cells is calculated based on the center of the grid and doesn't take into account Mercator distortion. Tried to fix this previously but cells closer to poles are getting too rectangular.

BremzeLV commented 3 years ago

I guess it is a known issue when the size of cells is calculated based on the center of the grid and doesn't take into account Mercator distortion. Tried to fix this previously but cells closer to poles are getting too rectangular.

The one question is why its happening longitudinally, wouldnt that distort more laterally? And they are not getting really rectangular, they just move out of grid "bounds". @igorDykhta

In the first image it isnt distorted, its a good render of an grid containing 1x2 grid tiles in 4sets. in 2nd image the blocks move to left or right and its the same dataset. Not sure if the Mercator distortion would do that.

BremzeLV commented 3 years ago

Maybe there is a way to render based on multiple center points? Like subpoints for every subset of data cluster on the map? The closer the center the better rendering.