Re: [GRASS-user] Some questions about DEMs
Maciek wrote: > For heterogenous input data I'd try the nn algorithm in > nnbathy, through r.surf.nnbathy > (http://grass.osgeo.org/wiki/Addons#r.surf.nnbathy). It is great for sparse points, but for contour lines + hydrological modeling it is not the best. See nn valley staircase effect in http://grass.osgeo.org/wiki/Contour_lines_to_DEM regards, Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Re: v.rast.stats
> These are my data sets attached: > > 1. Dem_CF.tif is the DEM > 2. TRMMLast1day.tif is the rainfall data > > On Fri, Jul 9, 2010 at 2:53 PM, Sandile Gumede > wrote: > >> Is there any one who can help me? I'm away this week, so I can only add a quick response: I still see two "glaring" problems in your technique. 1- You mentioned that you try to "sort out the resolution" between the two data sources. One source, the rainfall data, is a raster of 27 km. pixel size, while the other, the DEM is 90 m. pixel size. I don't believe that you can resolve this gap. You can not compare data with such a gap in resolution. The only thing possible with rainfall data at that resolution is *continent scale* maps. You can get the gtopo30 DEM (1 km. resolution, I think) for all of Africa for example, and compare that with rainfall data for all of Africa. 2- When you get to the step of watershed creation, you seem to be using illogical threshold values. Below you set threshold=1. That means every single cell in the dem will become a basin! That's certainly *not* what you want. Typical threshold values will be in the 1000's, even 10's of thousands. -- Micha >> >> >> On Wed, Jul 7, 2010 at 3:15 PM, Sandile Gumede >> wrote: >> >>> Hi, >>> >>> I've tried to sort out the issue of the region resolution. Now when I'm >>> running v.rast.stats it says: >>> >>> ERROR: No categories found in raster map >>> >>> Here is the script I'm running thats giving me that error: >>> >>> #!/bin/sh >>> >>> #variable to customize: >>> # path to GRASS software main directory >>> GISBASE=/usr/lib/grass64 >>> # path to GRASS database >>> GISDBASE=$HOME/grassdata/Cape_Town >>> >>> LOCATION_NAME=SRTMDEM >>> MAPSET=PERMANENT >>> >>> # nothing to change below >>> MAP=$1 >>> LOCATION=$2 >>> >>> >>> # generate temporal LOCATION: >>> TEMPDIR=FLOODS >>> mkdir -p $GISDBASE/$LOCATION_NAME/$MAPSET >>> >>> # save existing $HOME/.grassrc6 >>> if test -e $HOME/.grassrc6 ; then >>> mv $HOME/.grassrc6 /tmp/$TEMPDIR.grassrc6 >>> fi >>> >>> echo "LOCATION_NAME: $LOCATION_NAME" > $HOME/.grassrc6 >>> echo "MAPSET:$MAPSET">> $HOME/.grassrc6 >>> echo "DIGITIZER: none" >> $HOME/.grassrc6 >>> echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6 >>> export GISBASE=$GISBASE >>> >>> # Create a WIND file with minimal information and no projection: >>> echo "proj: 3 >>> zone: 0 >>> north: 1 >>> south: 0 >>> east: 1 >>> west: 0 >>> cols: 1 >>> rows: 1 >>> e-w resol: 1 >>> n-s resol: 1 >>> top:1 >>> bottom: 0 >>> cols3: 1 >>> rows3: 1 >>> depths: 1 >>> e-w resol3: 1 >>> n-s resol3: 1 >>> t-b resol: 1 >>> " > $GISDBASE/$LOCATION_NAME/$MAPSET/WIND >>> >>> # Copy WIND-file to DEFAULT_WIND: >>> cp $GISDBASE/$LOCATION_NAME/$MAPSET/WIND \ >>> $GISDBASE/$LOCATION_NAME/$MAPSET/DEFAULT_WIND >>> >>> >>> echo "name: Latitude-Longitude >>> datum: wgs84 >>> towgs84: 0.000,0.000,0.000 >>> proj:ll >>> ellps: wgs84 >>> "> $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_INFO >>> >>> echo "unit: degree >>> ubits: degrees >>> meters: 1.0 >>> "> $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_UNITS >>> >>> >>> >>> export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH >>> export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH >>> export GIS_LOCK=$$ >>> export GISRC=$HOME/.grassrc6 >>> >>> >>> # this should print GRASS version used: >>> g.version >>> # other calculations go here >>> >>> # import rainfall data set. >>> cd /home/tgumede1/grassdata/Cape_Town >>> >>> >>> # rainfall data set. >>> r.in.gdal input=$HOME/grassdata/Cape_Town/TRMMLast1day.tif >>> output=rainfall >>> >>> >>> # DEM data set. >>> r.in.gdal input=$HOME/grassdata/Cape_Town/Dem_CF.tif target=SRTMDEM >>> output=dem >>> g.region rast=dem -p >>> >>> # creating set of maps indicating flow acc, drainage dir, streams >>> r.watershed --o elevation=...@permanent drainage=flow_direction >>> basin=catch accumulation=acc threshold=1 memory=300 stream=str >>> >>> # convert catch raster to polygon vector >>> r.to.vect in=ca...@permanent out=catchments feature=area >>> >>> g.region rast=rainfall -p >>> >>> # Calculate univariate statistics >>> v.rast.stats -c vector=catchme...@permanent >>> raster=rainf...@permanentcolpre=precp >>> >>> >>> >>> On Wed, Jul 7, 2010 at 9:18 AM, Sandile Gumede >>> wrote: >>> Hi Which module do I use to change the resolutions? 2010/7/6 > Hello Sandile: > It seems you are importing two raster with vastly different > resolutions. > (I think we already came across this). See below... > > > Hi > > > > Below is a step-by-step of what I have done but I'm getting an > error > when > > running v.rast.stats vector=catchments raster=rainfall layer=1 > > colprefix=area. > > > > > > GRASS 6.4.0RC5+39438 (SRTMDEM):~ > r.in.gdal > > in=/home/tgumede1/grassdata/Cape_Town/TRMMLast1day.tif out=ra
Re: [GRASS-user] Some questions about DEMs
W dniu 09.07.2010 12:29, David Townshend pisze: I have a couple of questions about DEMs, and how they work in GRASS. My application is hydrological and hydraulic analysis, and at the moment I'm investigating using r.sim.water to generate floodlines. Usually, for this sort of analysis, I would have 5m contours for the catchment and a detailed survey (i.e. spot heights, sometimes with triangles) for sections of river. So my first question is, what is the best way to generate a DEM from this information? I know that I can use r.surf.contour to create a DEM from the contours, and I'd assume that something like v.surf.rst would be best for the points, but I need a single DEM for the analysis. For heterogenous input data I'd try the nn algorithm in nnbathy, through r.surf.nnbathy (http://grass.osgeo.org/wiki/Addons#r.surf.nnbathy). The second problem is that I don't need a highly detailed DEM for the catchment, I only need detail along the watercourses - i.e. where I have the detailed survey. If I create two DEMs at different resolutions, can I patch them without losing detail? You can patch 2 rasters of different resolution, but not to loose information, the output raster map needs to be of the resolution of the more detailed input raster map. This will result in a flat squares + smooth valleys surface. My third question is about creating a mask. If I'm working along the coast, or if I'm creating a detailed DEM along the watercourse, I only want raster data where there is base data (i.e. contours or points). Is there a way to quickly generate a mask for this? v.hull + v.to.rast? Maciek -- Maciej Sieczka http://www.sieczka.org ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.in.gpsbabel-3
Thanks for all the replies. It seems that I forgot to specify the format ( _txt) in the Required tab. So, it fixed the problem and now I can import all the waypoints and tracks. However, I am puzzled with one detail. As I mentioned: - I set my GPS unit to record measurements in UTM, - the text file prepared by GPS Babel has header showing UTM as projection, - even if I specify the projection parameter according to PROJ.4 in the Required tab of the module, the attribute tables for the resultant waypoint and track vector files are in lat/long format. How can this happen? I never work with lat/long. BÜLENT ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] ECW format and gdalwarp problem...
Le 09/07/10 17:36, Giovanni Manghi a écrit : > >> again ;-) >> in root a make >> apt-get update && apt-get install libgdal-ecw-src >> >> an erreur >> E: Impossible de trouver le paquet libgdal-ecw-src >> >> ... so I dont know >> >> see you :-) >> > > did you added the ubuntugis-unstable ppa repository? > > I believe the package is part of that particular repository. > > cheers > > -- G -- > > I believed but no... So now I have make apt-get update && apt-get install libgdal-ecw-src and it's ok But I'm a linux noobie, so what can I make now? :-) see you again ;-) -- Cordialement Etienne DELAY Deust "Webmaster et gest. d'intranet" (IDSkype : etienne.delay.tic) Master IUP "valorisation du patrimoine et aménagement du territoire" ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] v.in.gpsbabel-2
Bulent wrote: > I am back with another issue, again ' v.in.gpsbabel' module! > My GPS unit records data in UTM projection with WGS84 datum. I > just attempted to import the waypoints into GRASS using a > Garmin MapSource text (tab delimited) file. $ gpsbabel --help | grep -i garmin garmin301 Garmin 301 Custom position and heartrate glogbook Garmin Logbook XML gdb Garmin MapSource - gdb mapsource Garmin MapSource - mps garmin_txtGarmin MapSource - txt (tab delimited) pcx Garmin PCX5 garmin_poiGarmin POI database garminGarmin serial/USB protocol gtrnctr Garmin Training Centerxml try the "garmin_txt" format. also if it is just tab delimited you can use v.in.ascii with the appropriate number of skip lines and column numbers. that's a lot more robust than the gpsbabel method. > I did not check -k flag (do not transform from WGS84). that means lat/lon wgs84 by the way, not just the wgs84 datum. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] ECW format and gdalwarp problem...
> again ;-) > in root a make > apt-get update && apt-get install libgdal-ecw-src > > an erreur > E: Impossible de trouver le paquet libgdal-ecw-src > > ... so I dont know > > see you :-) did you added the ubuntugis-unstable ppa repository? I believe the package is part of that particular repository. cheers -- G -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] ECW format and gdalwarp problem...
Le 09/07/10 16:26, Giovanni Manghi a écrit : > >> I just tested the procedure, and the package gdal-ecw-src is not >> found ... >> > > the library is called > > libgdal-ecw-src > > > > cheers > > -- Giovanni -- > > again ;-) in root a make apt-get update && apt-get install libgdal-ecw-src an erreur E: Impossible de trouver le paquet libgdal-ecw-src ... so I dont know see you :-) -- Cordialement Etienne DELAY Deust "Webmaster et gest. d'intranet" (IDSkype : etienne.delay.tic) Master IUP "valorisation du patrimoine et aménagement du territoire" ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Channel Sinuosity Implemented in GRASS?
output: Gradient Sinuosity stream reach length down valley distance This is a thought- and I have no idea how to implement it. I would like to calculate thalweg distance of a stream. from the start point (user input) search xmeters to the east and west find the minimum - move one grid cell south and search x meters east and west find the minimum. find the elevation difference between point 1 and 2. then use the Pythagorean theorem to calculate the distance. Iterate to the termination point (user input). add all of the lengths up. calculate the distance between the start and end, elevation difference. You would then get slope (gradient) of the stream segment, total thalweg distance, and total distance down the valley. total thalweg distance/total distance down the valley is sinuosity. Is this possible? Is there a way to only search within the stream segment generated by r.watershed or r.stream extract or... I will help in any way that I can- I just don't know how to do this. kindest regards, Stephen On Fri, Jul 9, 2010 at 9:59 AM, Mark Seibel wrote: > I came across this when looking previously at v.to.db. I noticed there > is an option to upload line sinuosity. I haven't tried it, but I'd be > curious to know if it solves your problem. > > Using "option = sinuous" ? > > http://grass.itc.it/grass64/manuals/html64_user/v.to.db.html > > Mark > > On Fri, Jul 9, 2010 at 10:24 AM, stephen sefick wrote: >> All: >> I would like to calculate channel sinuosity on many streams that I >> have an upstream and downstream GPS point. Is there such a module in >> GRASS? I am trying to avoid doing this by hand. >> kindest regards, >> >> -- >> Stephen Sefick >> >> | Auburn University | >> | Department of Biological Sciences | >> | 331 Funchess Hall | >> | Auburn, Alabama | >> | 36849 | >> |___| >> | sas0...@auburn.edu | >> | http://www.auburn.edu/~sas0025 | >> |___| >> >> Let's not spend our time and resources thinking about things that are >> so little or so large that all they really do for us is puff us up and >> make us feel like gods. We are mammals, and have not exhausted the >> annoying little problems of being mammals. >> >> -K. Mullis >> ___ >> grass-user mailing list >> grass-user@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/grass-user >> > -- Stephen Sefick | Auburn University | | Department of Biological Sciences | | 331 Funchess Hall | | Auburn, Alabama | | 36849| |___| | sas0...@auburn.edu | | http://www.auburn.edu/~sas0025 | |___| Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Channel Sinuosity Implemented in GRASS?
I came across this when looking previously at v.to.db. I noticed there is an option to upload line sinuosity. I haven't tried it, but I'd be curious to know if it solves your problem. Using "option = sinuous" ? http://grass.itc.it/grass64/manuals/html64_user/v.to.db.html Mark On Fri, Jul 9, 2010 at 10:24 AM, stephen sefick wrote: > All: > I would like to calculate channel sinuosity on many streams that I > have an upstream and downstream GPS point. Is there such a module in > GRASS? I am trying to avoid doing this by hand. > kindest regards, > > -- > Stephen Sefick > > | Auburn University | > | Department of Biological Sciences | > | 331 Funchess Hall | > | Auburn, Alabama | > | 36849 | > |___| > | sas0...@auburn.edu | > | http://www.auburn.edu/~sas0025 | > |___| > > Let's not spend our time and resources thinking about things that are > so little or so large that all they really do for us is puff us up and > make us feel like gods. We are mammals, and have not exhausted the > annoying little problems of being mammals. > > -K. Mullis > ___ > 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] Channel Sinuosity Implemented in GRASS?
All: I would like to calculate channel sinuosity on many streams that I have an upstream and downstream GPS point. Is there such a module in GRASS? I am trying to avoid doing this by hand. kindest regards, -- Stephen Sefick | Auburn University | | Department of Biological Sciences | | 331 Funchess Hall | | Auburn, Alabama | | 36849| |___| | sas0...@auburn.edu | | http://www.auburn.edu/~sas0025 | |___| Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] v.in.gpsbabel-2
Bulent Arikan wrote: > Hi, > > Hamish, thanks for your suggestion about fixing the GPS Babel application > issue. It worked and now I can run the module. > > I am back with another issue, again ' v.in.gpsbabel' module! My GPS unit > records data in UTM projection with WGS84 datum. I just attempted to import > the waypoints into GRASS using a Garmin MapSource text (tab delimited) file. Did you specify the corresponding format=garmin_txt? See [1] for format details HTH, Markus M [1] http://www.gpsbabel.org/capabilities.html > I did not check -k flag (do not transform from WGS84). I kept the format box > in the Required tab in default and provided PROJ.4 parameter for UTM > > [ +proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ] in the > Proj box of the Required tab, since this module assumes lat/long projection > with WGS84 datum. > > Here are the error messages I receive: > > Loading Waypoints from ... > > [ERROR] SERIAL: tcgetattr error: Inappropriate ioctl for > > device > > [ERROR] Cannot open serial port '/Users/barikan2/Grmn.txt' > > GARMIN:Can't init /Users/barikan2/Grmn.txt > > /Users/barikan2/Desktop/GRASS-6.5.app/Contents/MacOS/scripts > > /v.in.gpsbabel: line 263: > > /Users/barikan2/grassdata/TR_WGS84_36N/PERMANENT/.tmp > > /Bulent-Arikans-iMac.local/1470.0.xcsv: No such file or > > directory > > /Users/barikan2/Desktop/GRASS-6.5.app/Contents/MacOS/scripts > > /v.in.gpsbabel: line 263: [: : integer expression expected > > ERROR: Error loading data from gpsbabel > > I used few other Garmin file formats such as Garmin Points of Interest > (.gpi) and Garmin MapSource (.mps) and the result does not change. I assume > I am doing something wrong with the Projection detail! > > I will appreciate suggestions/advice. > Thanks, > -- > BÜLENT > > ___ > 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] ECW format and gdalwarp problem...
> I just tested the procedure, and the package gdal-ecw-src is not > found ... the library is called libgdal-ecw-src cheers -- Giovanni -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] ECW format and gdalwarp problem...
Le 09/07/10 12:35, Giovanni Manghi a écrit : > Hi, > > > >> 1 / I'm on Ubuntu 10 and Grass6.4 since two days and I try to open the >> training ECW orthophotos with GRASS. Does someone could give me the >> procedure >> > have a look here > > http://trac.osgeo.org/ubuntugis/wiki/UserTutorials > > > > cheers > > -- Giovanni -- > > hello I just tested the procedure, and the package gdal-ecw-src is not found ... thank you -- Cordialement Etienne DELAY Deust "Webmaster et gest. d'intranet" (IDSkype : etienne.delay.tic) Master IUP "valorisation du patrimoine et aménagement du territoire" ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.in.gpsbabel-2
Hi, Hamish, thanks for your suggestion about fixing the GPS Babel application issue. It worked and now I can run the module. I am back with another issue, again ' v.in.gpsbabel' module! My GPS unit records data in UTM projection with WGS84 datum. I just attempted to import the waypoints into GRASS using a Garmin MapSource text (tab delimited) file. I did not check -k flag (do not transform from WGS84). I kept the format box in the Required tab in default and provided PROJ.4 parameter for UTM [ +proj=utm +zone=36 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ] in the Proj box of the Required tab, since this module assumes lat/long projection with WGS84 datum. Here are the error messages I receive: Loading Waypoints from ... [ERROR] SERIAL: tcgetattr error: Inappropriate ioctl for device [ERROR] Cannot open serial port '/Users/barikan2/Grmn.txt' GARMIN:Can't init /Users/barikan2/Grmn.txt /Users/barikan2/Desktop/GRASS-6.5.app/Contents/MacOS/scripts /v.in.gpsbabel: line 263: /Users/barikan2/grassdata/TR_WGS84_36N/PERMANENT/.tmp /Bulent-Arikans-iMac.local/1470.0.xcsv: No such file or directory /Users/barikan2/Desktop/GRASS-6.5.app/Contents/MacOS/scripts /v.in.gpsbabel: line 263: [: : integer expression expected ERROR: Error loading data from gpsbabel I used few other Garmin file formats such as Garmin Points of Interest (.gpi) and Garmin MapSource (.mps) and the result does not change. I assume I am doing something wrong with the Projection detail! I will appreciate suggestions/advice. Thanks, -- BÜLENT ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.rast.stats
Is there any one who can help me? On Wed, Jul 7, 2010 at 3:15 PM, Sandile Gumede wrote: > Hi, > > I've tried to sort out the issue of the region resolution. Now when I'm > running v.rast.stats it says: > > ERROR: No categories found in raster map > > Here is the script I'm running thats giving me that error: > > #!/bin/sh > > #variable to customize: > # path to GRASS software main directory > GISBASE=/usr/lib/grass64 > # path to GRASS database > GISDBASE=$HOME/grassdata/Cape_Town > > LOCATION_NAME=SRTMDEM > MAPSET=PERMANENT > > # nothing to change below > MAP=$1 > LOCATION=$2 > > > # generate temporal LOCATION: > TEMPDIR=FLOODS > mkdir -p $GISDBASE/$LOCATION_NAME/$MAPSET > > # save existing $HOME/.grassrc6 > if test -e $HOME/.grassrc6 ; then > mv $HOME/.grassrc6 /tmp/$TEMPDIR.grassrc6 > fi > > echo "LOCATION_NAME: $LOCATION_NAME" > $HOME/.grassrc6 > echo "MAPSET:$MAPSET">> $HOME/.grassrc6 > echo "DIGITIZER: none" >> $HOME/.grassrc6 > echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6 > export GISBASE=$GISBASE > > # Create a WIND file with minimal information and no projection: > echo "proj: 3 > zone: 0 > north: 1 > south: 0 > east: 1 > west: 0 > cols: 1 > rows: 1 > e-w resol: 1 > n-s resol: 1 > top:1 > bottom: 0 > cols3: 1 > rows3: 1 > depths: 1 > e-w resol3: 1 > n-s resol3: 1 > t-b resol: 1 > " > $GISDBASE/$LOCATION_NAME/$MAPSET/WIND > > # Copy WIND-file to DEFAULT_WIND: > cp $GISDBASE/$LOCATION_NAME/$MAPSET/WIND \ > $GISDBASE/$LOCATION_NAME/$MAPSET/DEFAULT_WIND > > > echo "name: Latitude-Longitude > datum: wgs84 > towgs84: 0.000,0.000,0.000 > proj:ll > ellps: wgs84 > "> $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_INFO > > echo "unit: degree > ubits: degrees > meters: 1.0 > "> $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_UNITS > > > > export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH > export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH > export GIS_LOCK=$$ > export GISRC=$HOME/.grassrc6 > > > # this should print GRASS version used: > g.version > # other calculations go here > > # import rainfall data set. > cd /home/tgumede1/grassdata/Cape_Town > > > # rainfall data set. > r.in.gdal input=$HOME/grassdata/Cape_Town/TRMMLast1day.tif output=rainfall > > > # DEM data set. > r.in.gdal input=$HOME/grassdata/Cape_Town/Dem_CF.tif target=SRTMDEM > output=dem > g.region rast=dem -p > > # creating set of maps indicating flow acc, drainage dir, streams > r.watershed --o elevation=...@permanent drainage=flow_direction > basin=catch accumulation=acc threshold=1 memory=300 stream=str > > # convert catch raster to polygon vector > r.to.vect in=ca...@permanent out=catchments feature=area > > g.region rast=rainfall -p > > # Calculate univariate statistics > v.rast.stats -c vector=catchme...@permanent > raster=rainf...@permanentcolpre=precp > > > > On Wed, Jul 7, 2010 at 9:18 AM, Sandile Gumede wrote: > >> Hi >> >> Which module do I use to change the resolutions? >> >> >> 2010/7/6 >> >>> Hello Sandile: >>> It seems you are importing two raster with vastly different resolutions. >>> (I think we already came across this). See below... >>> >>> > Hi >>> > >>> > Below is a step-by-step of what I have done but I'm getting an error >>> when >>> > running v.rast.stats vector=catchments raster=rainfall layer=1 >>> > colprefix=area. >>> > >>> > >>> > GRASS 6.4.0RC5+39438 (SRTMDEM):~ > r.in.gdal >>> > in=/home/tgumede1/grassdata/Cape_Town/TRMMLast1day.tif out=rainfall >>> > >>> > Projection of input dataset and current location appear to match >>> > 100% >>> > r.in.gdal complete. Raster map created. >>> > GRASS 6.4.0RC5+39438 (SRTMDEM):~ > g.region rast=rainfall -p >>> > projection: 3 (Latitude-Longitude) >>> > zone: 0 >>> > datum: wgs84 >>> > ellipsoid: wgs84 >>> > north: 33:30S >>> > south: 33:45S >>> > west: 18:15E >>> > east: 19E >>> > nsres: 0:15 >>> > ewres: 0:15 >>> > rows: 1 >>> > cols: 3 >>> > cells: 3 >>> >>> Here, the rainfall data has a resolution of 0:15 = 15 minutes or 1/4 >>> degree. THat's approximately (at the equator) about 27 km. So *one* >>> raster >>> cell is 27 km X 27 km =~ 730 sq.km. Your region is covered by 3 cells, 1 >>> row by 3 columns. Not very helpful data! >>> >>> Next... >>> >>> > GRASS 6.4.0RC5+39438 (SRTMDEM):~ > r.in.gdal >>> > in=/home/tgumede1/grassdata/Cape_Town/Dem_CF.tif out=dem target=SRTMDEM >>> > >>> > >>> > Projection of input dataset and current location appear to match >>> > 100% >>> > r.in.gdal complete. Raster map created. >>> > GRASS 6.4.0RC5+39438 (SRTMDEM):~ > g.region rast=dem -p >>> > projection: 3 (Latitude-Longitude) >>> > zone: 0 >>> > datum: wgs84 >>> > ellipsoid: wgs84 >>> > north: 33:40:46.499215S >>> > south: 34:00:52.499215S >>> > west: 18:17:55.500436E >>> > east: 19:10:16.500436E >>> > nsres: 0:00:03 >>> > ewres:
Re: [GRASS-user] convert to utm projection
I was not aware of the -p and -g flags Nicer and nicer every time On Thu, Jul 8, 2010 at 9:43 PM, Hamish wrote: > Daniel wrote: >> Complementing Varun response, take a look at the r.proj manual page >> http://grass.ibiblio.org/grass65/manuals/html65_user/r.proj.html >> >> Specially the Notes part, were it explains about the v.in.region trick >> in order to set the region extent and resolution correctly > > fyi in grass 6.5 and newer there is also the r.proj -p and -g flags which > make the v.in.region trick not really needed any more. > > > Hamish > > > > > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Some questions about DEMs
On Fri, Jul 9, 2010 at 12:50 PM, Hamish wrote: > > David wrote: > > I have a couple of questions about DEMs, and how they work in GRASS. > > My application is hydrological and hydraulic analysis, and at the moment > > I'm investigating using r.sim.water to generate floodlines. > > > > Usually, for this sort of analysis, I would have 5m contours for the > > catchment and a detailed survey (i.e. spot heights, sometimes with > > triangles) for sections of river. So my first question is, what is the > > best way to generate a DEM from this information? > > take your pick: > http://grass.osgeo.org/wiki/Contour_lines_to_DEM > > > I know that I can use r.surf.contour to create a DEM from the contours, > > and I'd assume that something like v.surf.rst would be best for the > > points, but I need a single DEM for the analysis. > > you will see in the r.surf.contour help page that adding points is well > recommended. Use v.to.rast then r.patch to combine them with the rasterized > contour lines. (make sure points get priority) > > > The second problem is that I don't need a highly detailed DEM for the > > catchment, I only need detail along the watercourses - i.e. where I have > > the detailed survey. If I create two DEMs at different resolutions, can > > I patch them without losing detail? > > sure. I believe that Helena has an example of that in her & Markus's GRASS > book. Data is resampled to the current resolution on-the-fly though, so > it really doesn't cost you too much to just make the original data source > hi-res everywhere. > > > My third question is about creating a mask. If I'm working along the > > coast, or if I'm creating a detailed DEM along the watercourse, I only > > want raster data where there is base data (i.e. contours or points). Is > > there a way to quickly generate a mask for this? > > see the r.mask module. or use r.mapcalc to create a MASK map where > elevation > 0. (the MASK map has value in areas to show, and is 0 or > NULL in areas to hide; and is only applied when reading raster data from > disk). If you have a vector polygon of the area/coastline it's easy to > do 'v.to.rast output=MASK'. > > > Hamish > Thanks for the reply. I don't entirely understand what you mean by on-the-fly resampling. Surely the raster needs to be created at a high resolution to start with, which means quite a lot of processing? I'm considering areas of several hundred square kilometers at less than 5m res. Would the best approach, then, be to patch the contours and points, and create a single hi-res raster? I understand how to create the mask from a polygon, the problem is that I don't have the area or coastline. What I'd like to do is to automatically generate a polygon covering, for example, all the contours, but without extending far past them. David ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] v.in.gpsbabel
Bulent Arikan wrote: > I am running 6.5 svn on Snow Leopard. I am trying to import > points and tracks from a Garmin device (connected via USB). > Using GPS Babel (v 1.4.1 for Mac), I prepared several files > (.txt, .gdb, and .gpi) and tried to import these using > v.in.gpsbabel (UTM wgs84 location) –k flag checked–. I am > getting this error message: > > ERROR: The gpsbabel program was not found, please install it > first.http://gpsbabel.sourceforge.net > As silly as it sounds, I am not sure if GPS Babel needs > installing. After the download, a disk image appeared and double > clicking launched the program (i.e., the window that retrieves > data from the device and writes files). I did not install > anything because it launched and it seems to be working (i.e., > it writes files). I may be skipping some steps, so I will > appreciate any suggestions. the program needs to be in the system's search PATH in order for GRASS to be able to find it. Open a Terminal and type "echo $PATH" to see what that is. You might try to copy the 'gpsbabel' executable into /usr/local/bin/ and see if it finds it then. If you can type "gpsbabel" at a Terminal and have it produce its help message / list of options, you're in business. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Some questions about DEMs
David wrote: > I have a couple of questions about DEMs, and how they work in GRASS. > My application is hydrological and hydraulic analysis, and at the moment > I'm investigating using r.sim.water to generate floodlines. > > Usually, for this sort of analysis, I would have 5m contours for the > catchment and a detailed survey (i.e. spot heights, sometimes with > triangles) for sections of river. So my first question is, what is the > best way to generate a DEM from this information? take your pick: http://grass.osgeo.org/wiki/Contour_lines_to_DEM > I know that I can use r.surf.contour to create a DEM from the contours, > and I'd assume that something like v.surf.rst would be best for the > points, but I need a single DEM for the analysis. you will see in the r.surf.contour help page that adding points is well recommended. Use v.to.rast then r.patch to combine them with the rasterized contour lines. (make sure points get priority) > The second problem is that I don't need a highly detailed DEM for the > catchment, I only need detail along the watercourses - i.e. where I have > the detailed survey. If I create two DEMs at different resolutions, can > I patch them without losing detail? sure. I believe that Helena has an example of that in her & Markus's GRASS book. Data is resampled to the current resolution on-the-fly though, so it really doesn't cost you too much to just make the original data source hi-res everywhere. > My third question is about creating a mask. If I'm working along the > coast, or if I'm creating a detailed DEM along the watercourse, I only > want raster data where there is base data (i.e. contours or points). Is > there a way to quickly generate a mask for this? see the r.mask module. or use r.mapcalc to create a MASK map where elevation > 0. (the MASK map has value in areas to show, and is 0 or NULL in areas to hide; and is only applied when reading raster data from disk). If you have a vector polygon of the area/coastline it's easy to do 'v.to.rast output=MASK'. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] ECW format and gdalwarp problem...
Hi, > 1 / I'm on Ubuntu 10 and Grass6.4 since two days and I try to open the > training ECW orthophotos with GRASS. Does someone could give me the > procedure have a look here http://trac.osgeo.org/ubuntugis/wiki/UserTutorials cheers -- Giovanni -- ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Some questions about DEMs
Hi I have a couple of questions about DEMs, and how they work in GRASS. My application is hydrological and hydraulic analysis, and at the moment I'm investigating using r.sim.water to generate floodlines. Usually, for this sort of analysis, I would have 5m contours for the catchment and a detailed survey (i.e. spot heights, sometimes with triangles) for sections of river. So my first question is, what is the best way to generate a DEM from this information? I know that I can use r.surf.contour to create a DEM from the contours, and I'd assume that something like v.surf.rst would be best for the points, but I need a single DEM for the analysis. The second problem is that I don't need a highly detailed DEM for the catchment, I only need detail along the watercourses - i.e. where I have the detailed survey. If I create two DEMs at different resolutions, can I patch them without losing detail? My third question is about creating a mask. If I'm working along the coast, or if I'm creating a detailed DEM along the watercourse, I only want raster data where there is base data (i.e. contours or points). Is there a way to quickly generate a mask for this? Regards David ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] ECW format and gdalwarp problem...
Hello I'm still a neophyte in GRASS. And I have two questions: 1 / I'm on Ubuntu 10 and Grass6.4 since two days and I try to open the training ECW orthophotos with GRASS. Does someone could give me the procedure thank you ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.in.gpsbabel
Hi, I am running 6.5 svn on Snow Leopard. I am trying to import points and tracks from a Garmin device (connected via USB). Using GPS Babel (v 1.4.1 for Mac), I prepared several files (.txt, .gdb, and .gpi) and tried to import these using v.in.gpsbabel (UTM wgs84 location) –k flag checked–. I am getting this error message: ERROR: The gpsbabel program was not found, please install it first. http://gpsbabel.sourceforge.net As silly as it sounds, I am not sure if GPS Babel needs installing. After the download, a disk image appeared and double clicking launched the program (i.e., the window that retrieves data from the device and writes files). I did not install anything because it launched and it seems to be working (i.e., it writes files). I may be skipping some steps, so I will appreciate any suggestions. Thanks, -- BÜLENT ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.rast.stats
Hello Micha, Can you please put all the steps including the steps for the DEM because I tried to duplicate your steps and when I get to the step of v.rast.stats, I get an error saying No categories found in raster map. I tried even to match region resolutions of the two raster maps with g.region rast=rainfall res=0:00:03 here is a step-by-step: r.in.gdal input=$HOME/grassdata/Cape_Town/Dem_CF.tif output=dem g.region rast=dem -p Projection of input dataset and current location appear to match 100% r.in.gdal complete. Raster map created. projection: 3 (Latitude-Longitude) zone: 0 datum: wgs84 ellipsoid: wgs84 north: 33:40:46.499215S south: 34:00:52.499215S west: 18:17:55.500436E east: 19:10:16.500436E nsres: 0:00:03 ewres: 0:00:03 rows: 402 cols: 1047 cells: 420894 r.watershed --o elevation=...@permanent drainage=flow_direction basin=catch accumulation=acc threshold=1 memory=300 stream=str SECTION 1a (of 5): Initiating Memory. SECTION 1b (of 5): Determining Offmap Flow. 100% SECTION 2: A * Search. 100% SECTION 3: Accumulating Surface Flow. 100% SECTION 4: Watershed determination. 100% SECTION 5: Closing Maps. WARNING: Default driver / database set to: driver: dbf database: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/ Extracting areas... 100% 100% r.to.vect in=catch out=catchments feature=area Building topology for vector map ... Registering primitives... 1259867 primitives registered 2100907 vertices registered Building areas... 100% 418835 areas built 1 isles built Attaching islands... 100% Attaching centroids... 100% Number of nodes: 841033 Number of primitives: 1259867 Number of points: 0 Number of lines: 0 Number of boundaries: 841032 Number of centroids: 418835 Number of areas: 418835 Number of isles: 1 r.to.vect complete. r.in.gdal input=$HOME/grassdata/Cape_Town/TRMMLast1day.tif target=SRTMDEM output=rainfall Projection of input dataset and current location appear to match 100% r.in.gdal complete. Raster map created. 100% g.region rast=rainfall res=0:00:03 r.univar rainfall total null and non-null cells: 27 total null cells: 0 Of the non-null cells: -- n: 27 minimum: 0 maximum: 232 range: 232 mean: 109.667 mean of absolute values: 109.667 standard deviation: 95.1362 variance: 9050.89 variation coefficient: 86.7503 % sum: 2961 v.rast.stats vector=catchments raster=rainfall colpre=precp ERROR: No categories found in raster map On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver wrote: > Hello Sandile: > I tried to duplicate your steps and it seems to work for me. > Here's what I did: > > > wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif > wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw > > gdalinfo 3B42RT.2010032900.1day.tif > Driver: GTiff/GeoTIFF > Files: 3B42RT.2010032900.1day.tif >3B42RT.2010032900.1day.tfw > Size is 1440, 480 > Coordinate System is `' > Origin = (-180.000,60.000) > Pixel Size = (0.250,-0.250) > > > Note: no projection info above > > Now I use the -projwin option of gdal_translate to select a small > window > gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 > 3B42RT.2010032900.1day.tif rainfall_il.tif > > GEOGCS entry now shows 4326 > > g.mapset map=ASTER_DEM loc=WGS84 > - A location setup as EPSG:4326 > > r.in.gdal israel.tif out=rainfall_il > > r.univar rainfall_il > 100% > total null and non-null cells: 7776 > > total null cells: 0 > > Of the non-null cells: > -- > n: 7776 > minimum: 0 > maximum: 34 > range: 34 > mean: 0.364583 > mean of absolute values: 0.364583 > standard deviation: 3.45241 > variance: 11.9192 > variation coefficient: 946.948 % > sum: 2835 > > > - Now using an existing catchment vector map > v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip > v.info -c arava_wsheds > Displaying column types/names for database connection of layer 1: > INTEGER|cat > CHARACTER|label > DOUBLE PRECISION|area_km > INTEGER|precip_n > DOUBLE PRECISION|precip_min > DOUBLE PRECISION|precip_max > DOUBLE PRECISION|precip_range > DOUBLE PRECISION|precip_mean > DOUBLE PRECISION|precip_stddev > DOUBLE PRECISION|precip_variance > DOUBLE PRECISION|precip_cf_var > DOUBLE PRECISION|precip_sum > > and some values > > v.db.select arava_wsheds > > cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum > 21|Jordan|1055.231692|2|0|0|0|0|0|0||0 > 19|Hidan|987.811979|2|0|0|0|0|0|0||0 > 28|Og|124.122969| > 36|Zarqa|273.606213| > 24|Kidron|122.460114| > 9|Darga|289.012122| > 6|Arugot|236.365116|1|0|0|0|0|0|0||0 > 26|Mujib|1277.546513|2|0|0|0|0|0|0||0 > > (Many catchments have 0 or no value because of the small region I > chose. The global data is 1/4 d