Re: [GRASS-user] New Google Scholar profile: "GRASS Development Team"

2019-01-09 Thread Laurent C.
Hi Markus,

Great, thanks!
Feel free to add those outputs for which I used GRASS:
https://doi.org/10.31223/osf.io/vqgx4
https://doi.org/10.17605/OSF.IO/38W4T
https://dx.doi.org/10.3390/w10020207

Laurent

Le dim. 9 déc. 2018 à 10:24, Markus Neteler  a écrit :

> Hi,
>
> for  fun, to easily track GRASS GIS related publications I have
> created a new Google Scholar profile:
>
> GRASS Development Team (a virtual team!)
> https://scholar.google.com/citations?user=gJ0ZB0cJ
>
> I have manually scanned some 3k article entires to catch many GRASS
> GIS related papers.
> The profile requires some more maintenance (help welcome!) and for
> sure misses artices (pls tell me).
>
> The "co-authors" on the right side are those who came to mind _and_
> have a Google Scholar profile. If you have one and would like to show
> up, please let me know.
>
> Enjoy,
> Markus
>
> PS: Yes, I got inspired by the virtual "R Development Team" :-)
>
> --
> Markus Neteler, PhD
> http://www.mundialis.de - free data with free software
> http://grass.osgeo.org
> http://courses.neteler.org/blog
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Drawing a vector line with bearing/distance

2018-10-30 Thread Laurent C.
Thank you Helmut.
As I understand, m.cogo works only for geographical coordinates.
Since I am using a projected location, I just calculated the new
coordinates using basic trigonometry. It short distances, so I guess that
is alright.

Laurent

Le mer. 17 oct. 2018 à 13:40, Helmut Kudrnovsky  a écrit :

> Laurent C. wrote
> > Hello,
> >
> > I am extracting cross-sections from raster maps using r.transect (E,N,
> > azimuth, distance).
> > I would like to create maps where I can show where those xsections are
> > taken using a vector line.
> > It seems that v.edit only works with absolute coordinates, not bearing
> and
> > distance.
> > Is there a way to draw vector lines using starting coordinates, azimuth
> > and
> > distance?
>
> maybe
>
> m.cogo - A simple utility for converting bearing and distance measurements
> to coordinates and vice versa.
> It assumes a cartesian coordinate system
>
> https://grass.osgeo.org/grass74/manuals/m.cogo.html
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] d.rast in python script

2018-10-20 Thread Laurent C.
Hello Frank,

It is not very straightforward, but it is possible.
Here is an example on how I do it:

import os
import grass.script as gscript
from grass.pygrass.gis.region import Region

# Set general env
os.environ['GRASS_RENDER_IMMEDIATE'] = "cairo"
os.environ['GRASS_RENDER_FILE_COMPRESSION'] = "9"
os.environ['GRASS_RENDER_FILE_READ'] = "TRUE"

# Set image size using the region
region = Region()
xr = region.cols
yr = region.rows
ratio = xr/yr
height = int(WIDTH / ratio)  # Choose the width you like
os.environ['GRASS_RENDER_WIDTH'] = str(WIDTH)
os.environ['GRASS_RENDER_HEIGHT'] = str(height)

# Then you can draw
os.environ['GRASS_RENDER_FILE'] = img_file_name
gscript.run_command('d.rast', map=my_map, quiet=True)


Be aware that every time you run your script, it will add layer on the file.
So you might want to delete the png file between the runs.

Cheers,
Laurent

Le ven. 19 oct. 2018 à 13:00, Frank David  a écrit :
>
> Hello,
>
> I wrote some python script and I do not find how to display created
> rasters.
>
> I tried to use d.rast but I believe this command is not designed to be
> used in python script (no monitor available with d.mon -l). Am I wright
> ? so how to do ?...
>
> Thank you for your help.
>
> Frank
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Drawing a vector line with bearing/distance

2018-10-17 Thread Laurent C.
Hello,

I am extracting cross-sections from raster maps using r.transect (E,N,
azimuth, distance).
I would like to create maps where I can show where those xsections are
taken using a vector line.
It seems that v.edit only works with absolute coordinates, not bearing and
distance.
Is there a way to draw vector lines using starting coordinates, azimuth and
distance?

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpolating rainfall data across area from points

2018-10-15 Thread Laurent C.
Hi Rich,

In the debate kriging vs deterministic rainfall interpolation, the
following article may be of interest:
https://doi.org/10.1016/j.proeng.2016.07.595

Laurent

Le lun. 24 sept. 2018 à 16:32, Rich Shepard  a
écrit :

>I want to determine whether GRASS or R is best suited to
> interpolating/extrapolating annual mean precipitation data from 58
> reporting
> stations (unevenly distributed within the county) across the county. Some
> flavor of kriging would be applied to these data to illustrate a general
> long-term pattern of rainfall.
>
>Some years ago there was both a static display of a chemical constituent
> in a river reach, a "heat map", (and an automation of temporal changes, if
> I
> correctly recall) and I'm not finding this in the web site galleries.
>
>While elevation could be included as an explanatory variable using
> regression kriging my purpose is to illustrate county-wide mean annual
> rainfall
> distribution over a 13 year period, not to interpolate values for specific,
> unsampled locations.
>
>Please provide some thoughts on the work flow to do this within GRASS.
> I'm
> digging into the gstat docs to get a sense of how to do this within R (and
> I
> have the rgrass7 package working well; it imported the GRASS county
> boundary
> map which I converted to a SpatialPolygonDataFrame.)
>
> Rich
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.overlay with points

2018-07-28 Thread Laurent C.
v.what.vect is doing exactly what I was searching for.
The last module on the list ;)

Laurent

Le sam. 28 juil. 2018 à 18:04, Laurent C.  a écrit :

> Hello all,
>
> I have two vectors maps:
> - Map A with only points
> - Map B with polygons representing continents (with a name column)
>
> I want to add a column in map A that contains the continent name on which
> the point is located.
> I thought of using v.overlay, but it doesn't work with points.
>
> Which tool should I use for that?
>
> Regards,
> Laurent
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] v.overlay with points

2018-07-28 Thread Laurent C.
Hello all,

I have two vectors maps:
- Map A with only points
- Map B with polygons representing continents (with a name column)

I want to add a column in map A that contains the continent name on which
the point is located.
I thought of using v.overlay, but it doesn't work with points.

Which tool should I use for that?

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] ST{R,V}DS in different mapsets

2017-12-05 Thread Laurent C.
Ken,

You need to allow the access of those mapsets with g.mapsets (plural).

Best regards,
Laurent

2017-12-05 6:56 GMT-06:00 Ken Mankoff :

> Dear GRASS List,
>
> I'm working with some STRDS and STVDS and having trouble accessing an
> STRDS located in a different mapset.
>
> I can provide a full MWE, but briefly:
>
> t.sample inputs=bar sample=foo@foo intype=strds samtype=strds
> method=contain
>
> Reports:
>
> ERROR: Unable to execute sql statement. You have no permission to access
> mapset , or mapset  has no temporal database. Accessible mapsets
> are: 
>
> Is this the expected behavior? I use different mapsets a lot to organize
> the many rasters and vectors from different parts of the project, and I'd
> hate to have to work all in one place just to use the time series features.
>
> Thanks,
>
>   -k.
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Unable to install add-ons on fedora23

2017-11-29 Thread Laurent C.
Hello all,

I have a similar problem with Fedora 27:

$ grass72 --config path
ERROR: Please install the GRASS GIS development package
Exiting...
$ dnf list installed *grass-devel*
Installed Packages
grass-devel.x86_64 7.2.1-2.fc27  @fedora

I believe it is a packaging error, but I don't know what is missing.

Any thought?

Regards,
Laurent

2016-04-29 5:39 GMT-05:00 Markus Neteler :
> On Fri, Apr 29, 2016 at 11:50 AM, Salim Razzaz  wrote:
> ...
>> So yeah. Make went missing like Markus said. It exists in the __src.rpm 
>> though. and
>> it shows in BUILD after packaging. So I guess it's the spec file. I'm a 
>> newbie, but a
>> curious one.
>
> Great :-)
> Here is the officia Fedora SPEC file:
>
> GRASS SPEC file spec: http://pkgs.fedoraproject.org/cgit/rpms/grass.git/
>   --> http://pkgs.fedoraproject.org/cgit/rpms/grass.git/tree/grass.spec
>
>> So I'll try to find the culprit piece and report back if anything shows up
>> (doubt it though, considering my skills).
>
> ... I will be happy to generate a RPM from your updated SPEC file then.
>
> Markus
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Evaluation of AW3D30 open access global DEM for flood modelling

2017-11-24 Thread Laurent C.
2017-09-21 14:22 GMT-05:00 Markus Metz :
>
> The JPL/NASA website also links to
> http://dds.cr.usgs.gov/srtm/
> where you get the JPL/NASA SRTM products version 1 and 2.1
>
> JPL/NASA SRTM version 3 (completely void-filled version 2.1) is available at
> https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table
> JPL/NASA version 3 with 1 arc second resolution is described at
> https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl1_v003
> JPL/NASA version 3 with 3 arc seconds resolution is described at
> https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl3_v003
>
> Personally, I would prefer SRTM JPL/NASA version 3 over any other SRTM
> version, mainly because according to the documentation it supersedes the NGA
> version 2 available through the USGS EartExplorer.
>
> Markus M

Interesting, thanks. I did not know that there was various versions of
the 1arcsec. I might have a look.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Evaluation of AW3D30 open access global DEM for flood modelling

2017-09-21 Thread Laurent C.
2017-09-20 4:07 GMT-05:00 Markus Metz <markus.metz.gisw...@gmail.com>:
>
>
> On Tue, Sep 19, 2017 at 9:10 PM, Markus Metz <markus.metz.gisw...@gmail.com>
> wrote:
>>
>>
>>
>> On Tue, Sep 19, 2017 at 5:53 PM, Laurent C. <lrn...@gmail.com> wrote:
>> >
>> > Hello Markus,
>> >
>> > Thanks for your interest.
>> > By SRTM1 we mean the 1 arcsecond version of SRTM. As far as we know, it
>> > comes in only one version.
>>
>> About USGS SRTM versions, see
>> http://dx.doi.org/10.5067/MEaSUREs/SRTM/SRTMGL1.003
>> https://dds.cr.usgs.gov/srtm/What_are_these.pdf
>> https://dds.cr.usgs.gov/srtm/version2_1/Documentation/SRTM_Topo.pdf
>>
>> the latter one states that "there is a difference between the data
>> distributed via ftp from the Land Processes
>> Distributed Active Archive Center [now https://dds.cr.usgs.gov/srtm/], and
>> those available from the EROS Data Center"
>>
>> I am not sure if this still holds true. Following the EarthExplorer links
>> https://lta.cr.usgs.gov/SRTMVF
>> https://lta.cr.usgs.gov/SRTM1Arc
>>
>> it is not clear which versions these are. I guess the non-void filled
>> version of the EarthExplorer is the subsampled version 2.1, the void filled
>> version and the global 1 arc sec version are SRTM version 3. Just a guess,
>> if in doubt, ask USGS.
>
> According to
> https://lpdaac.usgs.gov/sites/default/files/public/measures/docs/NASA_SRTM_V3.pdf
> and
> https://lta.cr.usgs.gov/SRTM1Arc
>
> the USGS EarthExplorer most probably provides NGA version 2, not JPL/NASA
> versions 2.1 or 3.

Markus,

The JPL webpage about SRTM links to the USGS EROS website for
download, which itself links to Earthexplorer:
https://www2.jpl.nasa.gov/srtm/cbanddataproducts.html
https://eros.usgs.gov/elevation-products

Do you know if there is a more recent version of the 1 arcsec product,
and where to find it?

Best,
Laurent

>
> Markus M
>>
>> > We could make it more clear during the revision.
>>
>> That would avoid confusion. For example, there is a 1 arc second version
>> of version 2.1 ;-)
>>
>> Markus M
>>
>> >
>> > Best,
>> > Laurent
>> >
>> > On 19 Sep 2017 01:49, "Markus Metz" <markus.metz.gisw...@gmail.com>
>> > wrote:
>> >
>> >
>> >
>> > On Tue, Sep 19, 2017 at 1:41 AM, Laurent C. <lrn...@gmail.com> wrote:
>> > >
>> > > Hello all,
>> > >
>> > > Open-access global DEMs like SRTM are a staple in our GIS community.
>> > > Last year the JAXA released a new product, the ALOS World 3d 30m
>> > > (AW3D30).
>> > > Using GRASS and itzï we've carried out an assessment of AW3D30 from
>> > > the point of view of flood modelling, and compared it to lidar, SRTM
>> > > and ASTER.
>> >
>> > Very interesting study! I have a question about SRTM: in the paper you
>> > write that you used SRTM version 1, but SRTM version 1 is practically not
>> > used since version 2.1 has been made available. Since 2013, SRTM version 3
>> > has been available:
>> >
>> > http://dx.doi.org/10.5067/MEaSUREs/SRTM/SRTMGL1.003
>> >
>> > SRTM version 3 is also the default for r.in.srtm.region.
>> >
>> > Best,
>> >
>> > Markus M
>> >
>> > >
>> > > AW3D30 is indeed a very interesting product, and I thought that GRASS
>> > > users could be interested in our results:
>> > > https://doi.org/10.5281/zenodo.885571
>> > >
>> > > Best regards,
>> > > Laurent
>> > > ___
>> > > grass-user mailing list
>> > > grass-user@lists.osgeo.org
>> > > https://lists.osgeo.org/mailman/listinfo/grass-user
>> >
>> >
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Evaluation of AW3D30 open access global DEM for flood modelling

2017-09-19 Thread Laurent C.
Hello Markus,

Thanks for your interest.
By SRTM1 we mean the 1 arcsecond version of SRTM. As far as we know, it
comes in only one version.
We could make it more clear during the revision.

Best,
Laurent

On 19 Sep 2017 01:49, "Markus Metz" <markus.metz.gisw...@gmail.com> wrote:



On Tue, Sep 19, 2017 at 1:41 AM, Laurent C. <lrn...@gmail.com> wrote:
>
> Hello all,
>
> Open-access global DEMs like SRTM are a staple in our GIS community.
> Last year the JAXA released a new product, the ALOS World 3d 30m
> (AW3D30).
> Using GRASS and itzï we've carried out an assessment of AW3D30 from
> the point of view of flood modelling, and compared it to lidar, SRTM
> and ASTER.

