[GRASS-dev] Temporal GIS: best practice to access a map at a specific time?

Laurent C. lrntct at gmail.com
Thu Aug 13 11:20:20 PDT 2015


Hi Luca,

Sorry, I did not see your answer before. I actually solved my problems
some months ago.
Since my program is using internally numpy array, what I did is
creating a Class that stores an array alongside with start_time and
end_time. A method allows to check whether or not the array is still
"valid" using get_registered_maps_as_objects and a WHERE statement.

Thanks,
Laurent

2015-07-29 14:31 GMT-05:00 Luca Delucchi <lucadeluge at gmail.com>:
> On 22 May 2015 at 22:54, Laurent C. <lrntct at gmail.com> wrote:
>> Hi all,
>>
>
> Hi Laurent,
>
> I try to answer to your question
>
>> I'm working on a python module which compute superficial flows using
>> simplified shallow water equations. It already works quite well and export
>> results as temporal data sets.
>> But I'd like to add the possibility to work with temporal data sets as input
>> (typically rainfall or other input flows).
>> I've looked at the documentation of the temporal module, but I haven't
>> figure out what would be the best way to access a strds at a specified time.
>> There might be something with get_registered_maps, but I don't know how to
>> select the map when the simulation time is between 'start-time' and
>> 'end-time'. I don't know is SQL would be of any help here.
>>
>
> to get the registered maps for a period you can use t.rast.list using
> the where option like "where=start-time>'2001-01-01 12:30:00' and
> end-time<='2001-01-01 13:30:00' " or using the python function
> tgis.list_maps_of_stds("strds", input, columns, order, where,
> separator, method, header, granule)
>
>> currently my program looks like this:
>>
>> ************
>> load grass maps as numpy arrays
>>
>> while not sim_clock >= sim_duration:
>>     calculate time-step duration
>>     calculate flow and water depth
>>     write results
>>
>> register produced maps in space-time dataset
>> ************
>>
>> I was thinking of checking at the beginning of the while loop if there is
>> the current input map is still valid for the current time-step, and ielse
>> loading the new one. Does this approach make sense and how could I do that?
>>
>
> If I understand well your question, yes it should
>
>> Thanks for your time.
>>
>> Regards,
>> Laurent
>>
>
>
> --
> ciao
> Luca
>
> http://gis.cri.fmach.it/delucchi/
> www.lucadelu.org


More information about the grass-dev mailing list