gama-platform / gama.old

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

Format not recognized: pgw #3660

Closed benoitgaudou closed 1 year ago

benoitgaudou commented 1 year ago

Describe the bug In the model downloading satellite images, (such as Download Data (OSM-images).gaml in the model library or in the COMOKIT model), there is a need to save spatial metadata in a pgw file.

Nevertheless, in the last version, the pgw format it not recognized anymore and we get the error:

2 occurrences in 2 agents at cycle 0: Format not recognized: pgw
in Simulation 0
in save info to: 'res/satellite.pgw' ;

To Reproduce Steps to reproduce the behavior:

  1. Open and run the following model (same can be observed on Download Data (OSM-images).gaml ):
l NewModel
global {
    init {
        string info <- ""  + 3 +"\n0.0\n0.0\n"+4+"\n"+"\n"+42;
        save info to: "res/satellite.pgw";        
    }
}
experiment name type: gui { }
  1. The error appears.

Desktop (please complete the following information):

AlexisDrogoul commented 1 year ago

Yes, right. This has been introduced in the last commit about SaveStatement. The recognised way to do it, now, is to indicate the type of file (actually, its format) if it is not very common. So save info to: "res/satellite.pgw" type: "text"; should work.

Two things here:

  1. I can perfectly (like it was before) make "text" the default (esp. when one saves a string). When the type is not declared, and if the file extension is not taken in charge by default, "text" would become the format to use.
  2. I'm planning on deprecating the type facet and renaming it format. More explicit and less ambiguous as we use type for many different things in GAML (attributes, displays, experiments...).

Any comments welcome !

AlexisDrogoul commented 1 year ago

Fixed. Appropriate warnings/infos are emitted during compilation if GAMA detects possible ambiguities in the file formats. type has also been deprecated in the favour of format (I've corrected all the models from the library).