Very interesting study! I have a question about SRTM: in the paper you
write that you used SRTM version 1, but SRTM version 1 is practically not
used since version 2.1 has been made available. Since 2013, SRTM version 3
has been available:

http://dx.doi.org/10.5067/MEaSUREs/SRTM/SRTMGL1.003

SRTM version 3 is also the default for r.in.srtm.region.

Best,

Markus M

>
> AW3D30 is indeed a very interesting product, and I thought that GRASS
> users could be interested in our results:
> https://doi.org/10.5281/zenodo.885571
>
> Best regards,
> Laurent
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Evaluation of AW3D30 open access global DEM for flood modelling

2017-09-18 Thread Laurent C.
Hello all,

Open-access global DEMs like SRTM are a staple in our GIS community.
Last year the JAXA released a new product, the ALOS World 3d 30m
(AW3D30).
Using GRASS and itzï we've carried out an assessment of AW3D30 from
the point of view of flood modelling, and compared it to lidar, SRTM
and ASTER.

AW3D30 is indeed a very interesting product, and I thought that GRASS
users could be interested in our results:
https://doi.org/10.5281/zenodo.885571

Best regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Repeated r.watershed runs

2017-09-18 Thread Laurent C.
Hello Marco,

Itzï (www.itzi.org) is built upon GRASS and employs a partial inertia
simplification of the Saint-Venant equations.
It is certainly not as hydraulically accurate as the finite-volume
approach of ANUGA, but it gives quite good results as a flood model,
and is likely to be much faster.

Regards,
Laurent


2017-09-04 2:41 GMT-05:00 Marco Alicera :
> Reading the subject and agreeing with Thomas about the limitations of
> r.watershed, I wonder if there is any effort to port any of the models based
> on the shallow water wave equations to grass. I recently read about the
> anuga project https://anuga.anu.edu.au/wiki and it would be nice to use it
> with a more friendly GIS environment.
> Regards
> --
> Marco
>
> 2017-09-01 11:04 GMT+02:00 Moritz Lennert :
>>
>> On 01/09/17 09:50, Ken Mankoff wrote:
>>>
>>> Dear Moritz,
>>>
>>> Yes, the three day estimate is from the first hour of this command:
>>>
>>> seq 14000 | parallel --bar r.watershed elevation=DEM.fixed
>>> flow=runoff.{#} accumulation=acc.{#}
>>
>>
>> Have you checked memory usage. Setting memory= to something higher than
>> the default value of 300MB could possibly speed things up a bit.
>>
>>>
>>> I have a 4-core laptop.
>>
>>
>> Time to find more cores... ;-)
>>
>>
>> Moritz
>>
>>
>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzï 17.7 is released

2017-08-09 Thread Laurent C.
Hello,

The version 17.7 suffered from a packaging error that prevented the
installation.
The new version 17.8 fixes this bug.
Please give it a try!

https://www.itzi.org/blog/178/

Please note as well that a Docker image is available:
https://hub.docker.com/r/lrntct/itzi/

Regards,
Laurent

2017-08-01 10:44 GMT-05:00 Laurent C. <lrn...@gmail.com>:
> Hello all,
>
> The version 17.7 of the Itzï flood model is out. It fixes some bugs
> and add new features.
> The most important news is that now it includes the SWMM drainage
> model, allowing coupled surface-drainage simulations. The results of
> the drainage model are exported as GRASS STVDS.
>
> The full release announcement is there:
> https://www.itzi.org/blog/177released/
>
> I hope you'll like it.
>
> Best regards,
> Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Itzï 17.7 is released

2017-08-01 Thread Laurent C.
Hello all,

The version 17.7 of the Itzï flood model is out. It fixes some bugs
and add new features.
The most important news is that now it includes the SWMM drainage
model, allowing coupled surface-drainage simulations. The results of
the drainage model are exported as GRASS STVDS.

The full release announcement is there:
https://www.itzi.org/blog/177released/

I hope you'll like it.

Best regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] t.rast.what does not accept utf8 in "where" field

2017-06-15 Thread Laurent C.
Hi Veronica,



2017-06-14 15:32 GMT-05:00 Veronica Andreo <veroand...@gmail.com>:
> Hi Laurent,
>
> I might be mistaken, but I think the where is for the strds, so you should
> use one of the variables allowed/available in the twmporal framework...

You're right, It seems tobe related to the temporal DB. I thought it
was the spatial DB.
It could be an interesting addition, though.
However, it still have a problem with UTF8.

> and one more thing,  I would use double quotes after the where
> (where="name=='something'" or, if temporal, where="start_time
> =='2001-01-01'")? Have you tried that?
I did, without success. Actually, I wrote it the exact same way as in
v.db.select, and it worked.


Regards,
Laurent

>
> Best,
> Vero
>
>
> El 14 jun. 2017 5:03 p.m., "Laurent C." <lrn...@gmail.com> escribió:
>
> Hello,
>
> I'm running into a problem with t.rast.what when trying to select a
> specific point with the "where" option:
>
> /usr/lib/grass72/scripts/t.rast.what points=stations@chiapas
> strds=boqueron_60m_qy@chiapas_results where=name=='Boquerón'
> Traceback (most recent call last):
>   File "/usr/lib/grass72/scripts/t.rast.what", line 531, in
> 
> main(options, flags)
>   File "/usr/lib/grass72/scripts/t.rast.what", line 169, in
> main
> dbif=dbif)
>   File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
> space_time_dataset.py", line 1411, in
> get_registered_maps_as_objects
> rows = self.get_registered_maps(columns, where, order,
> dbif)
>   File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
> space_time_dataset.py", line 1479, in get_registered_maps
> sql += " AND (%s)" % (where.split(";")[0])
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> position 20: ordinal not in range(128)
>
> If I'm not setting "where", it works fine.
> When using the "where" option with v.db.select, I do not have this
> problem neither:
> v.db.select map=stations@chiapas where=name=='Boquerón'
> cat|name|rain_rate
> 9|Boquerón|0
>
> Should I open an issue?
>
> Best regards,
> Laurent
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] t.rast.what does not accept utf8 in "where" field

2017-06-14 Thread Laurent C.
Hello,

I'm running into a problem with t.rast.what when trying to select a
specific point with the "where" option:

/usr/lib/grass72/scripts/t.rast.what points=stations@chiapas
strds=boqueron_60m_qy@chiapas_results where=name=='Boquerón'
Traceback (most recent call last):
  File "/usr/lib/grass72/scripts/t.rast.what", line 531, in

main(options, flags)
  File "/usr/lib/grass72/scripts/t.rast.what", line 169, in
main
dbif=dbif)
  File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py", line 1411, in
get_registered_maps_as_objects
rows = self.get_registered_maps(columns, where, order,
dbif)
  File "/usr/lib/grass72/etc/python/grass/temporal/abstract_
space_time_dataset.py", line 1479, in get_registered_maps
sql += " AND (%s)" % (where.split(";")[0])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 20: ordinal not in range(128)

If I'm not setting "where", it works fine.
When using the "where" option with v.db.select, I do not have this
problem neither:
v.db.select map=stations@chiapas where=name=='Boquerón'
cat|name|rain_rate
9|Boquerón|0

Should I open an issue?

Best regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS, ordinal not in range(128)

2017-06-14 Thread Laurent C.
Hello,

I just discover this thread. It seems to be the same issue I've
reported two months ago:

https://trac.osgeo.org/grass/ticket/3338

Best regards,
Laurent

2017-03-22 16:44 GMT-06:00 Markus Neteler :
> On Wed, Mar 22, 2017 at 8:21 PM, Andres Solarte
>  wrote:
>> Hello,
>>
>> I made two changes for this issue.
>>
>> 1. In the file ...etc/python/grass/temporal/register.py (line 422 for me), I
>> added the marked in red
>>
>> else:
>>msgr.debug(1, _(("Set absolute valid time for map <%s> to %s - %s")
>>% (map.get_map_id(), str(start_time),
>> str(end_time))).encode('utf8'))
>
> well, msgr.debug() should not have the _() macro at all.
> Debug should not go into translations.
>
>
>> There is a similar issue after that, so I added the marked in red in the
>> file
>> ...etc/python/grass/temporal/abstract_space_time_dataset.py (line 2282)
>>
>> self.msgr.verbose(_(("Update metadata, spatial and temporal extent from"
>> " all registered maps of <%s>") %
>> (self.get_id())).encode('utf8'))
>
> .. this one is of course eligible.
>
>> Now, I don't have problems with accents
>
> Thanks for checking!
> To be fixed by our Python gurus in SVN :)
>
> Markus
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Change value of cells in raster map

2017-06-08 Thread Laurent C.
Hi Rich,

When I want to modify a raster, I usually draw a vector and use
v.to.rast, then r.mapcalc if necessary.

Regards,
Laurent

2017-06-08 18:57 GMT-05:00 Rich Shepard :
> On Thu, 8 Jun 2017, Mark Seibel wrote:
>
>> Maybe if-then statements with mapcalc are applicable to the situation.
>> outputRaster=if(EXPRESSION,true,false)
>
>
> Mark,
>
>   I'll try writing an expression that tests for a map name. I can use any
> output map name because if it contains the appropriate cell values a simple
> g.rename will work.
>
>   Perhaps this will work:
>
>   r.mapcalc 'output1 = if (mapname@mapset,value=0.0)'
>
> I'll try it tomorrow morning and post the results.
>
> Thanks,
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Re-project a spacio-temporal dataset

2017-05-02 Thread Laurent C.
Hello,

Is there a module that simplifies the reprojection of a complete STDS
from a location to another?

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] New peer-review article about dynamic flood simulation with GRASS and Itzï

2017-05-02 Thread Laurent C.
Hello all,

A new open-access, peer-reviewed journal article has been published
about the use of GRASS and Itzï for the dynamic simulation of floods:

Courty, L. G., Pedrozo-Acuña, A., and Bates, P. D.: Itzï (version
17.1): an open-source, distributed GIS model for dynamic flood
simulation, Geosci. Model Dev., 10, 1835-1847,
doi:10.5194/gmd-10-1835-2017, 2017.

URL: http://www.geosci-model-dev.net/10/1835/2017/

I hope you find it interesting.

Best regards,
Laurent Courty
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS Environment Variables

2017-04-04 Thread Laurent C.
Hello Joseph,

There is a solution, but it is not straight forward:
https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly

Another option is to start your editor from the GRASS command line.

Regards,
Laurent


2017-04-04 9:12 GMT-05:00 Joseph Kariuki :
> Hi?
>
> I have been trying to call GRASS modules using python outside GRASS session,
> I am coding in PyCharm however, I am having a problem importing grass
> scripts and the solution being provided is setting GRASS environment
> variables. How do I go about that so to import GRASS modules in Pycharm?
>
>
> Kind Regards,
> Joseph Kariuki
>
> Geospatial Engineer | GIS / Web Developer
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.mapcalc: compare two maps [RESOLVED]

2017-03-30 Thread Laurent C.
2017-03-30 16:02 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Thu, 30 Mar 2017, Laurent C. wrote:
>
>> In that case, you will not see the accumulation upstream the culvert that
>> should normally occur if the pipe is actually higher than the ground.
>
>
> Laurent,
>
>   Both invert and outfall are above ground level and below the road. If
> r.carve used the mean elevation between the two then the 'stream' is higher
> than the bottom of the roadside swale. This should accumulate water until
> the elevation matches the invert, correct?

Rich,

As far as I understand, r.carve interpolate the elevation using as
starting points the DEM bellow the extremities of the vector lines.
So if the DEM at these points is equal to the invert elevation of your
culvert, you're good.

Laurent

>> Please note that in a future version, Itzï will be able to model culverts
>> more accurately thanks to a coupled drainage model. But this might be in a
>> few months.
>
>
>   I'd like to do the best that Itzi can with the current version. I may have
> opportunities to do more flat land hydrologic models so the more fluent in
> Itzi I am the easier it will be and the less I'll be asking for help. :-)
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.mapcalc: compare two maps [RESOLVED]

2017-03-30 Thread Laurent C.
2017-03-30 12:38 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Thu, 30 Mar 2017, Laurent C. wrote:
>
>> You can create a new vector map and create a line that link the two
>> points. However, r.carve will interpolate the elevation between the start
>> point and the end point.
>
>
> Laurent,
>
>   Have this line in a vector map called 'stream.'
>
>> If you culvert invert have a lower elevation, this will not show up. But
>> considering the amount of simplification you're already applying, it could
>> be acceptable.
>
>
>   The invert has a slightly higher elevation than the outfall. Both are
> lower than the elevation of the road over the culvert.

Rich,

In that case, you will not see the accumulation upstream the culvert
that should normally occur if the pipe is actually higher than the
ground.
Please note that in a future version, Itzï will be able to model
culverts more accurately thanks to a coupled drainage model.
But this might be in a few months.

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.mapcalc: compare two maps [RESOLVED]

2017-03-30 Thread Laurent C.
2017-03-30 12:09 GMT-06:00 Rich Shepard :
> On Thu, 30 Mar 2017, Rich Shepard wrote:
>
>> Would the process be to use v.edit on a copy (called 'stream') of the
>> culvert point map to generate a straight line between the two points? That
>> would provide the vector input r.carve wants.
>
>
>   How do I add a line between two specific points using the vector digitizer
> in the GUI map display window?
>
>   Clicking on one point, then on the other point does not show a line
> between the two points.
>
>   Clicking on one point and dragging the cursor to the other point before
> releasing the button also does not display a line between the two points.
>
>   Clue stick needed.

You need first to create a new vector map (or edit an existing one)
and select "digitize new line".

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.mapcalc: compare two maps [RESOLVED]

2017-03-30 Thread Laurent C.
2017-03-30 12:00 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Thu, 30 Mar 2017, Laurent C. wrote:
>
>> If you want to 'open' the culvert, you'll have to cut through the road.
>> You can do this with r.carve, for example.
>
>
>   Certainly worth doing. The r.carve manual page requires as input a vector
> map containing streams. Having only two points (culvert inlet and outlet), I
> suppose the idea is to create a stream between those two points.
>
>   Would the process be to use v.edit on a copy (called 'stream') of the
> culvert point map to generate a straight line between the two points? That
> would provide the vector input r.carve wants.

Rich,

