riatelab / magrit

Thematic cartography entirely in the browser ♥
https://magrit.cnrs.fr
GNU General Public License v3.0
128 stars 18 forks source link

Grid transformation on "Europe NUTS2" layer - geometry2.coordinates is undefined #127

Closed RCura closed 4 months ago

RCura commented 4 months ago

After adding the Europe NUTS2 layer (example data), I tried to apply a grid (carroyage) transformation to it, using the AREA_TOT_2024 variable, and the grid creation fails with this error :

image

In the browser debug terminal :

computeGriddedLayer: isGeo false ; resolution 180000 meters
mthh commented 4 months ago

En effet. Je vais investiguer ça. Merci !

mthh commented 4 months ago

cc @rysebaert The NUTS2 example dataset has a lot of topology issues (cf. screenshot below after NUTS2 aggregation).

export (36)

Once they are fixed, the gridding seems to work fine.

So the issue is two-fold: we should try to be better at handling problematic datasets (not always super easy) and we should avoid to propose example datasets with topology issues (note that the topology issues of the NUTS2 dataset can be corrected directly in Magrit in the simplification panel by adjusting the "Précision des coordonnées" parameter).

mthh commented 4 months ago

The handling of the reported error has been fixed.

I've also improved the topology of the dataset that triggered the error.