[GRASS5] r.in.gdal's problems with projections is G_get_window() problem.

I've been wondering why r.in.gdal has problems handling imports of
Arc/Info TIFF's into GRASS for a while. Anyway, I can use the override
switch, but then the cell resolution and extents are not properly set
(gets the defaults nrows/ncols, resolution = 1.0).

Does it work or would it help if an Arc/Info style .prj file was
present? GRASS really needs fully functional Arc/Info TIFF
compatibility (and r.in.tiff is a mess). If the GDAL/OGR stuff can
translate the Arc/Info style .prj file already, then maybe just a change
to the documentation would be sufficient (to note the capability). If
GDAL/OGR doesn't already support the translation, is there another way
to get r.in.gdal to handle this scenario (so that it gets the affine
parameters from the tiff world file, but overrides the projection info
that'd be in a GeoTIFF)?

Thanks for your time...
--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Whoops, meant to change that subject line (after further research) and
send it directly to Frank...

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

"Eric G. Miller" wrote:

I've been wondering why r.in.gdal has problems handling imports of
Arc/Info TIFF's into GRASS for a while. Anyway, I can use the override
switch, but then the cell resolution and extents are not properly set
(gets the defaults nrows/ncols, resolution = 1.0).

Does it work or would it help if an Arc/Info style .prj file was
present? GRASS really needs fully functional Arc/Info TIFF
compatibility (and r.in.tiff is a mess). If the GDAL/OGR stuff can
translate the Arc/Info style .prj file already, then maybe just a change
to the documentation would be sufficient (to note the capability). If
GDAL/OGR doesn't already support the translation, is there another way
to get r.in.gdal to handle this scenario (so that it gets the affine
parameters from the tiff world file, but overrides the projection info
that'd be in a GeoTIFF)?

Eric,

GDAL does support (to a limited extent) Arc/Info .prj files with
arc/info grids (binary and ascii), but not with tiff files. I haven't
actually seen this many times. It could be easily added though, if this
is of wide interest.

GDAL does support tiff world files, though I think the GeoTIFF info
takes precidence if it is there. Perhaps this is your problem. Your
world file is being ignored because there is some sort of dummy GeoTIFF
information in the file.

Can you send me a listgeo dump from your file, or put the actual file
in ftp://gdal.velocet.ca/pub/incoming so I can get a better look at it?

I am interested in improving GDAL (and r.in.gdal) compatibility with
Arc/Info but I am a bit nervous about taking ESRI info as overriding
what is in the geotiff file. Keep in mind that you can use "tiffcp" to
strip geotiff info off files if you don't want it. Tiffcp is usually
installed on linux systems, and is available as part of the libtiff toolkit.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerda
and watch the world go round - Rush | Geospatial Programmer for Rent

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Sat, Mar 17, 2001 at 01:15:25AM -0500, Frank Warmerdam wrote:

Eric,

GDAL does support (to a limited extent) Arc/Info .prj files with
arc/info grids (binary and ascii), but not with tiff files. I haven't
actually seen this many times. It could be easily added though, if this
is of wide interest.

I dunno, maybe. I understand the newer ArcView is also supposed to
understand .prj files (but maybe GeoTIFF as well ...).

GDAL does support tiff world files, though I think the GeoTIFF info
takes precidence if it is there. Perhaps this is your problem. Your
world file is being ignored because there is some sort of dummy GeoTIFF
information in the file.

Well, I just ran some tests to see if that was the problem. Nope. While
the tiff file in question had some geotiff tags without projection info,
I converted it to a xpm file then back to a geotiff file which seemed to
remove all the geotiff stuff. Now, listgeo shows:

$ listgeo tifftest.tif
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      End_Of_Tags.
   Keyed_Information:
      End_Of_Keys.
   End_Of_Geotiff.

Corner Coordinates:
... unable to transform points between pixel/line and PCS space

But with:
GRASS> r.in.gdal -o input=tifftest.tif output=tifftest
GRASS> r.info tifftest
+----------------------------------------------------------------------------+
| Layer: tifftest Date: Fri Mar 16 23:07:23 2001 |
| Mapset: snows Login of Creator: felix |
| Location: utm |
| DataBase: /home/felix/gis.d |
| Title: ( tifftest ) |
|----------------------------------------------------------------------------|
| |
| Type of Map: raster Number of Categories: 255 |
| Data Type: CELL |
| Rows: 1426 |
| Columns: 1140 |
| Total Cells: 1625640 |
| Projection: UTM (zone 10) |
| N: 1426 S: 0 Res: 1 |
| E: 1140 W: 0 Res: 1 |
| |
| Data Source: |
| |
| |
| |
| Data Description: |
| generated by r.in.gdal |
| |
| |
+----------------------------------------------------------------------------+

As you can see, the resolution values and raster extents of the tiff world file
are not being used.

$ cat tifftest.tfw
                   0.38876593293013
                   0.00000000000000
                   0.00000000000000
                  -0.39782634201703
              702567.88102749444000
             4287537.86842568960000

I'm not sure what the problem is, but apparently GDALGetGeoTransform() in main.c
is not coming up with the affine parameters???

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'