You can create a new vector map and create a line that link the two points.
However, r.carve will interpolate the elevation between the start
point and the end point.
If you culvert invert have a lower elevation, this will not show up.
But considering the amount of simplification you're already applying,
it could be acceptable.

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.mapcalc: compare two maps [RESOLVED]

2017-03-30 Thread Laurent C.
Rich,

If I understand well, you have a 'raw' DEM and you want to open the
culvert in that DEM.
If it is an under-road culvert, your 'raw' DEM will show the road
elevation, and the culvert will not be shown. i.e the culvert is
blocked.
If you want to 'open' the culvert, you'll have to cut through the
road. You can do this with r.carve, for example.

Regards,
Laurent

2017-03-30 10:04 GMT-06:00 Rich Shepard :
> On Thu, 30 Mar 2017, Nikos Alexandris wrote:
>
>>> For the record: there is a "differences" color table which is useful for
>>> this.
>
>
>> Don't forget to try r.colors with -e or -a -g if the first attempt does
>> not
>> show much differences.
>
>
>   I _had_ not noticed the 'differences' color table. Applying that produces
> interesting results (see attached .png).
>
>   The four blue cells are ~0.6m higher in the blocked map than in the open
> culvert map. I don't know the reason for the lighter blue cell to the
> southwest of the group of four. I suspect, but don't know, that the pinkish
> cells represent slightly higher water accumulation in the blocked map than
> in the open map.
>
>  Germane to what Markus M. wrote, "The point locations used to edit the
> original DEM are probably wrong (not close to the center), ..." I now think
> that's where I made one mistake. When I isolated those four cells and
> queried them I truncated the easting and northing coordinates to the integer
> value assuming that all elevations in a 1m x 1m cell were the same. If this
> assumption is incorrect then I'll re-create the change and start the model
> running again with a slightly different set of elevations for those cells.
>
>   If anyone can suggest other changes to the model input to better show
> where water accummulates behind a blockage please let me know.
>
> Rich
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi results have one day lead from input data

2017-03-23 Thread Laurent C.
2017-03-23 12:49 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Thu, 23 Mar 2017, Laurent C. wrote:
>
>> Is this t.info output taken from the STRDS created by Itzï?
>
>
> Laurent,
>
>   I assume so since the registered maps are Itzi output.

Itzï is creating the maps and a STRDS where maps are registered.
But the maps could be registered in various STRDS.

>
>> The current version of Itzï does not record the initial state. So if you
>> tell Itzï that the simulation starts at 2013-11-15 00:00:00 and the
>> record_step is 24:00:00, then the first registered map will be at
>> 2013-11-16 00:00:00.
>
>
>   This is what Soeren wrote, too.
>
>> However, the last record should be equal to the end_time given in the Itzï
>> configuration file. If not, please fill-up an issue
>> (https://bitbucket.org/itzi-model/itzi/issues)
>
>
>   Here is the time portion of the parameter file:
>
> [time]
> start_time = 2013-11-15 00:00
> duration = 600:00:00
> record_step = 24:00:00
>
> and the end turns out to be 2013-12-09 00:00.

If I do the calculation, the simulation will actually ends on
2013-12-10 00:00:00 :

from datetime import datetime, timedelta
start_time=datetime(year=2013, month=11, day=15)
duration=timedelta(hours=600)
end_time = start_time + duration
print(end_time)
2013-12-10 00:00:00

So the last record is missing.
I just checked the source code and there is actually a bug that
prevents the record of the very last maps.
It should be fixed for the next release of Itzï.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi results have one day lead from input data

2017-03-23 Thread Laurent C.
Rich,

Is this t.info output taken from the STRDS created by Itzï?
The current version of Itzï does not record the initial state.
So if you tell Itzï that the simulation starts at 2013-11-15 00:00:00
and the record_step is 24:00:00, then the first registered map will be
at 2013-11-16 00:00:00.
However, the last record should be equal to the end_time given in the
Itzï configuration file. If not, please fill-up an issue
(https://bitbucket.org/itzi-model/itzi/issues)

Regards,
Laurent


2017-03-23 12:09 GMT-06:00 Rich Shepard :
>   I created a rainfall STRDS (in mm/hr) from 2013-11-15 through 2013-12-08.
> The Itzi model parameter file's start_time is 2013-11-15. t.register
> specifies the start date as 2013-11-15 and an increment of 1 day.
>
>   When the model was started the first day processed was 2013-11-15, and the
> last day was 2013-12-08.
>
>   When I look at the t.info output I see
> Start time:. 2013-11-16 00:00:00
> End time:... 2013-12-09 00:00:00
> Granularity: 1 day
>
>   Why does the STRDS move the dates ahead by one day?
>
> Rich
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi output: several questions

2017-03-14 Thread Laurent C.
2017-03-14 16:01 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Mon, 13 Mar 2017, Laurent C. wrote:
>
>> The water level of 3m seems to be due to accumulation on the edge of the
>> domain. The water flows according to topography. If there is a lower point
>> without an exit, there will be an accumulation of water. If you want a map
>> in cm or mm, you can convert it using r.mapcalc.
>
>
> Laurent,
>
>   If I copy the strds can I run r.mapcalc on all the maps in it to convert
> from meters to centimeters? Have not before worked with s-t data sets so I'm
> unfamiliar with applying r.mapcalc collectively to a set of raster maps.

You might try t.rast.mapcalc.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi output: several questions

2017-03-13 Thread Laurent C.
2017-03-13 15:06 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Mon, 13 Mar 2017, Laurent C. wrote:
>
>> Additionally, you can check the statistics CSV file to see if there is
>> any numerical instability that could artificially create volume.
>
>
> Laurent,
>
>   I don't find a .csv file in any project subdirectory.

Rich,

It's you who decide how to name the file and where to put it by
setting the "stats_file" option.
If only the name is given, it will be created in the directory from
where you ran Itzï.
If no name is given, no file is created.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi output: several questions

2017-03-13 Thread Laurent C.
2017-03-13 10:31 GMT-06:00 Laurent C. <lrn...@gmail.com>:
> Copy of my off-list answer.
>
> 2017-03-13 10:30 GMT-06:00 Laurent C. <lrn...@gmail.com>:
>> Rich,
>>
>> Answers below.
>>
>> 2017-03-13 10:16 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
>>>   One model run has completed and I have several questions for which I do
>>> not find answers in either the grass or itzi docs.
>>>
>>>   1.) g.gis.animation input can be raster, vector, or st?ds files. The
>>> output of the model is a set of 25 raster maps. Is there a strds for this
>>> output or do I list all 25 maps on the command line?
>>
>> At the end of the simulation, Itzï registers the created maps into strds.
>> So yes, you should have a strds created.
>>
>>>   And, can I overlay this animation on vector maps that provide context? If
>>> so, where do I read how to do this?
>>
>> You can add several layers to g.gui.animation, including vector maps.
>>
>>>
>>>   2.) The individual water depth output maps are transparent; that is, I can
>>> overlay them on a vector DEM contour map and see the contours underneath the
>>> raster file. The maximum water output file (open_h_max) is opaque; it covers
>>> the underlying vector contour map. Can it be made transparent?
>>
>> In the individual water depth maps, only water levels above hmin are 
>> reported.
>> If you want the same effect for the maximum level map, you can use the
>> if() of r.mapcalc to set a threshold.
>>
>>>   3.) Precipitation input is in mm/hr but the output water depth map is in
>>> meters (see water_h_max.png attached). However, it is not possible for there
>>> to be cells with 3m of water based on the input data. How can I obtain
>>> output surface water depths in mm or cm?
>>
>> The water level of 3m seems to be due to accumulation on the edge of the 
>> domain.
>> The water flows according to topography. If there is a lower point
>> without an exit, there will be an accumulation of water.
>> If you want a map in cm or mm, you can convert it using r.mapcalc.

Additionally, you can check the statistics CSV file to see if there is
any numerical instability that could artificially create volume.

Laurent

>>
>> Regards,
>> Laurent
>>
>>>
>>> TIA,
>>>
>>> Rich
>>> ___
>>> grass-user mailing list
>>> grass-user@lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi output: several questions

2017-03-13 Thread Laurent C.
2017-03-13 10:26 GMT-06:00 Rich Shepard :
> On Mon, 13 Mar 2017, Rich Shepard wrote:
>
>>  One model run has completed and I have several questions for which I do
>> not find answers in either the grass or itzi docs.
>
>
>   4.) The water surface elevation (wse) output maps are also in meters, yet
> the wse_max map is a solid color block (yellow or magenta so far). What
> might be the explanation of this since the bare earth DEM was included in
> the input parameters?

Rich,

This seems to be a color table problem. You can change it with
r.colors or t.rast.colors.

Laurent

>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi output: several questions

2017-03-13 Thread Laurent C.
Copy of my off-list answer.

2017-03-13 10:30 GMT-06:00 Laurent C. <lrn...@gmail.com>:
> Rich,
>
> Answers below.
>
> 2017-03-13 10:16 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
>>   One model run has completed and I have several questions for which I do
>> not find answers in either the grass or itzi docs.
>>
>>   1.) g.gis.animation input can be raster, vector, or st?ds files. The
>> output of the model is a set of 25 raster maps. Is there a strds for this
>> output or do I list all 25 maps on the command line?
>
> At the end of the simulation, Itzï registers the created maps into strds.
> So yes, you should have a strds created.
>
>>   And, can I overlay this animation on vector maps that provide context? If
>> so, where do I read how to do this?
>
> You can add several layers to g.gui.animation, including vector maps.
>
>>
>>   2.) The individual water depth output maps are transparent; that is, I can
>> overlay them on a vector DEM contour map and see the contours underneath the
>> raster file. The maximum water output file (open_h_max) is opaque; it covers
>> the underlying vector contour map. Can it be made transparent?
>
> In the individual water depth maps, only water levels above hmin are reported.
> If you want the same effect for the maximum level map, you can use the
> if() of r.mapcalc to set a threshold.
>
>>   3.) Precipitation input is in mm/hr but the output water depth map is in
>> meters (see water_h_max.png attached). However, it is not possible for there
>> to be cells with 3m of water based on the input data. How can I obtain
>> output surface water depths in mm or cm?
>
> The water level of 3m seems to be due to accumulation on the edge of the 
> domain.
> The water flows according to topography. If there is a lower point
> without an exit, there will be an accumulation of water.
> If you want a map in cm or mm, you can convert it using r.mapcalc.
>
> Regards,
> Laurent
>
>>
>> TIA,
>>
>> Rich
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Setting layer transparency from a script

2017-03-12 Thread Laurent C.
Hi Nikos,

What I would like is the possibility to set a percentage of opacity. But if
I understand well, it is what is doing pnmcomp.

Thanks for your appreciation.

Regards,
Laurent


On 11 Mar 2017 03:35, "Nikos Alexandris" <n...@nikosalexandris.net> wrote:

Laurent C.:


Hello,
>
> I'm using a Python script to generate maps for publication by setting
> GRASS_RENDER_FILE and running the different d.* commands. Is it
> possible to add opacity to some of the layers?
>

Dear Laurent,

not a direct answer, but you might want to read
<https://lists.osgeo.org/pipermail/grass-user/2016-March/073831.html>

Also, the r.out.png tool has a "-t   Make NULL cells transparent" flag.

Kind regards and thank you for your excellent work I've seen elsewhere.

Nikos
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Setting layer transparency from a script

2017-03-10 Thread Laurent C.
Hello,

I'm using a Python script to generate maps for publication by setting
GRASS_RENDER_FILE and running the different d.* commands. Is it
possible to add opacity to some of the layers?

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.water.outlet map does not display

2017-03-06 Thread Laurent C.
Hello,

You should make sure that the point you give to r.water.outlet is
located on a main stream. The accumulation map from r.watershed is
useful for this task.
If you're not doing so, you might end up with a tiny watershed.

Regards,
Laurent


2017-03-06 16:50 GMT-06:00 Rich Shepard :
>   Using r.watershed specifying the input DEM and a name for the drainage map
> I can view the drainage map. When I follow this command with r.water.outlet
> specifying the drainage map as input, 'watershed' as the output map name,
> and the coordinates of the designated outlet, no map is displayable.
>
>   Could this be due to the very flat nature of the terrain?
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] t.register does not register anything in a STVDS

2017-02-24 Thread Laurent C.
Sören,

I was sure I did. Anyway is it expected behaviour to be able to
register maps in the DB without registering them in a STDS?
I agree with Markus that a warning could be useful.
Thanks for the tip.

Laurent



