Details Ticket 2332


Comment | Reply | Take | Resolve


Serial Number 2332
Subject Missing row and column when importing raster map with r.in.gdal
Area bug
Queue grass
Requestors christof.bigler(at)colorado.edu@
Owner none
Status open
Last User Contact Wed Feb 8 07:58:24 2006 (3 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Fri Dec 1 08:05:08 2006 (2 yr ago)
Created Mon Feb 23 16:11:43 2004 (5 yr ago)

Transaction History Ticket 2332


Mon, Feb 23 2004 16:11:43    Request created by thomas  
Subject: Missing row and column when importing raster map with r.in.gdal

[Re-entered bug #2326 to hide email address as requested by user.]

Platform: other
grass obtained from: Other (CDROM etc)
grass binary for platform: Downloaded precompiled Binaries
GRASS Version: 5.0.2 (April 2003)

I tried to import a raster grid with r.in.gdal, and apparently, a row and a column
is missing in the 
imported raster map (see below).

# Files and directories:
The files are located in the directory codem1nw:
dblbnd.adf
hdr.adf
log
prj.adf
sta.adf
w001001.adf
w001001x.adf

# w001001.adf (around 360 MB) contains the main data.

# Info from codem1nw/prj.adf (maybe not necessary):
Projection    UTM                                                           
Zone          13                                                            
Datum         NAD27                                                         
Zunits        NO                                                            
Units         METERS                                                        
Spheroid      CLARKE1866                                                    
Xshift        0.0000000000                                                  
Yshift        0.0000000000                                                  
Parameters                                                                  
# My default region:
GRASS 5.0.2 > g.region -pd
projection: 1 (UTM)
zone:       13
datum:      nad27
ellipsoid:  clark66
north:      4480020
south:      4380000
west:       235000
east:       340000
nsres:      30
ewres:      30
rows:       3334
cols:       3500

# gdalinfo:
GRASS 5.0.2 > gdalinfo --version
GDAL 1.1.9.0, released 2003/06/27

# Libraries:
ls -la /usr/local/lib:
-rwxr-xr-x    1 christof  admin   3902472 23 Jan 09:33 libgdal.1.1.9.dylib
-rwxr-xr-x    1 christof  admin   1363420  1 Jun  2001 libgdal.1.1.dylib

# Import of raster map:
r.in.gdal -o in=codem1nw out=codem1nw.r
r.support -r codem1nw.r
# There were no error messages during the import.

# Info from gdalinfo:
GRASS 5.0.2 > gdalinfo codem1nw
Driver: AIG/Arc/Info Binary Grid
Size is 10418, 8949
Coordinate System is:
PROJCS["UTM Zone 13, Northern Hemisphere",
    GEOGCS["NAD27",
        DATUM["North_American_Datum_1927",
            SPHEROID["Clarke 1866",6378206.4,294.978698213898,
                AUTHORITY["EPSG","7008"]],
            TOWGS84[-3,142,183,0,0,0,0],
            AUTHORITY["EPSG","6267"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AXIS["Lat",NORTH],
        AXIS["Long",EAST],
        AUTHORITY["EPSG","4267"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-105],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["METERS",1]]
Origin = (131904.828978,4561132.087882)
Pixel Size = (27.27543571,-27.27543571)
Corner Coordinates:
Upper Left  (  131904.829, 4561132.088) 
Lower Left  (  131904.829, 4317044.214) 
Upper Right (  416060.318, 4561132.088) 
Lower Right (  416060.318, 4317044.214) 
Center      (  273982.574, 4439088.151) 
Band 1 Block=256x4 Type=Float32, ColorInterp=Undefined
  Min=1280.949 Max=4412.362 
  NoData Value=-3.40282e+38

# Note the size (10418, 8949)

# Info from the imported raster map:
GRASS 5.0.2 > r.info codem1nw.r
 +----------------------------------------------------------------------------+
| Layer:    codem1nw.r                     Date: Tue Feb 17 19:20:36 2004   
|
 | Mapset:   data1                          Login of Creator: christof      
|
 | Location: fire_flattops                                                  
|
 | DataBase: /Volumes/FatBoy2/Users/christof/Work/Postdoc/Grass_data        
|
 | Title:     ( codem1nw.r )                                                
|
 |----------------------------------------------------------------------------|
|                                                                           
|
 |   Type of Map:  raster              Number of Categories: 4412           
|
 |   Data Type:    FCELL                                                    
|
 |   Rows:         8948                                                     
|
 |   Columns:      10417                                                    
|
 |   Total Cells:  93211316                                                 
|
 |        Projection: UTM (zone 13)                                         
|
 |            N: 4561145.72559973    S: 4317085.1268369   Res: 27.27543571  
|
 |            E: 416019.40508569    W: 131891.19125998   Res: 27.27543571   
|
 |   Range of data:    min =  0.000000 max = 4412.000000                    
|
 |                                                                          
|
 |   Data Source:                                                           
|
 |                                                                          
|
 |                                                                          
|
 |                                                                          
|
 |   Data Description:                                                      
|
 |    generated by r.in.gdal                                                
|
 |                                                                          
|
 |                                                                          
|
 +----------------------------------------------------------------------------+
# Note the size (10417, 8948)

Using r.in.gdal -e ... or r.in.gdal ... location=newlocation did not change
anything.
This bug was submitted by Christof Bigler (Boulder, Colorado). If you need more
information send 
me an e-mail.
See also:
http://www.ecosconsult.com.br/grass-list/arq/11524.html
http://www.ecosconsult.com.br/grass-list/arq/11539.html
http://www.ecosconsult.com.br/grass-list/arq/11556.html


Thanks,
Christof
Thu, Feb 26 2004 18:38:33    Mail sent by guest  
Morten Hulden  morten at untamo.net
Sat, 21 Feb 2004 00:23:56 +0100 (CET)

I'm not sure, but rather than blaming r.in.gdal I think the original data 
is ill-formatted.

(e - w) / ew-res and (n - s) / ns-res should be even numbers, but

(416060.318 - 131904.829) / 27.27543571 = 10417.999991686
(4561132.088 - 4317044.214) / 27.27543571 = 8948.9999938117

So, looks like r.in.gdal, rather than rounding up to 10418 and 8949, or
changing the resolution, trims half of the failing last row/column off
each side of the map.

Don't know if r.in.gdal in newer grass versions still does that, but I
would not consider it a bug. I think it would be more of a bug to round
cell number upwards, even if values here are rather close, since
resolution is given with 8 significant decimals.

rgds
Morten Hulden
Tue, Feb 7 2006 20:42:14    Mail sent by msieczka  
What's the status of this issue currently?

Maciek
Wed, Feb 8 2006 07:58:24    Mail sent by christof.bigler@colorado.edu  
Return-Path <christof.bigler@colorado.edu>
Delivered-To grass-bugs@lists.intevation.de
Mime-Version 1.0 (Apple Message framework v623)
In-Reply-To <20060207194214.B584C1006BC@lists.intevation.de>
References <20060207194214.B584C1006BC@lists.intevation.de>
Content-Type text/plain; charset=US-ASCII; format=flowed
Message-Id <13f419fb5230b79192295ca1ad100a21@colorado.edu>
Content-Transfer-Encoding 7bit
From Christof Bigler <christof.bigler@colorado.edu>
Subject Re: [bug #2332] (grass) Missing row and column when importing raster map with r.in.gdal
Date Wed, 8 Feb 2006 07:58:21 +0100
To Maciek Sieczka via RT <grass-bugs@intevation.de>
X-Mailer Apple Mail (2.623)
X-OriginalArrivalTime 08 Feb 2006 06:58:21.0669 (UTC) FILETIME=[0C5E7950:01C62C7D]
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Meanwhile, I forgot about this issue. And since we use ArcGIS in my new 
lab, I don't use GRASS anymore.

Christof

On 07.02.2006, at 20:42, Maciek Sieczka via RT wrote:

> What's the status of this issue currently?
>
> Maciek
>
> -------------------------------------------- Managed by Request Tracker


Fri, Dec 1 2006 08:05:08    User changed to christof.bigler(at)colorado.edu@ by hbowman  
Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request