[R-sig-Geo] importing file into GRASS via QGIS

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sat Nov 28 19:48:15 CET 2009


Jaime R. Garcia M. a écrit :
> Patrick Giraudoux wrote:
>> Dear all,
>>
>> I am using QGIS 0.11.0 Metis under windows and struggle to import a 
>> raster into GRASS. This is an ARCINFO/ESRI grid file in natural 
>> coordinates (WGS84) whose heading is:
>>
>> ncols  721
>> nrows  360
>> xllcorner  -180
>> yllcorner  -90
>> cellsize   0.5
>> NODATA_value  254
>>
>> etc....
>>
>> I do not meet any trouble when importing it from QGIS as a raster, 
>> nor within R using the package rgdal and the function readGDAL, but 
>> when using within QGIS the GRASS importation tools (r.in.gdal or 
>> r.in.arc), something goes wrong. Il looks like the vertical 
>> resolution was respected (0.5), but the horizontal resolution 
>> unexpectedely comes to be 0.000693481 in decimal degrees (making the 
>> map a narrow vertical strip...), see the output of r.info below
>>
>> I get the same result reading a geotif  from QGIS/GRASS with 
>> r.in.gdal. The geotif file was obtained reading the original ascii 
>> raster from R  (everything OK), then writing it to a geotif with 
>> writeGDAL().
>>
>> Any idea about what may happen ?
>>
>> Patrick
>>
>>
>>
>> ----------------------------------------------------------------------------+ 
>>
>> | Layer:    tempave                        Date: Sat Nov 28 11:07:22 
>> 2009    |
>> | Mapset:   giraudoux                      Login of Creator: 
>> pgiraudo        |
>> | Location: 
>> ChinaWGS84                                                       |
>> | DataBase: U:/Documents and Settings/pgiraudo/Mes 
>> documents/GIS/grassdata   |
>> | Title:     ( tempave 
>> )                                                     |
>> | Timestamp: 
>> none                                                            |
>> |----------------------------------------------------------------------------| 
>>
>> |                                                                            
>> |
>> |   Type of Map:  raster               Number of Categories: 
>> 255             |
>> |   Data Type:    
>> FCELL                                                      |
>> |   Rows:         
>> 360                                                        |
>> |   Columns:      
>> 721                                                        |
>> |   Total Cells:  
>> 259560                                                     |
>> |        Projection: 
>> Latitude-Longitude                                      |
>> |            N:        90N    S:        90S   Res:  
>> 0:30                     |
>> |            E:    179:30W    W:       180W   Res: 
>> 0:00:02.496533            |
>> |   Range of data:    min = 1.#QNAN0  max = 
>> 1.#QNAN0                         |
>> |                                                                            
>> |
>> |   Data 
>> Description:                                                        |
>> |    generated by 
>> r.in.gdal                                                  |
>> |                                                                            
>> |
>> |   
>> Comments:                                                                
>> |
>> |    r.in.gdal -o input="U:\Documents and 
>> Settings\pgiraudo\Bureau\TEMPER\   |
>> |    AT\TEMPAVE.tif" 
>> output="tempave"                                        |
>> |                                                                            
>> |
>> +----------------------------------------------------------------------------+ 
>>
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> Dear Patrick,
>
> Maybe the resolution of the current region in GRASS is set to the one 
> you are getting when importing rasters. One should set the right 
> resolution before importing.
>
> g.region res=0:30
> r.in.gdal -o input="U:\Documents and Settings\pgiraudo\Bureau\TEMPER\ 
>    AT\TEMPAVE.tif" output="tempave"
> just an idea, hope it helps...
>
> Jaime -R.
>

I have just tried with  no success. Next trial will be to consider 
Robert Hijmans' suggestion regarding the number of columns. Will come 
back to the list for a report when done.

Thanks anyway for the hint,

Best,

Patrick



More information about the R-sig-Geo mailing list