2017-02-23 21:27 GMT-06:00 Sören Gebbert <soerengebb...@googlemail.com>:
> You need to specify the name of the stvds in t.register.
>
> Am 24.02.2017 02:48 schrieb "Laurent C." <lrn...@gmail.com>:
>>
>> Hello,
>>
>> I created an empty STVDS that looks fine:
>>
>> t.info input=water_levels_20150801@kolkata type=stvds
>>  + Space Time Vector Dataset
>> -+
>>  |
>> |
>>  + Basic information
>> -+
>>  | Id:  water_levels_20150801@kolkata
>>  | Name: .. water_levels_20150801
>>  | Mapset:  kolkata
>>  | Creator: ... laurent
>>  | Temporal type: . absolute
>>  | Creation time: . 2017-02-23 19:18:15.120512
>>  | Modification time:.. 2017-02-23 19:18:15.120516
>>  | Semantic type:.. mean
>>  + Absolute time
>> -+
>>  | Start time:. None
>>  | End time:... None
>>  | Granularity: None
>>  | Temporal type of maps:.. None
>>  + Spatial extent
>> +
>>  | North:.. None
>>  | South:.. None
>>  | East:..  None
>>  | West:... None
>>  | Top: None
>>  | Bottom:. None
>>  + Metadata information
>> --+
>>  | Vector register table:..
>> vector_map_register_c14262576ea94a78a55b48b65a72b3a6
>>  | Number of points ... None
>>  | Number of lines  None
>>  | Number of boundaries ... None
>>  | Number of centroids  None
>>  | Number of faces  None
>>  | Number of kernels .. None
>>  | Number of primitives ... None
>>  | Number of nodes  None
>>  | Number of areas  None
>>  | Number of islands .. None
>>  | Number of holes  None
>>  | Number of volumes .. None
>>  | Number of registered maps:.. None
>>  |
>>  | Title:
>>  | water_levels
>>  | Description:
>>  |
>>  | Command history:
>>  | # 2017-02-23 19:18:15
>>  | t.create --overwrite output="water_levels_20150801"
>>  | type="stvds" semantictype="mean" title="water_levels" description="
>> "
>>  |
>>
>> ++
>>
>> I have a maplist file in the form:
>> water_levels_2015073100|2015-07-31 00:00:00
>> water_levels_20150731001500|2015-07-31 00:15:00
>> [snip]
>> water_levels_20150801233000|2015-08-01 23:30:00
>> water_levels_20150801234500|2015-08-01 23:45:00
>>
>> The vector maps look sane:
>> v.info map=water_levels_20150731021500@kolkata
>>
>> ++
>>  | Name:water_levels_20150731021500
>> |
>>  | Mapset:  kolkata
>> |
>>  | Location:UTM45N
>> |
>>  | Database:/home/laurent/grassdata
>> |
>>  | Title:
>> |
>>  | Map scale:   1:1
>> |
>>  | Name of creator: laurent
>> |
>>  | Organization:
>> |
>>  | Source date: Thu Feb 23 18:50:06 2017
>> |
>>  | Timestamp (first layer): 31 Jul 2015 02:15:00
>> |
>>
>> ||
>>  | Map format:  native
>> |
>>
>> ||
>>  |   Type of map: vector (level: 2)
>> |
>>  |
>> |
>>  |   Number of points:   3   Number of centroids:  0
>> |
>>  |   Number of lines:0   Number of boundaries: 0
>> |
>>  |   Number of areas:0   Number of islands:0
>> |
>>  |
>> |
>>  |   Map is 3D:  No
>> |
>>  |   Number of dblinks:  1
>> |
>>  |
>> |
>>  |   Projection: UTM (z

[GRASS-user] t.register does not register anything in a STVDS

2017-02-23 Thread Laurent C.
Hello,

I created an empty STVDS that looks fine:

t.info input=water_levels_20150801@kolkata type=stvds
 + Space Time Vector Dataset -+
 ||
 + Basic information -+
 | Id:  water_levels_20150801@kolkata
 | Name: .. water_levels_20150801
 | Mapset:  kolkata
 | Creator: ... laurent
 | Temporal type: . absolute
 | Creation time: . 2017-02-23 19:18:15.120512
 | Modification time:.. 2017-02-23 19:18:15.120516
 | Semantic type:.. mean
 + Absolute time -+
 | Start time:. None
 | End time:... None
 | Granularity: None
 | Temporal type of maps:.. None
 + Spatial extent +
 | North:.. None
 | South:.. None
 | East:..  None
 | West:... None
 | Top: None
 | Bottom:. None
 + Metadata information --+
 | Vector register table:..
vector_map_register_c14262576ea94a78a55b48b65a72b3a6
 | Number of points ... None
 | Number of lines  None
 | Number of boundaries ... None
 | Number of centroids  None
 | Number of faces  None
 | Number of kernels .. None
 | Number of primitives ... None
 | Number of nodes  None
 | Number of areas  None
 | Number of islands .. None
 | Number of holes  None
 | Number of volumes .. None
 | Number of registered maps:.. None
 |
 | Title:
 | water_levels
 | Description:
 |
 | Command history:
 | # 2017-02-23 19:18:15
 | t.create --overwrite output="water_levels_20150801"
 | type="stvds" semantictype="mean" title="water_levels" description=" "
 |
 ++

I have a maplist file in the form:
water_levels_2015073100|2015-07-31 00:00:00
water_levels_20150731001500|2015-07-31 00:15:00
[snip]
water_levels_20150801233000|2015-08-01 23:30:00
water_levels_20150801234500|2015-08-01 23:45:00

The vector maps look sane:
v.info map=water_levels_20150731021500@kolkata
 ++
 | Name:water_levels_20150731021500   |
 | Mapset:  kolkata   |
 | Location:UTM45N|
 | Database:/home/laurent/grassdata   |
 | Title: |
 | Map scale:   1:1   |
 | Name of creator: laurent   |
 | Organization:  |
 | Source date: Thu Feb 23 18:50:06 2017  |
 | Timestamp (first layer): 31 Jul 2015 02:15:00  |
 ||
 | Map format:  native|
 ||
 |   Type of map: vector (level: 2)   |
 ||
 |   Number of points:   3   Number of centroids:  0  |
 |   Number of lines:0   Number of boundaries: 0  |
 |   Number of areas:0   Number of islands:0  |
 ||
 |   Map is 3D:  No   |
 |   Number of dblinks:  1|
 ||
 |   Projection: UTM (zone 45)|
 ||
 |   N:  2495814.59574642S:  2492825.11903619 |
 |   E:   645063.06070329W:   641365.09898322 |
 ||
 |   Digitization threshold: 0|
 |   Comment: |
 |  

Re: [GRASS-user] Temporal data issues need resolving

2017-02-23 Thread Laurent C.
2017-02-23 13:13 GMT-06:00 Rich Shepard :
> On Thu, 23 Feb 2017, Sören Gebbert wrote:
>
>> This seems to be a bug.
>
>
> Sören,
>
>   Just my luck! :-(
>
>> However, in your last email you performed this task in the topology
>> mapset.
>
>
>   That's true.
>
>> Why do you need to have three rainfall strds? Are they differen? If
>> they are equal then you can reference to a single strds using the
>> @mapset approach like in raster or vector maps.
>
>
>   Because Itzi does not like maps to be in different mapsets.

That is not true. You just have to provide Itzï with the fully
qualified ID in the form mapname@mapset, like every other GRASS
module.
The resulting STDS will be written in a single mapset (the current
one), but once again it is standard GRASS behaviour.

Laurent

>
>   My maps are in separate directories: data/precipitation/,
> /data/topography/, and analyses/. I tried running Itzi from the analyses/
> subdirectory and the model told me it could not find the DEM or manning's n
> maps or the precipitation STRDS. As I wrote earlier, I had to re-create and
> re-register the rainfall STRDS because it disappeared since yesterday
> afternoon.
>
> Thanks,
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Create Manning's n map

2017-02-22 Thread Laurent C.
Rich,

If you want to create a raster map with an uniform value, just use mapcalc:
r.mapcalc exp='manning=0.03'

And that's it.

Laurent

2017-02-22 16:40 GMT-06:00 Rich Shepard :
>   For the defined region I want to create a map of the Manning's n friction
> value (0.030) in each cell. v.in.ascii tells me it cannot find the input
> text file:
>
> v.in.ascii -n -b input=manning.txt output=manning format=point
> ERROR: Unable to open input file 
>
>   The file has no coordinates, only the single value 0.030. I am not finding
> what is missing here. A pointer is needed.
>
> Rich
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Creating STRDS from scratch

2017-02-22 Thread Laurent C.
2017-02-22 9:28 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Tue, 21 Feb 2017, Laurent C. wrote:
>
>> In your case, it seems you want to have uniform rainfall. So you can set
>> the region, and then use mapcalc like so: r.mapcalc
>> exp='rainfall_2013115=0.1' And doing the same for each day.
>
>
>   The region is correctly set. I assume that what t.info reports is correct
> as the rainfall input to Itzi and would like confirmation or corrections:
>

As Sören said, it is an empty STRDS.
For use with Itzï, the model checks the topology of the data before
running the simulation. It will run only if:
- The STRDS covers the simulation from start to end,
- does not have any gap,
- have valid topology

Regards,
Laurent

> t.info type=strds input=rainfall
>  +--- Space Time Raster Dataset ---+
>  |
>  |
>  +--- Basic information ---+
>  | Id:  rainfall@topography
>  | Name: .. rainfall
>  | Mapset:  topography
>  | Creator: ... rshepard
>  | Temporal type: . absolute
>  | Creation time: . 2017-02-21 13:43:48.931376
>  | Modification time:.. 2017-02-21 13:43:48.931422
>  | Semantic type:.. mean
>  +--- Absolute time ---+
>  | Start time:. None
>  | End time:... None
>  | Granularity: None
>  | Temporal type of maps:.. None
>  +--- Spatial extent --+
>  | North:.. None
>  | South:.. None
>  | East:..  None
>  | West:... None
>  | Top: None
>  | Bottom:. None
>  +-- Metadata information -+
>  | Raster register table:..
> raster_map_register_7137018d99ba4dd29f94b620b8ca406e
>  | North-South resolution min:. None
>  | North-South resolution max:. None
>  | East-west resolution min:... None
>  | East-west resolution max:... None
>  | Minimum value min:.. None
>  | Minimum value max:.. None
>  | Maximum value min:.. None
>  | Maximum value max:.. None
>  | Aggregation type:... None
>  | Number of registered maps:.. None
>  |
>  | Title:
>  | Rainfall Rates
>  | Description:
>  | Daily rainfall rates in mm/hr.
>  | Command history:
>  | # 2017-02-21 13:43:49
>  | t.create type="strds" temporaltype="absolute"
>  | output="rainfall" title="Rainfall Rates"
>  | description="Daily rainfall rates in mm/hr."
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Change value of a specific raster cell

2017-02-21 Thread Laurent C.
Rich,

I would use v.in.ascii, v.to.rast and then r.patch.

Laurent

2017-02-21 13:42 GMT-06:00 Rich Shepard :
>   What is the appropriate r.mapcalc command to change the value of the
> raster cell at a specified coordinate? Cell resolution is 1m x 1m.
>
>   For a specified coordinate pair (east,north) I want to change the value
> from 158.7290 to 160.0. The expression would be 'value = 160.0', but needs
> to be applied to only a single cell.
>
>   Do I build a one-cell mask, change the value in the mask, then apply the
> mask's cell value to the whole map?
>
> Rich
>
>
>
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Creating STRDS from scratch

2017-02-21 Thread Laurent C.
Rich,

I'm not familiar with the 'file' option in r.mapcalc. Maybe removing
the quotes will do?

Laurent

2017-02-21 12:31 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Tue, 21 Feb 2017, Laurent C. wrote:
>
>> So you can set the region, and then use mapcalc like so: r.mapcalc
>> exp='rainfall_2013115=0.1' And doing the same for each day.
>
>
> Laurent,
>
>   Syntax error.
>
> File contents:
>
> 'rainfall_20131115 = 0.10'
> 'rainfall_20131116 = 0.32'
> 'rainfall_20131117 = 0.10'
>   ...
> 'rainfall_20131208 = 0.23'
> 'rainfall_20131209 = 0.00'
>
> Command line:
> r.mapcalc file=/full/path/to/data/file/pop_daily_precip.txt
> syntax error, unexpected ';', expecting '='
> Parse error
> ERROR: parse error
>
>   I do not see my error.
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Calculate flooded area based on precipitation

2017-02-16 Thread Laurent C.
2017-02-15 18:38 GMT-06:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Wed, 15 Feb 2017, Laurent C. wrote:
>
>> The h_max output map of Itzï will correspond to the maximum water level
>> reached during the simulation.
>
>
> Laurent,
>
>   I did this to reveal water accumulation with un-blocked flows and did not
> see how to modify it to show blocked flow accumulations.
>
>> To simulate the blockage, you might need to change the DEM locally. But in
>> the case of a under-road culvert, just leaving the measured elevation of
>> the road might be enough.
>
>
>   I'll need to experiment with this to understand how to 'leave the road
> elevation' when the culvert's blocked. Perhaps increasing the DEM of all
> cells to that of the road elevation will do it.

Culverts usually don't appear on a raster DEM.
For instance, if you use LiDAR DEM, you will have only the elevation
of the road surface. Even bridges might appear as a dam on LiDAR data.
Itzï is not yet able to simulate pipe flow. To model a functioning
culvert, you will need to lower locally the DEM to let the flow pass.
Therefore, I'm not totally sure to understand how you modelled the
functioning culvert without changing the DEM.

But basically, yes, you need to have a DEM showing the actual
elevation of the road surface.


>> If you use direct rainfall, all the cells in the h_max map will appear wet
>> (although with very small depth). You will need to clean up the map using
>> r.mapcalc to keep only the cells with a water depth above a threshold of
>> your choice.
>
>
>   Don't completely understand this now; thinking about it and trying various
> simulations will probably help.
>
> Thanks,
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Calculate flooded area based on precipitation

2017-02-15 Thread Laurent C.
Hello Rich,

The h_max output map of Itzï will correspond to the maximum water
level reached during the simulation.
To simulate the blockage, you might need to change the DEM locally.
But in the case of a under-road culvert, just leaving the measured
elevation of the road might be enough. The water will accumulate
behind the road until it overtops it (or the rain stops).
If you use direct rainfall, all the cells in the h_max map will appear
wet (although with very small depth). You will need to clean up the
map using r.mapcalc to keep only the cells with a water depth above a
threshold of your choice.

Regards,
Laurent


2017-02-15 17:20 GMT-06:00 Rich Shepard :
>   My client needs maps that show flooded areas above a specified elevation
> based on precipitation rate and time. I can approximate precip rates based
> on daily measures at nearby weather stations and can assume saturated soils.
> The topography is flat: 0-3% slope is the characteristics of this soil map
> unit, and the ~40 ha area is essentially flat.
>
>   Precipitation flows off this land through an under-road culvert with a
> known invert elevation. If the culvert is blocked he needs to know the area
> inundated with a given precipitation rate for a specified time (e.g., one
> day).
>
>   I've looked at the hydrologic models and don't see any that appear to
> provide answers to this question. It's not landscape level analyses, nor are
> there any defined stream channels, or noticeable slopes. r.lake shows
> inundated areas at specified water heights above a given elevation, but
> this is independent of precipitation rates and time.
>
>   Laurent's Itzi model calculates accumulation at various elevations for
> a specified precipitation rate and time, yet I'm not seeing how to use this
> if there is blocked at a specified coordinate along the drainage path.
>
> Pointers needed,
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Archiving GPM 3hr rainrate in GRASS

2017-01-24 Thread Laurent C.
Hello Veronica,

Thanks for your interest. I've made some change to the code,
especially added a HTML file. I think it was the reason why
g.extension was failing.
The installation works now from a local folder. For some reason it
seems that g.extension fails to download the code from bitbucket.
If you download the repository of clone it first, it should work.
I'd be glad to hear your comments.

Cheers,
Laurent


2017-01-22 6:56 GMT-06:00 Veronica Andreo <veroand...@gmail.com>:
> Hello Laurent
>
> w00t! This new add-on sounds very nice! I'd like to do some testing.
> However, I tried to install it via g.extension and I get the following:
>
> g.extension extension=t.rast.in.gpm
> url=https://bitbucket.org/lrntct/t.rast.in.gpm
> Fetching  from
> <https://bitbucket.org/lrntct/t.rast.in.gpm/get/default.zip> (be
> patient)...
> ERROR: Extension  not found
>
> Is it intended to install with g.extension?
>
> thanks much!
> Vero
>
> 2017-01-21 1:04 GMT+01:00 Laurent C. <lrn...@gmail.com>:
>>
>> Hello all,
>>
>> I wrote a module that automatically download, import and register GPM
>> IMERG maps in GRASS.
>> You will need a NASA Earthdata Login to download the data. The code
>> can be found here:
>> https://bitbucket.org/lrntct/t.rast.in.gpm
>>
>> For now, it is limited to IMERGHH data.
>> Hope it could help people working with those data.
>>
>> Regards,
>> Laurent
>>
>>
>> 2015-03-19 10:50 GMT-06:00 Laurent C. <lrn...@gmail.com>:
>> > Hi all,
>> >
>> > I'm coming back to that subject because the GPM datas are finally
>> > available
>> > since December 2014. The original data are stored in HDF5, which is
>> > supported by GDAL.
>> > However, I had a problem with the geo-referencing of the data. It seems
>> > that
>> > the lat/long coordinates are flipped.
>> > The problem seems to come from GDAL, as the HDF5 driver still don't
>> > support
>> > GPM data:
>> > http://www.gdal.org/frmt_hdf5.html
>> >
>> > I've actually downloaded a regional extracts the data in NetCDF from a
>> > NASA
>> > website, although I can't remember where exactly, as there are several
>> > services. Those data suffer from the same problem of inverted
>> > coordinates.
>> >
>> > So I used the ncpdq from NCO package to fix the NetCDF directly, and a
>> > tiny
>> > Python script to batch process the files :
>> >
>> > ###
>> > #!/usr/bin/env python
>> > from os import listdir
>> > import subprocess
>> > for input_file in listdir(main_path):
>> > output_file = input_file + '_fixed'
>> > subprocess.call(['ncpdq','-a', 'lat,lon', input_file, output_file])
>> > ###
>> >
>> > After batch import the data in GRASS, maintaining the original name
>> > including timestep, which looks like this:
>> > 3B-HHR.MS.MRG.3IMERG.20140619-S00-E002959..V03D
>> >
>> > A Python script to register the maps in temporal framework:
>> >
>> > #
>> > #!/usr/bin/env python
>> > import grass.script as grass
>> >
>> > # retrieve the list of maps
>> > maplist = grass.read_command('g.list', type = 'raster',
>> > pattern = '*IMERG*')
>> >
>> > # turn result in a list
>> > maplist = maplist.split()
>> >
>> > file_name = 'gpm_timestamp.txt'
>> >
>> > # creating the file containing the timepstamp
>> > list_file = open(file_name,'w')
>> >
>> > # iterate through the maps
>> > for input_map in maplist:
>> > # split line to keep only the timestamp
>> > raw_ts = input_map.split('.')[4]
>> > # isolate the date
>> > raw_mapdate = raw_ts.split('-')[0]
>> > # put the date in form
>> > mapdate = raw_mapdate[:4] + '-' + raw_mapdate[4:6] + \
>> > '-' + raw_mapdate[6:]
>> > # isolate the start time
>> > raw_start_time = raw_ts.split('-')[1]
>> > # put the date in form
>> > start_time = raw_start_time[1:3] + ':' + \
>> > raw_start_time[3:5] + ':' + raw_start_time[5:]
>> > # isolate the end time
>> > raw_end_time = raw_ts.split('-')[2]
>> > # put the end time in form
>> > end_time = raw_end_time[1:3] + ':' + \
>> > raw_end_time[3:5] + ':' + raw_end_time[5:]
>> > # put timestamp in form
>> > timestamp = mapdate + ' ' + start_time + '|' + 

Re: [GRASS-user] Archiving GPM 3hr rainrate in GRASS

2017-01-20 Thread Laurent C.
Hello all,

I wrote a module that automatically download, import and register GPM
IMERG maps in GRASS.
You will need a NASA Earthdata Login to download the data. The code
can be found here:
https://bitbucket.org/lrntct/t.rast.in.gpm

For now, it is limited to IMERGHH data.
Hope it could help people working with those data.

Regards,
Laurent


2015-03-19 10:50 GMT-06:00 Laurent C. <lrn...@gmail.com>:
> Hi all,
>
> I'm coming back to that subject because the GPM datas are finally available
> since December 2014. The original data are stored in HDF5, which is
> supported by GDAL.
> However, I had a problem with the geo-referencing of the data. It seems that
> the lat/long coordinates are flipped.
> The problem seems to come from GDAL, as the HDF5 driver still don't support
> GPM data:
> http://www.gdal.org/frmt_hdf5.html
>
> I've actually downloaded a regional extracts the data in NetCDF from a NASA
> website, although I can't remember where exactly, as there are several
> services. Those data suffer from the same problem of inverted coordinates.
>
> So I used the ncpdq from NCO package to fix the NetCDF directly, and a tiny
> Python script to batch process the files :
>
> ###
> #!/usr/bin/env python
> from os import listdir
> import subprocess
> for input_file in listdir(main_path):
> output_file = input_file + '_fixed'
> subprocess.call(['ncpdq','-a', 'lat,lon', input_file, output_file])
> ###
>
> After batch import the data in GRASS, maintaining the original name
> including timestep, which looks like this:
> 3B-HHR.MS.MRG.3IMERG.20140619-S00-E002959..V03D
>
> A Python script to register the maps in temporal framework:
>
> #
> #!/usr/bin/env python
> import grass.script as grass
>
> # retrieve the list of maps
> maplist = grass.read_command('g.list', type = 'raster',
> pattern = '*IMERG*')
>
> # turn result in a list
> maplist = maplist.split()
>
> file_name = 'gpm_timestamp.txt'
>
> # creating the file containing the timepstamp
> list_file = open(file_name,'w')
>
> # iterate through the maps
> for input_map in maplist:
> # split line to keep only the timestamp
> raw_ts = input_map.split('.')[4]
> # isolate the date
> raw_mapdate = raw_ts.split('-')[0]
> # put the date in form
> mapdate = raw_mapdate[:4] + '-' + raw_mapdate[4:6] + \
> '-' + raw_mapdate[6:]
> # isolate the start time
> raw_start_time = raw_ts.split('-')[1]
> # put the date in form
> start_time = raw_start_time[1:3] + ':' + \
> raw_start_time[3:5] + ':' + raw_start_time[5:]
> # isolate the end time
> raw_end_time = raw_ts.split('-')[2]
> # put the end time in form
> end_time = raw_end_time[1:3] + ':' + \
> raw_end_time[3:5] + ':' + raw_end_time[5:]
> # put timestamp in form
> timestamp = mapdate + ' ' + start_time + '|' + mapdate + \
> ' ' + end_time
>
> # format the whole line
> line = input_map + '|' + timestamp + '\n'
>
> # write line to the file
> list_file.write(line)
>
> # close the file
> list_file.close()
>
> # register the maps in grass space_time dataset
> grass.run_command('t.register', input = 'GPM_ZMCM', file = file_name)
>
> #
>
>
> Hope it will help other peoples having trouble using those data.
>
> Regards,
> Laurent
>
>
> 2014-11-06 5:15 GMT-06:00 maning sambale <emmanuel.samb...@gmail.com>:
>>
>> Thanks Markus.  Already registered and can access ftp.  Unfortunately,
>> processed (L3) rainfall data will be released by Dec 2014.
>> Will just wait then. :)
>>
>> On Thu, Nov 6, 2014 at 4:27 PM, Markus Neteler <nete...@osgeo.org> wrote:
>> > On Mon, Nov 3, 2014 at 10:18 AM, maning sambale
>> > <emmanuel.samb...@gmail.com> wrote:
>> >> Has anyone here able to archive and load GPM dataset into GRASS?  I
>> >> was able to get TRMM netcdf in my area of interest before, but I can't
>> >> find the tools to automate GPM downloads.
>> >>
>> >> Thanks!
>> >>
>> >> [0] http://www.nasa.gov/mission_pages/GPM/main/
>> >
>> > They state
>> >
>> > "All data are freely available through the NASA's Precipitation
>> > Processing System at http://pps.gsfc.nasa.gov;
>> >
>> > --> "Register and search for GPM and TRMM data, order custom subsets
>> > and set up subscriptions using PPS Data Products Ordering Interface
>> > (STORM)."
>> >
>> > At time the server seems to be down?
>> >
>> > Markus
>>
>>
>>
>> --
>> cheers,
>> maning
>> --
>> "Freedom is still the most radical idea of all" -N.Branden
>> wiki: http://esambale.wikispaces.com/
>> blog: http://epsg4253.wordpress.com/
>> --
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-17 Thread Laurent C.
Hello Sören,

