Details Ticket 3526


Comment | Reply | Take | Resolve


Serial Number 3526
Subject Sphere: Problem using r.in.gdal to import geoTIFF of US NDVI
Area grass6
Queue grass
Requestors ken@meso.com,neteler@itc.it
Owner none
Status open
Last User Contact Thu Aug 25 13:27:33 2005 (3 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Thu Aug 25 15:02:12 2005 (3 yr ago)
Created Wed Aug 17 11:43:26 2005 (3 yr ago)

Transaction History Ticket 3526


Wed, Aug 17 2005 11:43:26    Request created by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Date Wed, 17 Aug 2005 11:43:14 +0200
From Markus Neteler <neteler@itc.it>
To Kenneth Waight <ken@meso.com>
Cc GRASSLIST@baylor.edu, grass-bugs@intevation.de
Subject Re: [GRASSLIST:7929] Problem using r.in.gdal to import geoTIFF of US NDVI
Message-ID <20050817094314.GC13041@thuille.itc.it>
Mail-Followup-To Kenneth Waight <ken@meso.com>, GRASSLIST@baylor.edu, grass-bugs@intevation.de
References <1AB3F352-6A23-40D3-9703-5F70575DAF9F@meso.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <1AB3F352-6A23-40D3-9703-5F70575DAF9F@meso.com>
User-Agent Mutt/1.4.1i
X-PGP-Key http://www.gdf-hannover.de/neteler/markus_gpgkey.asc
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
(cc bugtracker)

On Tue, Aug 16, 2005 at 03:39:45PM -0400, Kenneth Waight wrote:
> I'm using r.in.gdal to import a geoTIFF file of U.S. NDVI data.  The  
> import is performed, but this message is displayed and the data  
> doesn't seem to be projected correctly:
> 
> GRASS_INFO_WARNING(20541,1): Datum  
> 'Not_specified_based_on_Authalic_Sphere' not recognised by GRASS and  
> no parameters found. Datum transformation will not be possible using  
> this projection information.
> Over-riding projection check.
> Proceeding with import...
> 
> CREATING SUPPORT FILES FOR ndvi.2004113.test
> SETTING GREY COLOR TABLE FOR ndvi.2004113.test (8bit, full range)
> 
> 
> It's close but is a few km off when I reproject to a lat-lon grid.   
> Here's the dataset information:
> 
> http://glcf.umiacs.umd.edu/data/modis/ndvi/guide.shtml
> U.S.16 day Vegetation Index User Guide
> 
> * Projection: Alber's Equal Area Conic Conformal
> reprojected from native MODIS projection: Sinusoidal
> Central Meridian used was 96d W
> std Parallels of 29d 30' 0" and 45d 30' 0"
> Latitude of Origin is 0d 0' 0"
> Easting & Northing are 0.0000000000 m
> Datum: sphere (a sphere of radius 6370997 m)
> Resolution is 250 meters
> ***NOTE*** - When you load the geotiff, many programs may not  
> correctly recognize the datum and report a wrong datum (i.e., WGS  
> 1984). THE DATUM IS THE SPHERE USED IN MODIS DATA, WITH A RADIUS OF  
> 6370997 METERS!!!
> 
> 
> Any ideas?

I have downloaded such a file and tested with gdalinfo:

gdalinfo US.Albers.2005145.ndvi.tif
Driver: GTiff/GeoTIFF
Size is 21000, 13000
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["Unknown datum based upon the Authalic Sphere",
        DATUM["Not_specified_based_on_Authalic_Sphere",
            SPHEROID["Sphere",6370997,0,
                AUTHORITY["EPSG","7035"]],
            AUTHORITY["EPSG","6035"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4035"]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["standard_parallel_1",29.5],
    PARAMETER["standard_parallel_2",45.5],
    PARAMETER["latitude_of_center",0],
    PARAMETER["longitude_of_center",-96],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-2356750.000000,5769500.000000)
Pixel Size = (250.00000000,-250.00000000)
Metadata:
  AREA_OR_POINT=Point
  TIFFTAG_SOFTWARE=hdf2geotiff v0.1.5
Corner Coordinates:
Upper Left  (-2356750.000, 5769500.000) (128d59'15.31"W, 49d50'21.28"N)
Lower Left  (-2356750.000, 2519500.000) (118d30'25.87"W, 21d47'47.16"N)
Upper Right ( 2893250.000, 5769500.000) ( 56d16'50.11"W, 48d 0'54.53"N)
Lower Right ( 2893250.000, 2519500.000) ( 68d37'26.12"W, 20d30'41.05"N)
Center      (  268250.000, 4144500.000) ( 92d52'8.97"W, 38d54'34.96"N)
Band 1 Block=21000x1 Type=Byte, ColorInterp=Gray

Actually I don't understand the phrase "THE DATUM IS THE SPHERE USED IN MODIS
DATA,
WITH A RADIUS OF 6370997 METERS!!!" on the GLCF page as the MODIS sphere is
with radius 6371007.181 according to
 http://edcdaac.usgs.gov/landdaac/tools/mrtswath/info/ReleaseNotes.pdf
 http://s2k.gsfc.nasa.gov/html_pages/groups/sat/modis_land_overview.html

Moreover, 6370997.0 is the Normal Sphere, not the MODIS sphere:
cs2cs -le | grep 6370997
   sphere a=6370997.0      b=6370997.0      Normal Sphere (r=6370997)

But who cares, we can only trust the metadata here.

Importing within Spearfish into a new location I can reproduce
the error message:
r.in.gdal in=US.Albers.2005145.ndvi.tif out=ndvi2005145 loc=albers_usa
WARNING: Datum 'Not_specified_based_on_Authalic_Sphere' not recognised by
         GRASS and no parameters found. Datum transformation will not be
         possible using this projection information.

Restarting GRASS with ther new location, I get
GRASS 6.1.cvs (albers_usa):/tmp > g.proj -p
-PROJ_INFO-------------------------------------------------
name       : Albers Equal Area
proj       : aea
a          : 6370997
es         : -inf
lat_1      : 29.5
lat_2      : 45.5
lat_0      : 0
lon_0      : -96
x_0        : 0
y_0        : 0
no_defs    : defined
-PROJ_UNITS------------------------------------------------
unit       : metre
units      : metres
meters     : 1

GRASS 6.1.cvs (albers_usa):/tmp > g.proj -w
ERROR: Invalid ellipsoid descriptors (a, rf, es or b) in file

This doesn't look good. Apparently fix is needed.


Wed, Aug 17 2005 11:44:08    User changed to ken@meso.com,neteler@itc.it by mneteler  
Wed, Aug 17 2005 11:44:18    Area changed to grass6 by mneteler  
Wed, Aug 17 2005 11:44:32    Subject changed to Sphere: Problem using r.in.gdal to import geoTIFF of US NDVI by mneteler  
Tue, Aug 23 2005 20:53:54    Mail sent by pkelly  
It is my opinion that the WKT projection description in the metadata is 
wrong. In WKT the ellipsoid is described by two parameters: the semi-major 
axis and the inverse flattening. For a sphere the flattening is 0 and so the
inverse flattening is infinity. If the metadata is modified to read
SPHEROID["Sphere",6370997,"inf",AUTHORITY["EPSG","7035"]]
instead of
SPHEROID["Sphere",6370997,0,AUTHORITY["EPSG","7035"]]
then GRASS creates a valid PROJ_INFO file.

The problem can be worked around by editing the line b: -inf in the 
PROJ_INFO to read either "b: 6370997" or "es: 0".

Perhaps we could change GRASS to accept 0 as well as "inf" as representing a
sphere to allow for other broken software if this is common. Suggestions / 
opinions on the most appropriate course of action are welcome.

This is all very complicated and hard to get my ahead around so please 
challenge/question this if it looks like I've made a mistake.

Paul
Wed, Aug 24 2005 02:53:23    Mail sent by pkelly  
It is my opinion that the WKT projection description in the metadata is 
wrong. In WKT the ellipsoid is described by two parameters: the semi-major 
axis and the inverse flattening. For a sphere the flattening is 0 and so the
inverse flattening is infinity. If the metadata is modified to read
SPHEROID["Sphere",6370997,"inf",AUTHORITY["EPSG","7035"]]
instead of
SPHEROID["Sphere",6370997,0,AUTHORITY["EPSG","7035"]]
then GRASS creates a valid PROJ_INFO file.

The problem can be worked around by editing the line b: -inf in the 
PROJ_INFO to read either "b: 6370997" or "es: 0".

Perhaps we could change GRASS to accept 0 as well as "inf" as representing a
sphere to allow for other broken software if this is common. Suggestions / 
opinions on the most appropriate course of action are welcome.

This is all very complicated and hard to get my ahead around so please 
challenge/question this if it looks like I've made a mistake.

Paul
Thu, Aug 25 2005 13:27:33    Status changed to resolved by pkelly  
Thu, Aug 25 2005 13:27:33    Mail sent by pkelly  
I made a change to lib/proj/convert.c to accept an inverse flattening of 0 
as meaning flattening was 0. So it should now handle the broken metadata.

Paul
Thu, Aug 25 2005 15:02:12    Mail sent by neteler@itc.it  
Return-Path <neteler@itc.it>
Delivered-To grass-bugs@lists.intevation.de
Date Thu, 25 Aug 2005 15:02:06 +0200
From Markus Neteler <neteler@itc.it>
To Paul Kelly via RT <grass-bugs@intevation.de>
Cc ken@meso.com
Subject Re: [bug #3526] (grass) Sphere: Problem using r.in.gdal to import geoTIFF of US NDVI
Message-ID <20050825130205.GB7528@thuille.itc.it>
References <20050825112733.DEE93102BC6@lists.intevation.de>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <20050825112733.DEE93102BC6@lists.intevation.de>
User-Agent Mutt/1.4.1i
X-PGP-Key http://www.gdf-hannover.de/neteler/markus_gpgkey.asc
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
On Thu, Aug 25, 2005 at 01:27:33PM +0200, Paul Kelly via RT wrote:
> I made a change to lib/proj/convert.c to accept an inverse flattening of 0
> as meaning flattening was 0. So it should now handle the broken metadata.

Thanks, Paul.

I have made a test

GRASS 6.1.cvs (albers):/tmp > g.proj -p
-PROJ_INFO-------------------------------------------------
name       : Albers Equal Area
proj       : aea
a          : 6370997
es         : 0
lat_1      : 29.5
lat_2      : 45.5
lat_0      : 0
lon_0      : -96
x_0        : 0
y_0        : 0
no_defs    : defined
-PROJ_UNITS------------------------------------------------
unit       : metre
units      : metres
meters     : 1

GRASS 6.1.cvs (albers):/tmp > g.proj -w
PROJCS["Albers Equal Area",
    GEOGCS["unnamed",
        DATUM["unknown",
            SPHEROID["unnamed",6370997,"inf"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["standard_parallel_1",29.5],
    PARAMETER["standard_parallel_2",45.5],
    PARAMETER["latitude_of_center",0],
    PARAMETER["longitude_of_center",-96],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1]]

r.colors ndvi col=byg
v.proj roads loc=spearfish60

I feel that it looks as expected.

Markus


Thu, Aug 25 2005 15:02:12    Status changed to open by _rt_system  
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