gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

No warning when default CRS of the world does not match shape file CRS #2841

Closed chapuisk closed 5 years ago

chapuisk commented 5 years ago

Describe the bug When using shapefile of a different CRS than of the world's default CRS (WSG 84 / Pseudo-Mercator), you can have unwanted behavior: e.g. any save statement will then change CRS to be the one of the world, blank display. the issue is also related to gama-platform/gama2#38

To Reproduce There is two situation where you can find this problem:

  1. When you do not change the shape of the world while using shape file of a different CRS, e.g. using Gama to modify a shape file (clean, prepare for further simulation, etc.)
  2. When you redefine the shape of the world using geometries of a shape file with a different CRS rather than the file itself: geometry shape <- envelope(union(shapefile.contents));

Expected behavior Raise a warning/error when manipulating shapefiles that do not have the same CRS as the one of the world. In fact, this is not obvious that modifying the shape of the world also change the CRS and may be we should add this to the documentation

Desktop (please complete the following information):

AlexisDrogoul commented 5 years ago

I think these two situations correspond to very narrow (and different) use cases. It would be better to split them into two issues with example models to test the fixes. Thanks !