The problem occurs when Itzï is calling:
"tgis.SpaceTimeRasterDataset(name).is_in_db()"

tgis.init() is called just before. "name" is a a formatted map or
strds ID (i.e including mapset)

It is difficult to understand what is happening because I can't
reproduce the problem.

Regards,
Laurent


2016-10-16 16:01 GMT-05:00 Sören Gebbert :
> Hi,
> i don't know why this happens. It may be a bug in the temporal framework or
> in itzi. Testing the code in the temporal framework seems to work, but more
> testing is needed.
> However, the traceback is fine, but there must be an error message that will
> tell you what mapset is missing and what mapsets are in the temporal
> framework search path.
>
> Something like:
> """
> You have no permission to "
>"access mapset <%(mapset)s>, or "
>"mapset <%(mapset)s> has no temporal database. "
>"Accessable mapsets are: <%(mapsets)s>
>
> """
>
> Best regards
> Soeren
>
>
>
> 2016-10-16 22:03 GMT+02:00 Rich Shepard :
>>
>> On Sat, 15 Oct 2016, Sören Gebbert wrote:
>>
>>> Please try to put all mapsets that you use in your analysis into the
>>> mapset search path. The temporal framework will only access strds in
>>> mapsets that are located in the current search path.
>>
>>
>> Soeren,
>>
>>   Current mapset is 'analyses':
>>
>>> g.mapset -p
>>
>> analyses
>>
>>   Some maps might be in other mapsets so ...
>>
>>> g.mapsets -p
>>
>> Accessible mapsets:
>> analyses PERMANENT features soils topography precipitation
>>
>> which is all the mapsets in the location.
>>
>>   The file, itzi-param.txt, contains:
>>
>> [time]
>> duration = 2:00:00
>> record_step = 00:05:00
>>
>> [input]
>> dem = be_cropped@topography
>> friction = n
>> rain = rain
>>
>> [output]
>> prefix = pop
>> values = h, wse, v, vdir, boundaries
>>
>> [statistics]
>> stats_file = pop.csv
>>
>>   And this is the traceback:
>>
>>
>>> itzi run itzi-param.txt
>>
>> Starting simulation of itzi-param.txt... WARNING: Error during execution:
>> Traceback (most recent call last):
>>   File "/usr/lib/python2.7/site-packages/itzi/itzi.py", line 183, in
>> sim_runner_worker
>> sim_runner.run()
>>   File "/usr/lib/python2.7/site-packages/itzi/itzi.py", line 90, in run
>> sim_param=self.conf.sim_param)
>>   File "/usr/lib/python2.7/site-packages/itzi/simulation.py", line 77, in
>> __init__
>> self.gis.read(self.in_map_names)
>>   File "/usr/lib/python2.7/site-packages/itzi/gis.py", line 187, in read
>> elif self.name_is_stds(self.format_id(map_name)):
>>   File "/usr/lib/python2.7/site-packages/itzi/gis.py", line 138, in
>> name_is_stds
>> if tgis.SpaceTimeRasterDataset(name).is_in_db():
>>   File
>> "/usr/local/grass-7.3.svn/etc/python/grass/temporal/abstract_dataset.py",
>> line 368, in is_in_db
>> return self.base.is_in_db(dbif)
>>   File "/usr/local/grass-7.3.svn/etc/python/grass/temporal/base.py", line
>> 315, in is_in_db
>> dbif.execute(sql, mapset=self.mapset)
>>   File "/usr/local/grass-7.3.svn/etc/python/grass/temporal/core.py", line
>> 981, in execute
>> self._create_mapset_error_message(mapset)))
>>   File
>> "/usr/local/grass-7.3.svn/etc/python/grass/pygrass/messages/__init__.py",
>> line 271, in fatal
>> sys.exit(1)
>> SystemExit: 1
>>
>> Simulations complete. Elapsed times: itzi-param.txt: 0:00:01 Total:
>> 0:00:01 Average: 0:00:01
>>
>>   Please suggest what I should try modifying.
>>
>> Thanks,
>>
>>
>> Rich
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-12 Thread Laurent C.
2016-10-12 13:52 GMT-05:00 Rich Shepard :
> On Wed, 12 Oct 2016, Rich Shepard wrote:
>
>>  Hmm-m-m. I'll read the v.surf.idw manual page.
>
>
>   I don't see how v.surf.idw is helpful here. The current map has only
> category values and the label for each station. Interpolating station
> locations or labels makes no sense. The precipitation data for each station
> has not been entered in the sqlite3 attribute table. More to the need of
> this project would be extrapolation as the project area is east of this
> cluster of weather stations. What I need to show are the locations of the
> weather stations relative to the project area and the variability of
> precipitation among sites for any given day. I don't see how interpolation
> of any of these data is useful. If I'm wrong, please educate me.
>
>
> Rich
>

In that case you may use the closest station as an uniform rainfall value.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-12 Thread Laurent C.
Rich,

You can interpolate the data using v.surf.idw to get a raster map.
Literature says that a power parameter superior to 2 (between 3 to 5)
might get better result for rainfall.

Laurent

2016-10-12 12:20 GMT-05:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Wed, 12 Oct 2016, Laurent C. wrote:
>
>> Sure, raster time series of rainfall intensities is a very good way to
>> take advantage of GRASS temporal framework in hydrologic modelling.
>
>
> Laurent,
>
>   These are point data, not raster. See attached .png.
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-12 Thread Laurent C.
Hello Rich,

Sure, raster time series of rainfall intensities is a very good way to
take advantage of GRASS temporal framework in hydrologic modelling.

Regards,
Laurent

