[GRASS-user] gdal_translate
Hi Which module do I use to change the resolutions? 2010/7/6 mi...@arava.co.il 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 rainfall 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 dem 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: 0:00:03 rows: 402 cols: 1047 cells: 420894 Your DEM layer, on the other hand, is of resolution 3 arc seconds, or about 90 meters on a side. So each cell is 90 m. X 90 m = 8100 sq.m. =~ 0.0081 sq.km. GRASS 6.4.0RC5+39438 (SRTMDEM):~ r.watershed elevation=dem accumulation=acc drainage=direction basin=catch stream=str threshold=200 Here you chose a threshold of 200. That's 200 cells, so about 200 X 0.0081 sq.km, or 1.6 sq km. As a result (see below, the output of r.to.vect) you are getting over 19,000 tiny little catchments. Are you sure that's what you want?? Finally, you're trying to get raster values for 19,000 tiny vector areas where the raster (rainfall) is only 3 cells! You'll have 1000's of catchments with all the same values. And I guess that some of these catchments are extending outside of the three rainfall cells, and causing the NULL value error. In short: I think you'll need to match the resolution of the DEM to that of the rainfall data. If the rainfall is only as accurate as 1 data value per 730 sq.km. then you will be able to do vector-raster analyses only at that resolution = i.e. continent scale maps. HTH -- Micha 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. 100% GRASS 6.4.0RC5+39438 (SRTMDEM):~ r.to.vect -s in=catch out=catchments feature=area Extracting areas... 100% 100% Building topology for vector map catchments... Registering primitives... 60653 primitives registered 314051 vertices registered Building areas... 100% 19885 areas built 1 isles built Attaching islands... 100% Attaching centroids... 100% Number of nodes: 40769 Number of primitives: 60653 Number of points: 0 Number of lines: 0 Number of boundaries: 40768 Number of centroids: 19885 Number of areas: 19885 Number of isles: 1 r.to.vect complete. GRASS 6.4.0RC5+39438 (SRTMDEM):~ v.rast.stats vector=catchments raster=rainfall layer=1 colprefix=precip DBMI-DBF driver error: SQL parser error: syntax error, unexpected NULL_VALUE processing 'NULL' in statement: UPDATE catchments SET precip_min=-NULL WHERE cat=10163 Error in db_execute_immediate() ERROR: Error while executing: 'UPDATE catchments SET precip_min=-NULL WHERE cat=10163' Here is the output of gdalinfo TRMMLast1day.tif Origin = (18.250,-33.500) Pixel Size = (0.250,-0.250) coordinates Corner Coordinates: Upper Left ( 18.250, -33.500) Lower Left ( 18.250, -33.750) Upper Right ( 19.000, -33.500) Lower Right ( 19.000, -33.750) Center ( 18.625, -33.625) Here is what I did to clip the region of interest. gdal_translate -a_srs EPSG:4326 -projwin 18.2987501 -33.6795831 19.1712501 -34.0141665 3B42RT.2010032900.1day.tif TRMMLast1day.tif Is there something I have
[GRASS-user] Error while using r.in.gdal for USGS landsat7 images
Hi there, I'm using r.in.gdal to import Landsat7 images downloaded from USGS website. These landsat images are distributed in UTM-WGS84 for the specific zone. in this case I'm working with images from Brazil (WGS84 UTM ZONE 24S). So first I created an Location based on EPSG:32724. Here goes the gdalinfo command for the image: /Driver: GTiff/GeoTIFF Files: L5216065_06520070405_B10.TIF Size is 8171, 6991 Coordinate System is: PROJCS[WGS 84 / UTM zone 24N, GEOGCS[WGS 84, DATUM[WGS_1984, SPHEROID[WGS 84,6378137,298.257223563, AUTHORITY[EPSG,7030]], AUTHORITY[EPSG,6326]], PRIMEM[Greenwich,0], UNIT[degree,0.0174532925199433], AUTHORITY[EPSG,4326]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,-39], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32624]] Origin = (443999.9941792,-694500.000) Pixel Size = (30.000,-30.000)/ As can be seen it's North instead of South. Nevertheless, r.in.gdal imports it and it even says: Projection of input dataset and current location appear to match But when I try to display I get an error window stating: Execution failed: 'd.rast -o map=imp...@permanent --q' Details: Error: Unable to open raster map imp...@permanent And nothing else is stated Shall I add this issue to the Error/debug trac list? Or how can I fix this? Thanks Antonio __ Information from ESET NOD32 Antivirus, version of virus signature database 5258 (20100707) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Error in GUI's sub-group definition in i.maxlik and others modules
This is a follow-up of a message that I sent last week. I have compiled last weekly snapshot and the problem maintains. in functions just like i.maxlik I can select subgroup but it's not inserted in the command So all functions that requires sub-groups cannot be runned from graphic-interfaces. As well as I tried to add images to a group/sub-group and I cannot open the dropdown box for image selection in i.group. Shall I add this to the Trac list? On Wed, Jun 30, 2010 at 3:35 PM, Jenny Turner jennyturner1...@gmail.comwrote: Hi It might be something to do with that. But for instance, I have used GRASS6.4.RC5 from Jan/Feb and it was ok regarding this issue. and now it's not. Or am I doing sometyhing wrong? On Tue, Jun 29, 2010 at 12:42 PM, Markus Neteler nete...@osgeo.orgwrote: Hi, could it be related to http://trac.osgeo.org/grass/ticket/780 ? Markus On Tue, Jun 29, 2010 at 10:07 AM, Jenny Turner jennyturner1...@gmail.com wrote: Hi again This error not only occurs in i.maxlik but also in the others modules where users should select sub-group (except georrectify GU). Dones anyone has the same problem? Thanks Jenny On Mon, Jun 28, 2010 at 9:51 AM, Jenny Turner jennyturner1...@gmail.com wrote: Hello Martin I got this error in GRASS6.4.0.RC6, from two weeks ago in LinuxUbuntu9.10 but also in Windows. Jenny On Fri, Jun 25, 2010 at 9:57 PM, Martin Landa landa.mar...@gmail.com wrote: Hi, 2010/6/24 Jenny Turner jennyturner1...@gmail.com: I have been testing i.maxlik and I'm getting a strange error. When I select the group, in group parameter, automatically, sub-group list includes the available sub-groups but, when i select one, it's selected in the frame but it's not inserted in the command to be runned. In the bottom it's still REQUIRED. I can only run i.maxlik by inserting directly the parameters in the commandline-output. Has anyone having the same problem? GRASS version? OS? Martin -- Martin Landa landa.martin gmail.com * http://gama.fsv.cvut.cz/~landa ___ 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] r.cva add-on installation problem
Dear list: I have grass64 running on ubuntu and I'm having very deep problems to install r.cva add-on. The question is that I really cannot find the installation instructions mentioned by its authors in the r.cva web page ( http://www.ucl.ac.uk/~tcrnmar/GIS/r.cva.html#installationhttp://www.ucl.ac.uk/%7Etcrnmar/GIS/r.cva.html#installation). I wonder how to install it. Could you please help me? Thank you very much in advance. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] v.rast.stats
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 akasand...@gmail.com wrote: Hi Which module do I use to change the resolutions? 2010/7/6 mi...@arava.co.il 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 rainfall 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 dem 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: 0:00:03 rows: 402 cols: 1047 cells: 420894 Your DEM layer, on the other hand, is of resolution 3 arc seconds, or about 90 meters on a side. So each cell is 90 m. X 90 m = 8100 sq.m. =~ 0.0081 sq.km. GRASS 6.4.0RC5+39438 (SRTMDEM):~ r.watershed elevation=dem accumulation=acc drainage=direction basin=catch stream=str threshold=200 Here you chose a threshold of 200. That's 200 cells, so about 200 X 0.0081 sq.km, or 1.6 sq km. As a result (see below, the output of
[GRASS-user] Error launching wxgui
Hi, I've encountered the following error launching the wxgui from Grass 6.5 using today's svn checkout: (I get several screens worth of the following text) snip d': None}, 'boundaryOne': {'color': (0, 255, 0), 'enabled': True}, 'direction': {'color': (255, 0, 0), 'enabled': False}, 'point': {'color': (0, 0, 0), 'enabled': True}, 'area': {'color': (217, 255, 217), 'enabled': False}, 'vertex': {'color': (255, 20, 147), 'enabled': False}, 'boundaryNo': {'color': (126, 126, 126), 'enabled': True}, 'highlight': {'color': (255, 255, 0), 'enabled': None}, 'centroidOut': {'color': (165, 42, 42), 'enabled': True}, 'centroidIn': {'color': (0, 0, 255), 'enabled': True}, 'centroidDup': {'color': (156, 62, 206), 'enabled': True}, 'nodeTwo': {'color': (0, 86, 45), 'enabled': True}, 'nodeOne': {'color': (255, 0, 0), 'enabled': True}, 'boundaryTwo': {'color': (255, 135, 0), 'enabled': True}, 'line': {'color': (0, 0, 0), 'enabled': True}}, 'queryDangle': {'than-selection': 0, 'thresh': 0}, 'catBoundary': {'enabled': False}}, 'workspace': {'posManager': {'enabled': False}, 'posDisplay': {'enabled': False}}, 'modeler': {'action': {'color': {'disabled': (211, 211, 211, 255), 'running': (255, 0, 0), 'valid': (211, 211, 211), 'invalid': (255, 255, 255)}, 'width': {'default': 1, 'parameterized': 2}, 'size': {'width': 100, 'height': 50}}, 'data': {'color': {'raster': (215, 215, 248), 'vector': (248, 215, 215), 'raster3d': (215, 248, 215)}, 'size': {'width': 175, 'height': 50}}, 'loop': {'size': {'width': 175, 'height': 50}}}, 'advanced': {'iconTheme': {'type': 'grass'}, 'settingsFile': {'type': 'home'}}} advanced settingsFile type home snip After all this finishes, the following message is printed: WARNING: Nviz extension (3D view mode) disabled. Reason: No module named ogsf Traceback (most recent call last): File /usr/local/grass-6.5.svn/etc/wxpython/wxgui.py, line 85, in module import gui_modules.nviz_tools as nviz_tools File /usr/local/grass-6.5.svn/etc/wxpython/gui_modules/nviz_tools.py, line 2861, in module class NvizPreferencesDialog(PreferencesBaseDialog): NameError: name 'PreferencesBaseDialog' is not defined ~ Eric. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Developing GRASS scritps in C language
Dear all, since several years I developed my own scripts in shell languages (linux) for GRASS 6.4. Now, I want to develop my future scripts in C language (because it's more convenient than shell language), but the beginning is quite difficult. I begin by developing several litlle scripts in C which are able to print on screen the number of features of a vector, list the category or calculate area of polygons, etc ... But making more complex scripts is still not so easy for me : as I'm a beginner on C language too but also because finding development documentation for beginner in C language is not easy (I read the pages in the WIKI GRASS and in the GRASS programmer manual). So I'm searching people who are agree to exchange with a newbie in C to help me : by email, phone or even I can travel for a one day meeting or formation !! I'm located in France so I search in priority european (or French !!) people. As I work for a public research organisation, I can plan some exchange with other research organizations quite easily . Thanks for any response Michael Rabotin -- * Michaël Rabotin Ingénieur d'étude en géomatique / GIS Engineer Laboratoire d'étude des Interactions Sol, Agrosystème et Hydrosystème UMR LISAH SupAgro-INRA-IRD Bat. 24 2 place Viala 34060 Montpellier cedex 1 FRANCE LISAH : Laboratory Interactions between Soils, Agrosystems and Hydrosystems Multi-Institute Research Unit (UMR) French National Institute for Agricultural Research (INRA) French Institute for Research and Overseas Development (IRD) School of Agronomy of Montpellier (SupAgro) Téléphone / Phone number : 33 (0)4 99 61 23 85 Secrétariat / Secretariat : 33 (0)4 99 61 22 61 Fax : 33 (0)4 67 63 26 14 E-mail : rabo...@supagro.inra.fr Site web / website: http://www.umr-lisah.fr/ Site web OpenFLUID / OpenFLUID website: http://www.umr-lisah.fr/openfluid/ * ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] wxpython on Snow Leopard
Hi list: I recently compiled GRASS 6.4 on Snow Leopard. When I try to start grass (grass64 -wx) I get the following error (after dealing with the 64/32 bit issue): in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8 How can I overcome this issue? Thanks, Jaime ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user