"preparatory" operations in a GAMA script

84 views
Skip to first unread message

Annalisa Minelli

unread,
Oct 8, 2014, 12:09:30 PM10/8/14
to gama-p...@googlegroups.com
Hi all,
a (maybe stupid) question: I have some text files with some data varying temporally e.g.:

date time; value
01-01-2012 00:00:36;4.011
01-01-2012 00:01:36;4.005
...
etc etc

one file for each point in a georeferenced environment.
I would like to parse these files entering into them with a "date time" information, read the value for each point and interpolate a "raster" (or grid, maybe) or something wich creates a continuous coverage in my working space.
Stated that (maybe) the output layer must be treated as an agent, this operations (import/parsing/interpolation) must be done in the "global" section of the script (importing and declaring points as agents) or into the output-grid-agent declaration?

Thanks in advance,
Annalisa

Srirama Bhamidipati

unread,
Oct 8, 2014, 5:20:11 PM10/8/14
to
Hi, 

I am assuming you are good with GAMA, I have following ideas for your question:

for import i think may a matrix is a better option,
for parsing please see split_with operator,
for interpolate i don't think there is a direct process, here are two options:
a) do it outside GAMA, arcgis if you have access, then export to .asc and import into GAMA
b) with a simple code. e.g.. for IDW surface once you imported your points with their attributes: you can try with agents_at_distance operator then use their values to do IDW, you can also use a list of agents with operator at_distance and use them into a small calculation for IDW. For doing option b, you should use a blank grid and may be better to start with the lowest resolution permitted by your points so that each cell has only one point.

regards,
Srirama

 

Annalisa Minelli

unread,
Oct 9, 2014, 4:06:45 AM10/9/14
to gama-p...@googlegroups.com
Thank you for answering Sirama,


Il giorno mercoledì 8 ottobre 2014 23:20:11 UTC+2, Srirama Bhamidipati ha scritto:
Hi, 

I am assuming you are good with GAMA,

not so much but I can try :-) 
 
I have following ideas for your question:

for import i think may a matrix is a better option,
for parsing please see split_with operator,
for interpolate i don't think there is a direct process, here are two options:
a) do it outside GAMA, arcgis if you have access, then export to .asc and import into GAMA

so do you suggest me to parse the text files into GAMA, export it into a GIS and then do the interpolation? hmm.. I suppose I would do the parsing outside GAMA too and maybe import the interpolated surface, once created.. but, since I would like to explore the GAMA funcionalities, I am more interested in the second solution ;-)
 
b) with a simple code. e.g.. for IDW surface once you imported your points with their attributes: you can try with agents_at_distance operator then use their values to do IDW, you can also use a list of agents with operator at_distance and use them into a small calculation for IDW. For doing option b, you should use a blank grid and may be better to start with the lowest resolution permitted by your points so that each cell has only one point.

I think ithis is brilliant.. following with this purpose, it would be interesting to create the function wich does this.. I still have not the competencies to do that, but maybe you or other developers could implement the IDW algorithm or others more refined too (sometimes I write code for GRASS GIS and for example there are other interesting algorithms just like the RST - Regularized Spline with Tension - or the Kriging too [0][1]) 

regards,
Srirama

Many thanks for the clarifications,
Annalisa



 

Srirama Bhamidipati

unread,
Oct 9, 2014, 5:23:46 AM10/9/14
to gama-p...@googlegroups.com
Hi,

The most efficient and best use of GAMA would be to import a surface in .asc format.

All my suggestions were to make a model in GAMA, except for surface building, but also for which I indicate a possible solution with those operators. :) 
I understand your suggestions on other models which should be possible because gama has all the operators that can help, but you have to write your code (= calculation algorithm of surface), you can even use GAMA optimizer for the power relation in IDW for example.  
But since you say you "sometimes" write GRASS codes, you might want to explore the option in GAMA to bring in R :) :) and may be your favorite 'spatial' packages via R :)

I am not a programmer, I just have "ideas dime a dozen" it is the executioners (GAMA team) who are priceless !!. I think if you can do some Java you can write plugins and I can use them ...haha :)

best regards,
Srirama

Patrick Taillandier

unread,
Oct 9, 2014, 5:30:23 AM10/9/14
to gama-p...@googlegroups.com
Hi,

Just a example model for the loading of your data. As I do not know what is IDW, I cannot help you on that :p .

Cheers,

Patrick
 

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Annalisa.zip

Srirama Bhamidipati

unread,
Oct 10, 2014, 7:19:02 AM10/10/14
to
Hi Patrick,

She wants to create a surface (DEM) if not DTM. IDW is the most basic model to do so among the other models she indicated. I think they are all possible to do in GAMA but need coding :) 

regards,
Srirama

Annalisa Minelli

unread,
Oct 20, 2014, 4:40:42 AM10/20/14
to gama-p...@googlegroups.com
Hi all,
sorry for the absence but I was out of office these past days. 

Patrick: thanks you for the personalised model.. I'm trying to open it but, by some days, I experienced problems with GAMA itself (crashes when starting - so, what I'm going to do, is compiling the code).
At anyway I will let you know when I will be able to test it.

Srirama, exactly :-)

I will keep you up to date.
All the best,
Annalisa

Srirama Bhamidipati

unread,
May 5, 2015, 4:51:19 PM5/5/15
to gama-p...@googlegroups.com
Hi,

Here I made an IDW with GAMA

regards,
Srirama
Reply all
Reply to author
Forward
0 new messages