2016-10-12 10:45 GMT-05:00 Rich Shepard :
> On Tue, 11 Oct 2016, Rich Shepard wrote:
>
>>  I've no idea because I've not used any of them before. However, if I can
>> find an appropriate data set I'll test some of them.
>
>
> Laurent,
>
>   I have precipitation data for several sites over a two month period (one
> site has only one month's data). For each site I have the longlat
> coordinates.
>
>   The data are currently in database format (R long form) with columns names
> of site_id, date, quantity. I planned on analyzing them with R's sp package
> to produce heat maps of precipitation intensity. Would these data be useful
> in testing tgrass modules?
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-11 Thread Laurent C.
Richard,

It seems to be a problem from within the temporal framework. I never
had this specific problem before, but I've run into some other obscure
errors using TGRASS.
Are other temporal commands (t.list, t.create...) working properly?

Laurent

2016-10-11 13:38 GMT-05:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Tue, 11 Oct 2016, Laurent C. wrote:
>
>> - Your rainfall rate is very small.
>
>
> Laurent,
>
>   Changed rain to 10 mm/h, time to 2 hrs with 5 min steps. Specified mapset
> for DEM map (be_cropped) as it's not in the analyses mapset.
>
>> - By setting bctype=4 and bcvalue=0 on all your region, you're forcing
>> a water depth of zero everywhere. For a start, you can drop those
>> parameters.
>
>
>   Removed both bctype and bcvalue.
>
>> About the problem you encounter. Since GRASS does not support python3
>> (AFAIK), Itzï is only tested with python 2.7. It is strange that it
>> installed with python3. To force the installation with python2, you
>> can run the following command:
>> $ pip2 install itzi --user
>
>
>   Yes, now itzi is installed for both python2 and python3.
>
>   There is an issue with the time-space databases that prevent the
> simulation from running:
>
>> itzi run itzi-param.txt
>
> Starting simulation of itzi-param.txt... WARNING: Error during execution:
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/itzi/itzi.py", line 183, in
> sim_runner_worker
> sim_runner.run()
>   File "/usr/lib/python2.7/site-packages/itzi/itzi.py", line 90, in run
> sim_param=self.conf.sim_param)
>   File "/usr/lib/python2.7/site-packages/itzi/simulation.py", line 77, in
> __init__
> self.gis.read(self.in_map_names)
>   File "/usr/lib/python2.7/site-packages/itzi/gis.py", line 187, in read
> elif self.name_is_stds(self.format_id(map_name)):
>   File "/usr/lib/python2.7/site-packages/itzi/gis.py", line 138, in
> name_is_stds
> if tgis.SpaceTimeRasterDataset(name).is_in_db():
>   File
> "/usr/local/grass-7.3.svn/etc/python/grass/temporal/abstract_dataset.py",
> line 368, in is_in_db
> return self.base.is_in_db(dbif)
>   File "/usr/local/grass-7.3.svn/etc/python/grass/temporal/base.py", line
> 315, in is_in_db
> dbif.execute(sql, mapset=self.mapset)
>   File "/usr/local/grass-7.3.svn/etc/python/grass/temporal/core.py", line
> 981, in execute
> self._create_mapset_error_message(mapset)))
>   File
> "/usr/local/grass-7.3.svn/etc/python/grass/pygrass/messages/__init__.py",
> line 271, in fatal
> sys.exit(1)
> SystemExit: 1
>
> Simulations complete. Elapsed times: itzi-param.txt: 0:00:00 Total: 0:00:00
> Average: 0:00:00
>
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-11 Thread Laurent C.
Hello Rich,

First some remarks about your entry data:
- Your rainfall rate is very small. For your entire simulation of 24h,
it will rain only 0.24mm on your domain. Since the depth values under
the 'hmin' threshold are not output, you'll end up with empty output.
If you want to see flow patterns, set this value to at the very least
10mm/h. 100 if you want to have faster result (without the need of
simulating 24h)
- By setting bctype=4 and bcvalue=0 on all your region, you're forcing
a water depth of zero everywhere. For a start, you can drop those
parameters.

About the problem you encounter. Since GRASS does not support python3
(AFAIK), Itzï is only tested with python 2.7. It is strange that it
installed with python3. To force the installation with python2, you
can run the following command:
$ pip2 install itzi --user

Hope this will solve your problem.

Regards,
Laurent

2016-10-11 11:18 GMT-05:00 Rich Shepard <rshep...@appl-ecosys.com>:
> On Mon, 10 Oct 2016, Laurent C. wrote:
>
>> Note that Itzï does not need an output to run. If you set a simulation
>> with only the DEM, an uniform friction coefficient and an uniform
>> rainfall, the water will simply accumulate in the depressions, giving you
>> an insight of the flow patterns.
>
>
> Laurent,
>
>   I tried to run Itzi after defining variables as:
> rain=0.01 # assuming this is the rate in mm/hr
> n=0.05
> bctype=4
> bcvalue=0
> and this parameter file:
>
> [time]
> duration = 24:00:00
> record_step = 01:00:00
>
> [input]
> dem = be_cropped
> friction = n
> rain = rain
> bctype = bctype
> bcval = bcvalue
>
> [output]
> prefix = pop
> values = h, wse, v, vdir, boundaries
>
> [statistics]
> stats_file = pop.csv
>
>   Two issues:
>
>   First, Itzi is installed in Python-3.5's site-packages/ directory and I
> want to install it also Python-2.7.5's site-packages/ directory, too, and
> use that version since it seems that grass is using Python2. How do I
> specify to Itzi to install in /usr/lib/Python-2.7.5/site-packages/?
>
>   Second, /usr/lib/Python-3.5/site-packages/itzi/configreader.py exists, yet
> I get this python error trace back from the attempted run:
>
>> itzi run itzi-param.txt
>
> Traceback (most recent call last):
>   File "/usr/bin/itzi", line 9, in 
> load_entry_point('itzi==16.8', 'console_scripts', 'itzi')()
>   File "/usr/lib/python3.5/site-packages/itzi/itzi.py", line 40, in main
> args.func(args)
>   File "/usr/lib/python3.5/site-packages/itzi/itzi.py", line 54, in itzi_run
> from configreader import ConfigReader
> ImportError: No module named 'configreader'
>
>   I've not examined the source code; I can fix this error here but am I the
> only one to run into this?
>
> Thanks,
>
>
> Rich
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Interpreting r.watershed accumulation map

2016-10-10 Thread Laurent C.
Hello Rich,

According to the r.watershed manual:
"Output accumulation map contains the absolute value of each cell in
this output map is the amount of overland flow that traverses the
cell. This value will be the number of upland cells plus one if no
overland flow map is given. If the overland flow map is given, the
value will be in overland flow units. Negative numbers indicate that
those cells possibly have surface runoff from outside of the current
geographic region. Thus, any cells with negative values cannot have
their surface runoff and sedimentation yields calculated accurately.
"

So basically the darker the cell, the larger the drained area. Darker
cells therefore show the flow courses according to the topography.

Note that Itzï does not need an output to run. If you set a simulation
with only the DEM, an uniform friction coefficient and an uniform
rainfall, the water will simply accumulate in the depressions, giving
you an insight of the flow patterns.

Regards,
Laurent


2016-10-10 11:23 GMT-05:00 Rich Shepard :
>   The input to r.watershed (be_cropped) has elevation range of 148.2m -
> 168.4m. The accumulation output map has values ranging from
> -89397.3-38013.4. An image of a portion of the map is attached.
>
>   How do I interpret the colors on the map since the legend shows only a
> narrow blue bar on a black background? As there are cells with high negative
> values does this map contain any useful information?
>
>   Given such flat land (the area in the image has an elevation difference of
> approximately 1m) I have not identified a module that produces insights into
> surface runoff patterns. I've tried several with no success; r.lake does
> produce water depths based on the elevation of a blockage.
>
>   Itzi does not work on these data because there are no stream channels for
> use by r.water.outlet.
>
>   Have I missed something?
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.water.outlet: no map displayed

2016-10-03 Thread Laurent C.
Hello Rich,

When using r.water.outlet you need to be careful setting the outlet on the
exact flow line. Using the flow accumulation map is useful for that task.
If the outlet point is just one cell on the side, the generated watershed
could be tiny.
Hope this helps.

Laurent

El oct. 2, 2016 6:17 PM, "Rich Shepard"  escribió:

>   For some reason r.water.outlet now produces an empty map. It did before I
> re-projected source maps to ensure they all have the proper values in the
> target location.
>
>   Attached is an image of the input drainage map and the coordinate feature
> (the lower dot).
>
>   This is how r.info describes the output (watershed) map:
>
> Type of Map:  raster   Number of Categories: 0   |
>Data Type:CELL
>Rows: 1004
>Columns:  577
>Total Cells:  579308
>
>Projection: NAD83(HARN) / Oregon North
>N: 175430.80940854S: 174426.61003591   Res: 1.00019858
>E: 2296197.40538338W: 2295620.05945154   Res: 1.00059954
>Range of data:min = 1  max = 1
>
> Data Description:|
>generated by r.water.outlet
>
>Comments:
>r.water.outlet --overwrite input="drainage" output="watershed" coord\
>  inates=2295821.27858,175258.094514
>
>   I'm not seeing what I've done differently so that there's no visible
> display of map "watershed."
>
> TIA,
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Itzi: units of length and flooded areas

2016-09-27 Thread Laurent C.
Hi Rich,

The rainfall unit indeed mm/h. The units used for all entry and output maps
are listed in the user manual on the website. In the tutorial, the example
output map is in meters after 100 minutes of simulation (map #20 with a
record step of 5 minutes). Another way to know a map's time stamp is to use
the GRASS temporal tools.

If you want to represent a blocked watershed, don't set any boundary
condition. By default, they are closed. The water will then not exit the
domain, apart from optional infiltration.

Laurent

El sept. 27, 2016 12:37 PM, "Rich Shepard" 
escribió:

> Laurent,
>
>   I appreciate that Iizi works in SI units and I have a question about the
> basis for that. Specifically, in your tutorial section using mapcalc to
> create a map of uniform rainfall you specify 'rain=100'. Is the 100 in
> mm/hr
> or some other unit or rate?
>
>   Your example figure, nc_itzi_tutorial_h_0020, appears to present water
> depth after 2 hr of 100 mm/hr? rainfall in an unrestricted stream channel.
> Is there a way of showing rainfall accumulation (flooding) if the watershed
> outlet is blocked?
>
> Thanks,
>
> Rich
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Analyzing level ground

2016-09-26 Thread Laurent C.
Hello Rich,

Could you check that the point you want to set as outlet is inside your
Region? Please check your Region extend.
For the units, as long as the location is not in lat-long, Itzï will run.
But it expects SI units, so using feet might gives you unexpected results.
I would suggest to work with the units given in the manual.

Regards,
Laurent

El sept. 26, 2016 18:31, "Rich Shepard" <rshep...@appl-ecosys.com> escribió:

> On Thu, 22 Sep 2016, Laurent C. wrote:
>
> If it is the case, you might give Itzï a try:
>> https://www.itzi.org/
>>
>
> Laurent,
>
>   I'm emulating your tutorial with my data and have run into an error with
> r.water.outlet:
>
> r.water.outlet in=be_drainage out=watershed coord=753992.63435,57992.90515
> 9
> --overwrite
> WARNING: Ignoring point outside computation region: 753992.6343,57992.9052
>  100%
>
>   The coordinates are those of a culvert inflow (easting, northing) in
> international feet. Do I need to create a new location to convert these
> value to meters or have I done something else incorrectly?
>
> Regards,
>
> Rich
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Analyzing level ground

2016-09-22 Thread Laurent C.
Hello Rich,

For the infiltration, if you can determine the soil texture, then you
could estimate the Green-Ampt parameters using [1]
What do you want to do in that area? Perform hydrological/overland
flow analysis?
If it is the case, you might give Itzï a try:
https://www.itzi.org/
Some of the parameters could be estimated (like friction coefficient).

Regards,
Laurent

[1] Rawls, W., Brakensiek, D., and Miller, N. (1983). "Green‐ampt
Infiltration Parameters from Soils Data." J. Hydraul. Eng.,
10.1061/(ASCE)0733-9429(1983)109:1(62), 62-70.


2016-09-22 13:09 GMT-05:00 Rich Shepard :
>   The project area -- in farmland -- is small (< 20 ha) and  essentially
> flat with elevation differences less than 1 meter. The LiDAR raster cells
> (imported from ARC Grid format) have a cell size of 3x3 international feet;
> elevation resolution is 0.013 feet.
>
>   While r.slope.aspect generates an aspect map, the slope map is blank. The
> maps for dx, dy, and relief display variations.
>
>   While I have some soil data, it's sparse and I haven't (yet) found
> infiltration rates; the rainfall data is very low and from a station several
> miles away. I probably do not have all required input data for r.sim.water
> or r.watershed.
>
>   Based on your much more extensive experiences applying GRASS to limited
> areas please suggest approaches that might be appropriate for this project.
> It might be that all I can do is create detailed contour maps of the area
> and describe the situation qualitatively without robust quantitative
> analyses.
>
> TIA,
>
> Rich
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] DEM to DTM

2016-09-16 Thread Laurent C.
2016-09-16 0:14 GMT-05:00 Eddison Araya :
> El 15/9/2016 9:00 a. m., "José Anderson" 
> escribió:
>>
>> Dear all,
>>
>> I'm in need to start a study in a urban area in which the DTM
>> (https://en.wikipedia.org/wiki/Digital_elevation_model) is to be obtained
>> from a DEM (SRTM or ASTER).
>>
>> I've seen GRASS7 can provide DTM from LiDAR maps, but I'm afraid it won't
>> work in this case.
>>
>> So, how to derive a DTM from DEM in GRASS 7?
>>
>> Any answer would be appreciated.
>>
>> Jose
>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> Hola!!
>
> http://ssrebelious.blogspot.co.uk/2013/03/dsm-to-dem-conversion.html?m=1
>
> Espero te funcione el link anterior
>
> Saludos
>
> Eddison

Hi,

Interesting, but in case of low-res DSM (30m for recent global DEM),
there is basically no bare-earth visible and the whole urban area
appears elevated. In case the city in question have wide avenues that
could be seen on the DSM you might have more luck.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] DEM to DTM

2016-09-15 Thread Laurent C.
Hello José,

