[GRASS-user] get modified date for raster layer

Jamie Adams jaadfoo at gmail.com
Tue Sep 2 22:13:35 EDT 2008


On Tue, Sep 2, 2008 at 6:42 PM, Hamish <hamish_b at yahoo.com> wrote:

> Jamie Adams <jaadfoo at gmail.com>
> > I've got over 14k rasters in several mapsets that I need to store
> > modified date in a db for tracking purposes.  I've got the
> > storage and retrieval worked out, but I don't see an clean (easy)
> > way to get the modified date via a python script.
> ....
> > Is there a more efficient way of getting the modified date
> > of a raster layer?  If not, getting the full path instead?
>
>
> MAP=roads
> eval `g.findfile element=hist file="$MAP"`
> head -n 1 "$file"
>
> It's stored as a text string; what you see is what you get.
>
> see also r.timestamp, but that is for map metadata not file creation
> timestamp.
>
>
> > os.stat (python) - has a nice date integer format, but it
> > requires that I have the full path to the cellhd folder.
>
> use g.findfile for that.


Ah okay, I never really understood that command.  "g.findfile element=cell
file=<filename> | grep ^file" returns what I need.


>
>
> > Database and location are easy via g.gisenv, but getting the mapset
> > on an individual layer basis isn't completely straightforward.
>
> > I can use use "g.mlist -m rast pattern=<filename>", but that
> > essentially greps it out of a full list.
>
> I don't fully understand what you mean by those two.


Yeah, it's a bit tough to explain with my processing setup.  It's a
non-issue now, g.findfile solved it.  Thanks!


>
>
> Hamish
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20080902/5920e786/attachment.html


More information about the grass-user mailing list