There is basically three global DEM freely available:
- Aster DEM, which is agreed to be garbage
- SRTM, which is the reference
- the newly released ALOS DEM, which seems to be the best quality of all 3.

They are surface models, so trees and buildings are affecting the altitude
values. It exists methods to approximate the bare earth, but neither easy
nor accurate. Furthermore, the methods described in the literature seems
more designed for global correction that might not lead to adequate results
for detailed study in urban environment.

I actually have the same problem as you and in search of solutions.

Regards,
Laurent

El sept. 15, 2016 10:00 AM, "José Anderson" 
escribió:

> Dear all,
>
> I'm in need to start a study in a urban area in which the DTM (
> https://en.wikipedia.org/wiki/Digital_elevation_model) is to be obtained
> from a DEM (SRTM or ASTER).
>
> I've seen GRASS7 can provide DTM from LiDAR maps, but I'm afraid it won't
> work in this case.
>
> So, how to derive a DTM from DEM in GRASS 7?
>
> Any answer would be appreciated.
>
> Jose
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] How to sum a hundred of raster maps using r.mapcalc

2016-09-09 Thread Laurent C.
2016-09-08 12:32 GMT-05:00 Veronica Andreo :
> Hello,
>
> You can use r.series for that and pass the list of maps that you get with
> g.list directly into r.series using back ticks, or you can also pass a file
> with all map names. Check the manual for more examples:
> https://grass.osgeo.org/grass73/manuals/r.series.html
>

Hello,

Interesting, I always used mapcalc for this. Do you know what are the
advantages of using r.series instead of mapcalc for this type of job?

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS at the 12th International Conference on Hydroinformatics

2016-08-16 Thread Laurent C.
2016-08-16 13:30 GMT-05:00 Vaclav Petras <wenzesl...@gmail.com>:
>
> On Sat, Aug 13, 2016 at 1:09 PM, Laurent C. <lrn...@gmail.com> wrote:
>>
>> I've tried but never manage to make it work. See:
>> https://lists.osgeo.org/pipermail/grass-dev/2016-March/079481.html
>> https://trac.osgeo.org/grass/ticket/2480
>> https://trac.osgeo.org/grass/ticket/2968
>>
>> So I finally decided to make it a Python package and drop g.parser for
>> argparse.
>
>
> Hi Laurent,
>
> you can actually still use GRASS parser even if you are not using
> g.extension. The only condition for GRASS parser to work is that you script
> is running inside GRASS session. You can even use both GRASS parser and your
> current mechanism if you have some way of distinguishing the command lines
> from each other and than calling the proper set of functions.
>
> Vaclav

Hi Vaclav,

I know. But since the module was not compiling, the GUI was not
working, so the main advantage of using g.parser over argparse was
gone.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS at the 12th International Conference on Hydroinformatics

2016-08-13 Thread Laurent C.
2016-08-12 23:28 GMT-05:00 Thomas Adams <tea...@gmail.com>:
> Hi Laurent,
>
> Not sure what I'm doing wrong; I followed the installation using:
>
> pip install itzi
>
> which placed itzi here...
>
> /home/teaiii/.local/lib/python2.7/site-packages/itzi
>
> Running: itzi run parameter_file_name ... gives me this...
>
> GRASS 7.0.3 (nc_spm_08_grass7):~/grass/data > itzi run test
> itzi: command not found
>
>
> I guess itzi was not installed where it should go or is my PATH not right?
>
> Tom

Tom,

It looks like a PATH problem. For some reason, pip is not adding the
local bin directory to the PATH when installing with --user, at least
in Ubuntu.
So you might need to add $HOME/.local/bin to your PATH.

Laurent

>
>
>
> On Fri, Aug 12, 2016 at 7:09 PM, Laurent C. <lrn...@gmail.com> wrote:
>>
>> Hello,
>>
>> This message to let you know that I'll give a talk called "A GRASS GIS
>> module for 2D superficial flow simulations" at the 12th International
>> Conference on Hydroinformatics that will be held from 21 to 26 of
>> august in Incheon, Korea. The goal is basically to present Itzï
>> (https://www.itzi.org/), a new superficial flow model that uses GRASS
>> as a back-end.
>>
>> If any other GRASS user will be present at this event, I'll be glad to
>> meet.
>> Of course, I'll be happy if anyone give a try at the software and give
>> me some feed back.
>>
>> Cheers,
>> Laurent
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
>
>
> --
> Thomas E Adams, III
> 1724 Sage Lane
> Blacksburg, VA 24060
>
> 1 (513) 739-9512 (cell)
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS at the 12th International Conference on Hydroinformatics

2016-08-13 Thread Laurent C.
2016-08-12 22:21 GMT-05:00 Anna Petrášová <kratocha...@gmail.com>:
> On Fri, Aug 12, 2016 at 7:09 PM, Laurent C. <lrn...@gmail.com> wrote:
>> Hello,
>>
>> This message to let you know that I'll give a talk called "A GRASS GIS
>> module for 2D superficial flow simulations" at the 12th International
>> Conference on Hydroinformatics that will be held from 21 to 26 of
>> august in Incheon, Korea. The goal is basically to present Itzï
>> (https://www.itzi.org/), a new superficial flow model that uses GRASS
>> as a back-end.
>>
>> If any other GRASS user will be present at this event, I'll be glad to meet.
>> Of course, I'll be happy if anyone give a try at the software and give
>> me some feed back.
>>
>
> This looks great. I tried to follow your example in documentation and
> it worked, except for a small inconsistency in map names:
>
> v.to.rast input=watershed_out type=point output=bcval use=val value=0
> and in the config file you have:
>
> bcval = bcvalue@PERMANENT
>
> (should be bcval)

Thanks. I've corrected the manual.

>
> I will probably test this more later. We should also consider if there
> is a way we could distribute it through official addons.

I've tried but never manage to make it work. See:
https://lists.osgeo.org/pipermail/grass-dev/2016-March/079481.html
https://trac.osgeo.org/grass/ticket/2480
https://trac.osgeo.org/grass/ticket/2968

So I finally decided to make it a Python package and drop g.parser for argparse.
If anyone want to give it another try, It's OK for me.

Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS_VERBOSE=-1

2016-08-13 Thread Laurent C.
Hello,

Then pass quiet=true to run_command()

Laurent

El ago. 13, 2016 2:39, "Micha Silver" <mi...@arava.co.il> escribió:

> -- Original Message -- Subject: Re: [GRASS-user] GRASS_VERBOSE=-1
> Date: Fri, 12 Aug 2016 18:21:55 -0500 To: Micha Silver, Grass User List
> From: Laurent C.
>
>> Hello,
>>
>> One solution is to set the environment variable like this:
>> os.environ['GRASS_VERBOSE'] = '3'
>>
>
> What I want to do is surpress the warning messages altogether.
>
> Setting with:
>
> os.environ['GRASS_VERBOSE'] = '-1'
>
> doesn't seem to do anything.
>
> the other is to pass the verbosity as an argument to
>> run_command(verbose=True)
>>
>> Cheers,
>> Laurent
>>
>>
>> 2016-08-12 9:56 GMT-05:00 Micha Silver <mi...@arava.co.il>:
>>
>>> How do I use the VERBOSE=-1 option in a python script?
>>>
>>> I am importing lists of rasters that do not have CRS info (grib2
>>> format), so
>>> I use the '-o' option to override CRS check. But the screen gets filled
>>> with:
>>>
>>> WARNING: Datum  not recognised by GRASS and no parameters found
>>> WARNING: Over-riding projection check
>>>
>>> and I miss the messages that I want to see.
>>>
>>> Thanks
>>> ___
>>> grass-user mailing list
>>> grass-user@lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>>
>>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] grass run_command within python/grass script

2016-08-12 Thread Laurent C.
Hello,

You try to pass a string as an argument to run_command, which will not work.
If you want to change the input, change that string only:
for m in maps:
grass.run_command('r.in.gdal', input=m, output=m)

or, as in your example:
grass.run_command('r.in.gdal', input=sys.argv[5], output='your_map')

For command line parsing, I recommend using GRASS parser or argparse.
For string formatting, use .format() instead of %, which is deprecated.
(https://docs.python.org/2/library/stdtypes.html#str.format)

Laurent

2016-08-11 15:04 GMT-05:00 alassane toure :
> Group,
> I am running a grass-python script but when i replace a variable argument
> within the command the script does not work
>
> The following works...
> grass.run_command('r.in.gdal',
> input='/home/alassane/Data/SanbornCD/tile/newconstr_mask.tif',
> output='construction')
>
> But not this...
> command="'r.in.gdal', input='"+sys.argv[5]+"', output='construction'"
> print 'r.in.gdal command argument... = %s\n ' % command
> grass.run_command(command)
>
> print 'r.in.gdal command argument... = %s\n ' % command
> r.in.gdal command argument... = 'r.in.gdal',
> input='/home/alassane/Data/SanbornCD/tile/newconstr_mask.tif',
> output='construction'
>
>
> The following also works...
> command ="/home/alassane/Programs/gdal/demclass1"+" "+infile1+" "+infile2+"
> "+sys.argv[3]+" "+outfile
> os.system(command)
>
> Your help is appreciated.
>
> Regards,
> Alassane
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] GRASS_VERBOSE=-1

2016-08-12 Thread Laurent C.
Hello,

One solution is to set the environment variable like this:
os.environ['GRASS_VERBOSE'] = '3'

the other is to pass the verbosity as an argument to run_command(verbose=True)

Cheers,
Laurent


2016-08-12 9:56 GMT-05:00 Micha Silver :
> How do I use the VERBOSE=-1 option in a python script?
>
> I am importing lists of rasters that do not have CRS info (grib2 format), so
> I use the '-o' option to override CRS check. But the screen gets filled
> with:
>
> WARNING: Datum  not recognised by GRASS and no parameters found
> WARNING: Over-riding projection check
>
> and I miss the messages that I want to see.
>
> Thanks
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] GRASS at the 12th International Conference on Hydroinformatics

2016-08-12 Thread Laurent C.
Hello,

This message to let you know that I'll give a talk called "A GRASS GIS
module for 2D superficial flow simulations" at the 12th International
Conference on Hydroinformatics that will be held from 21 to 26 of
august in Incheon, Korea. The goal is basically to present Itzï
(https://www.itzi.org/), a new superficial flow model that uses GRASS
as a back-end.

If any other GRASS user will be present at this event, I'll be glad to meet.
Of course, I'll be happy if anyone give a try at the software and give
me some feed back.

Cheers,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Perform resample a raster using another image as a reference for the process?

2016-08-02 Thread Laurent C.
Eddison,

First align your region to the destination raster with 'g.region
raster=rastername'.
Then resample the other raster.

Laurent

2016-08-02 11:48 GMT-05:00 Eddison Araya :
> Hello , nice to say hello , I have 2 raster : A raster is 20 meters and
> another 30 meters in the same area. As I can do in QGIS for a resampling an
> image with reference to the other? and that the pixels are perfectly aligned
> ? I use a google translator ! Thank you very much Eddison
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Buildings detection using raster lidar data

2016-06-02 Thread Laurent C.
Hello all,

I'd like to know if there is a way to detect buildings using
superficial lidar data.
I have two types of data:
- 5m DSM raster
- 5m DTM raster

Many described methods use multi-spectral images, but I only have
access to Landsat, which I guess will be too coarse to properly detect
buildings. There are two few data from Sentinel 2 in my study zones.
The ultimate goal would be to have a vector map of buildings.

Do you know if there is a way to detect the buildings in DSM using GRASS?

Thanks for your time,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.shade python issues

2016-05-24 Thread Laurent C.
2016-05-24 4:36 GMT-05:00 Gareth Grewcock :
> Again - thanks for all the help so far, it is much appreciated.
>
> Laurent - I ran the read2_command and it returned the following:
>
> Traceback (most recent call last):
>   File "", line 254, in run_nodebug
>   File "C:\Users\ggrewcock\Dropbox\PythonScripts\gmt\grass-interface-v2.py",
> line 85, in 
> grass.read2_command('r.shade',
> shade='hillshade_output_python',color='dem_slope',
> output='shaded_raster_hillshade_map', brighten='25', overwrite=True)
> AttributeError: 'module' object has no attribute 'read2_command'

You have to define the function yourself with the code from the wiki,
it is not part of the GRASS scripting library.
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] r.shade python issues

2016-05-23 Thread Laurent C.
Hello,

I answered off-list by mistake.

Normally, when "non-zero return code1" occurs, you can see the error
generated by the module on the terminal.
Alternatively, you can try the solution given in the wiki to retrieve the error:

def read2_command(*args, **kwargs):
   kwargs['stdout'] = grass.PIPE
   kwargs['stderr'] = grass.PIPE
   ps = grass.start_command(*args, **kwargs)
   return ps.communicate()

Could you check this out and post the result here?

Regards,
Laurent

2016-05-23 9:58 GMT-05:00 Gareth Grewcock <garethgrewc...@gmail.com>:
> Thanks for getting in touch Laurent.
>
> I have been working on a data processing script written in python which I
> want to use Grass modules in. So I have actually been using
> gscript.run_command() already. I was doing this externally and not actually
> loading Grass explicitly. I can do this successfully as follows:
>
> grass.run_command('r.in.gdal',input = ffile, output = name, quiet = 'True',
> overwrite = 'True', flags = 'o')
>
> grass.run_command('r.relief',input = name,output = hillshade_output,altitude
> = '20', azimuth = '315', zscale = '6', overwrite = 'True')
>
> grass.run_command('r.slope.aspect',elevation = name, slope = "dem_slope",
> aspect = "dem_aspect", overwrite = 'True')
>
> However, when I come to use r.shade, I get the 'non-zero return code1', so I
> have since gone back into the Grass UI to try and simply run python snippets
> but can't get r.shade to work with Python either externally or through the
> UI, I really have no idea what the problem is as all of the other modules
> work fine.
>
> Cheers,
>
> Gareth
>
> On Mon, May 23, 2016 at 3:38 PM, Laurent C. <lrn...@gmail.com> wrote:
>>
>> Hello,
>>
>> Try this:
>>
>> import grass.script as gscript
>> gscript.run_command("r.shade", shade=aspect, color=elevation,
>> output=elevation_aspect_shaded)
>>
>> Have a look at the wiki:
>> https://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library
>>
>> Laurent
>>
>> 2016-05-23 8:01 GMT-05:00 Gareth Grewcock <garethgrewc...@gmail.com>:
>> > Hi Stefan - thanks for getting back to me.
>> >
>> > I had tried that before but still got issues, this time returning:
>> > 'NameError: name 'r' is not defined'
>> >
>> > r.shade(shade=aspect, color=elevation, output=elevation_aspect_shaded)
>> > Traceback (most recent call last):
>> >   File "", line 1, in 
>> > NameError: name 'r' is not defined
>> >
>> > Any ideas what might be causing that?
>> >
>> > Cheers,
>> > Gareth
>> >
>> > On Mon, May 23, 2016 at 12:47 PM, Blumentrath, Stefan
>> > <stefan.blumentr...@nina.no> wrote:
>> >>
>> >> Hei,
>> >>
>> >>
>> >>
>> >> Maybe the issue is missing commas?
>> >>
>> >>
>> >>
>> >> r.shade(shade=aspect, color=elevation, output=elevation_aspect_shaded)
>> >>
>> >>
>> >>
>> >> Cheers
>> >>
>> >> Stefan
>> >>
>> >>
>> >>
>> >> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf
>> >> Of
>> >> Gareth Grewcock
>> >> Sent: 23. mai 2016 11:49
>> >> To: grass-user@lists.osgeo.org
>> >> Subject: [GRASS-user] r.shade python issues
>> >>
>> >>
>> >>
>> >> Hi – I’m having issues with r.shade module in grass 7.0.3 when trying
>> >> to
>> >> interact with data via python.
>> >>
>> >>
>> >>
>> >> r.shade runs absolutely fine through the UI, however, when I run the
>> >> syntax through the python console, I get a syntax error.
>> >>
>> >>
>> >>
>> >> I have tried a variety of different datasets and syntax but it keeps
>> >> coming back with the syntax error, I went back to manual for the basics
>> >> but
>> >> I still get the following:
>> >>
>> >>
>> >>
>> >> r.shade shade=aspect color=elevation output=elevation_aspect_shaded
>> >>
>> >>   File "", line 1
>> >>
>> >> r.shade(shade=aspect color=elevation
>> >> output=elevation_aspect_shaded)
>> >>
>> >>  ^
>> >>
>> >> SyntaxError: invalid syntax
>> >>
>> >>
>> >>
>> >> Other modules (r.in.gdal, r.relief, r.slope.aspect, g.region etc) all
>> >> run
>> >> fine through python, I am only having issues with r.shade.
>> >>
>> >>
>> >>
>> >> Does anybody have any idea what might be going wrong?
>> >>
>> >>
>> >>
>> >> Cheers,
>> >>
>> >> Gareth
>> >>
>> >>
>> >
>> >
>> >
>> > ___
>> > grass-user mailing list
>> > grass-user@lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/grass-user
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] How to get a list of maps from a group in python script

2016-04-05 Thread Laurent C.
Hello,

Try the .splitlines() method on the string.

Cheers,
Laurent
El abr. 5, 2016 19:52, "Leonardo Hardtke"  escribió:

> Dear list members,
> I know this is more a python question than a GRASS question, bot for sure
> some of you knows the ansewer and is able to help me
>
> I need to get a python list with the maps from a group, like
> ["map1","map2","map"]
>
> But by using gscript.read_command i get string, not a list.
>
> gscript.read_command("i.group", group=groupname, flags="l" )
> 'group  references the following raster
> maps\n-\n
>  \n
>  \n
>  \n
>  \n
>  \n\n-\n'
>
> Your help is appreciated!
> Leo
> --
> Dr. Leonardo A. Hardtke
> Laboratorio de Teledetección y S.I.G.
> Centro Nacional Patagónico (CONICET)
> Bvd. Brown 2825, 9120
> Puerto Madryn, Chubut, Argentina
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Grass7 GUI does not start

2016-03-25 Thread Laurent C.
Dimitris,

How did you install GRASS ? From the Suse repositories?
What happen if you try to launch the GUI manually with g.gui (possibly
with --v flag)?

Regards,
Laurent

2016-03-18 7:42 GMT-06:00 ddarlac :
> I am a Qgis user, and wanted to do some 3D videos - I read Nviz might be the
> way; I wanted to work on it through Grass (not through the Qgis plugin), and
> grass fails to start.
> the start up window starts fine, I created the location and the mapset -
> when I hit
> 'Start GRASS session', I am getting:
> /Launching  GUI in the background, please wait...
> GRASS 7.0.3 (Manhattan):~ > /
> and nothing happens after that.
>
> My system is opensuse leap, and the grass installation is 7.03;
> wxpython is installed
>
> any help is appreciated
> Dimitris
>
>
>
> --
> View this message in context: 
> http://osgeo-org.1560.x6.nabble.com/Grass7-GUI-does-not-start-tp5257181.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Import point time-series as space-time dataset

2015-09-17 Thread Laurent C.
Hello,

I'm working with files that represent the variation of a value over
time for a single point.
Looks like that:
0   1200
0.03125 1380
0.125   1500
0.3125  1620
0.65625 1740

I need to import them as a raster space-time dataset.
What I'm doing now is using a python script that does that for me.
Is there a way to do that with GRASS modules?

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Archiving GPM 3hr rainrate in GRASS

2015-03-19 Thread Laurent C.
Hi all,

I'm coming back to that subject because the GPM datas are finally available
since December 2014. The original data are stored in HDF5, which is
supported by GDAL.
However, I had a problem with the geo-referencing of the data. It seems
that the lat/long coordinates are flipped.
The problem seems to come from GDAL, as the HDF5 driver still don't support
GPM data:
http://www.gdal.org/frmt_hdf5.html

I've actually downloaded a regional extracts the data in NetCDF from a NASA
website, although I can't remember where exactly, as there are several
services. Those data suffer from the same problem of inverted coordinates.

So I used the ncpdq from NCO package to fix the NetCDF directly, and a tiny
Python script to batch process the files :

###
#!/usr/bin/env python
from os import listdir
import subprocess
for input_file in listdir(main_path):
output_file = input_file + '_fixed'
subprocess.call(['ncpdq','-a', 'lat,lon', input_file, output_file])
###

After batch import the data in GRASS, maintaining the original name
including timestep, which looks like this:
3B-HHR.MS.MRG.3IMERG.20140619-S00-E002959..V03D

A Python script to register the maps in temporal framework:

#
#!/usr/bin/env python
import grass.script as grass

# retrieve the list of maps
maplist = grass.read_command('g.list', type = 'raster',
pattern = '*IMERG*')

# turn result in a list
maplist = maplist.split()

file_name = 'gpm_timestamp.txt'

# creating the file containing the timepstamp
list_file = open(file_name,'w')

# iterate through the maps
for input_map in maplist:
# split line to keep only the timestamp
raw_ts = input_map.split('.')[4]
# isolate the date
raw_mapdate = raw_ts.split('-')[0]
# put the date in form
mapdate = raw_mapdate[:4] + '-' + raw_mapdate[4:6] + \
'-' + raw_mapdate[6:]
# isolate the start time
raw_start_time = raw_ts.split('-')[1]
# put the date in form
start_time = raw_start_time[1:3] + ':' + \
raw_start_time[3:5] + ':' + raw_start_time[5:]
# isolate the end time
raw_end_time = raw_ts.split('-')[2]
# put the end time in form
end_time = raw_end_time[1:3] + ':' + \
raw_end_time[3:5] + ':' + raw_end_time[5:]
# put timestamp in form
timestamp = mapdate + ' ' + start_time + '|' + mapdate + \
' ' + end_time

# format the whole line
line = input_map + '|' + timestamp + '\n'

# write line to the file
list_file.write(line)

# close the file
list_file.close()

# register the maps in grass space_time dataset
grass.run_command('t.register', input = 'GPM_ZMCM', file = file_name)

#


Hope it will help other peoples having trouble using those data.

Regards,
Laurent


2014-11-06 5:15 GMT-06:00 maning sambale emmanuel.samb...@gmail.com:

 Thanks Markus.  Already registered and can access ftp.  Unfortunately,
 processed (L3) rainfall data will be released by Dec 2014.
 Will just wait then. :)

 On Thu, Nov 6, 2014 at 4:27 PM, Markus Neteler nete...@osgeo.org wrote:
  On Mon, Nov 3, 2014 at 10:18 AM, maning sambale
  emmanuel.samb...@gmail.com wrote:
  Has anyone here able to archive and load GPM dataset into GRASS?  I
  was able to get TRMM netcdf in my area of interest before, but I can't
  find the tools to automate GPM downloads.
 
  Thanks!
 
  [0] http://www.nasa.gov/mission_pages/GPM/main/
 
  They state
 
  All data are freely available through the NASA's Precipitation
  Processing System at http://pps.gsfc.nasa.gov;
 
  -- Register and search for GPM and TRMM data, order custom subsets
  and set up subscriptions using PPS Data Products Ordering Interface
  (STORM).
 
  At time the server seems to be down?
 
  Markus



 --
 cheers,
 maning
 --
 Freedom is still the most radical idea of all -N.Branden
 wiki: http://esambale.wikispaces.com/
 blog: http://epsg4253.wordpress.com/
 --
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] pygrass : creation of an area in a vector map

2014-12-09 Thread Laurent C.
Hello all,

I'm trying to write a new area to a new vector map, without success.

If I do the following :
new_boundary = Boundary(points=coordinates)
new_centroid = Point(point_x,point_y)
new_area = Area(boundary = new_boundary, centroid=new_centroid)

new_vect_map.write(new_area)

I get this error:
AttributeError: 'VectorTopo' object has no attribute '_write_area'

But if I write the boundary and centroids independently, the areas are not
properly created, and centroids are just recognized as points, not
centroids.

I should I proceed to have the vector map properly written?

Below is my version of GRASS:
GRASS 7.0.0svn (2014)
libgis Revision: 62395
libgis Date: 2014-10-26 18:17:27 -0600 (dom 26 de oct de 2014)


Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Pygrass vector package: write geometric feature in a specific layer

2014-12-03 Thread Laurent C.
2014-12-03 0:28 GMT-06:00 Pietro peter.z...@gmail.com:

 # you have to set the category for the second layer
 cats = Cats(pump.c_cats)
 cats.reset()
 cats.set(vct.nlines + 1, lpumps.layer)
 # finally write the pump
 vct.write(pump, attrs=pumpattr, set_cats=False)


Hi Pietro,

Thanks for your answer, and for your work on pygrass.
It's the use of Cats that I was missing. However when I tried that :
{{{
cats = Cats(new_conduit.c_cats)
cats.reset()
cats.set(new_vect_map.nlines + 1, lconduit.layer)
new_vect_map.write(new_conduit, attrs=dbline_content, set_cats=False)
}}}

I got the following error :
cats.set(new_vect_map.nlines + 1, lconduit.layer)
AttributeError: 'VectorTopo' object has no attribute 'nlines' 

What 'nlines' is supposed to return?

I worked around by using a int variable incremented at each object. It
worked fine.
Thanks again !

Regards,
Laurent

2014-12-03 0:28 GMT-06:00 Pietro peter.z...@gmail.com:

 Hi Laurent,

 On Tue, Dec 2, 2014 at 4:41 PM, Laurent C. lrn...@gmail.com wrote:
  With pygrass I managed to set DB links and import the attributes in
  different tables.
  But the only way I've found to change the layer of geometric features is
  with .open(mode='w', layer=X). This works well for one layer, but I've to
  write different objects in different layers.
  I tried to close the map and re-open it with another layer, but if I pass
  mode='rw', the map refuse to open because the layer not yet exist, and
 with
  mode='w', it overwrite the existing map.

 I didn't have the need to do this, so far, so probably I should
 rewrite the write method to make it easier.
 The first time that you open the map, you should create links and
 table and save the link between the vector map and these tables, so
 something like (note: this is pseudo-code, not tested! so use it as a
 draft idea):

 {{{
 with VectorTopo('mymap', mode='w', overwrite=True) as vct:
 # create links
 lpipes = Link(layer=1, name='pipes', table=vct.name + 'pipes',
 key='cat')
 lpumps = Link(layer=2, name='pumps', table=vct.name + 'pumps',
 key='cat')

 # add the links to the vector map
 if lpipes not in vct.dblinks:
 vct.dblinks.add(lpipes)
 if lpumps not in vct.dblinks:
 vct.dblinks.add(lpumps)

 # create tables removing them if already created
 tpipes = lpipes.table()
 if tpipes.exist():
 tpipes.drop(force=True)
 tpipes.create([('cat', 'PRIMARY KEY'), ('col1', 'VARCHAR(8)'), etc...])
 tpumps = lpumps.table()
 if tpumps.exist():
 tpumps.drop(force=True)
 tpumps.create([('cat', 'PRIMARY KEY'), ('col1', 'VARCHAR(8)'), etc...])

 # write your pipes
 vct.table = tpipes
 for pipe, pipeattr in zip(pipes, pipesattrs):
 vct.write(pipe, attrs=pipeattr)

 # write the pumps
 vct.table = tpumps
 for pump, pumpattr in zip(pumps, pumpattrs):
 # you have to set the category for the second layer
 cats = Cats(pump.c_cats)
 cats.reset()
 cats.set(vct.nlines + 1, lpumps.layer)
 # finally write the pump
 vct.write(pump, attrs=pumpattr, set_cats=False)

 }}}

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Pygrass vector package: write geometric feature in a specific layer

2014-12-02 Thread Laurent C.
Hello all,

I'm writing a GRASS module with pygrass to import data from a text file
into a new vector map.
Those data have topological relationships: they are nodes and links of a
sewer network. But those objects may have different types of attributes.
For example a link could be a pipe or a pump.
Therefore I think that the use of vector layers is the right way to store
those data.

With pygrass I managed to set DB links and import the attributes in
different tables.
But the only way I've found to change the layer of geometric features is
with .open(mode='w', layer=X). This works well for one layer, but I've to
write different objects in different layers.
I tried to close the map and re-open it with another layer, but if I pass
mode='rw', the map refuse to open because the layer not yet exist, and with
mode='w', it overwrite the existing map.

I know there is a way to create a new map for each layer and then use
existing GRASS modules to merge them into a single map, but I feel that
this is overly complex.

So my question is: Is there a way to decide which layer to write new
objects, and change this layer during the import process?

I'm using grass70-svn with the following version of libgis:
libgis Revision: 62395
libgis Date: 2014-10-26 18:17:27

Thanks for you help.

Regards,
Laurent
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user