EASE-grid projection

View: New views
7 Messages — Rating Filter:   Alert me  

EASE-grid projection

by Jose Gómez-Dans-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I am trying to wrap some EASE-grid data from NSIDC for global datasets. NSIDC says it is based on the  Cylindrical Equal Area, and they do provide both an EPSG code for it (3410), as well as a Proj string:
"+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m" (see <http://nsidc.org/data/atlas/epsg_3410.html>. It appears that GDAL supports it, and the relevant line for it is in $GDAL_DATA/pcs.csv:
3410,NSIDC EASE-Grid Global,9001,4053,19869,9834,1,0,8807,0,9001,8823,30,9102,8802,0,9102,8806,0,9001,,,,,,,,,

So far so good, but warping an image into something else doesn't work:
$ gdalwarp --debug on -of GTiff -s_srs "EPSG:3410" -t_srs 'EPSG:4326' INPUT OUTPUT.tif
EPSG: No WKT support for projection method 9834.
ERROR 6: EPSG PCS/GCS code 3410 not found in EPSG support files.  Is this a valid
EPSG coordinate system?
ERROR 1: Translating source or target SRS failed:
EPSG:3410

$ gdalwarp --debug on -of GTiff -s_srs "+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m" -t_srs 'EPSG:4326' INPUT OUTPUT.tif
OGR_PROJ4: Can't find ellipse definition in:
+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
ERROR 1: Translating source or target SRS failed:
+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m

Hmmm.... Does anyone have any ideas around this?

Thanks!
Jose


--
Centre for Terrestrial Carbon Dynamics
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK

_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: EASE-grid projection

by Jose Gómez-Dans-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I know it's unpolite to reply to self, but I think I might have cracked this one. Comments welcomed...


2008/10/10 Jose Gomez-Dans <jgomezdans@...>

$ gdalwarp --debug on -of GTiff -s_srs "+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m" -t_srs 'EPSG:4326' INPUT OUTPUT.tif
OGR_PROJ4: Can't find ellipse definition in:
+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
ERROR 1: Translating source or target SRS failed:
+proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m

If I add the +ellps=sphere (hint is here:  <http://nsidc.org/data/ease/ease_grid.html#whySpherical>. What's wrong with having a flat Earth!!! :D), I am able to reproject the data.

Is this a sound approach?

Thanks,
Jose


--
Centre for Terrestrial Carbon Dynamics
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK

_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: Re: EASE-grid projection

by Dan Stahlke-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jose,

The north pole version works for me, perhaps because of the '+init='
part: (although that probably shouldn't matter...)
    gdalwarp -t_srs '+init=epsg:3408' ...
Maybe the equatorial version of EASE is different.

If you are giving the full proj4 definition "+proj=cea ..." you might
try adding "+no_defs" at the end.  Otherwise, you usually end up getting
some sort of default flatting value or something that tends to interfere
whenever an explicit radius is specified.  Probably the "+ellps=sphere"
ends up overriding the faulty default value.

- Dan

Jose Gomez-Dans wrote:

> Hi,
> I know it's unpolite to reply to self, but I think I might have
> cracked this one. Comments welcomed...
>
>
> 2008/10/10 Jose Gomez-Dans <jgomezdans@...
> <mailto:jgomezdans@...>>
>
>
>     $ gdalwarp --debug on -of GTiff -s_srs "+proj=cea +lat_0=0
>     +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m" -t_srs 'EPSG:4326'
>     INPUT OUTPUT.tif
>     OGR_PROJ4: Can't find ellipse definition in:
>     +proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
>     ERROR 1: Translating source or target SRS failed:
>     +proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
>
>
> If I add the +ellps=sphere (hint is here:  
> <http://nsidc.org/data/ease/ease_grid.html#whySpherical>. What's wrong
> with having a flat Earth!!! :D), I am able to reproject the data.
>
> Is this a sound approach?
>
> Thanks,
> Jose
>
>
> --
> Centre for Terrestrial Carbon Dynamics
> Department of Geography, University College London
> Gower Street, London WC1E 6BT, UK
> ------------------------------------------------------------------------
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev@...
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: Re: EASE-grid projection

by Markus Neteler OSGeo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan, Jose,

On Fri, Oct 10, 2008 at 8:09 PM, Dan Stahlke <dan@...> wrote:
> Jose,
>
> The north pole version works for me, perhaps because of the '+init=' part:
> (although that probably shouldn't matter...)
>   gdalwarp -t_srs '+init=epsg:3408' ...

I wonder if this resolves
http://trac.osgeo.org/gdal/ticket/2584

where I obtained a flipped earth... (seen from North pole).

Thanks
Markus

> Maybe the equatorial version of EASE is different.
>
> If you are giving the full proj4 definition "+proj=cea ..." you might try
> adding "+no_defs" at the end.  Otherwise, you usually end up getting some
> sort of default flatting value or something that tends to interfere whenever
> an explicit radius is specified.  Probably the "+ellps=sphere" ends up
> overriding the faulty default value.
>
> - Dan
>
> Jose Gomez-Dans wrote:
>>
>> Hi,
>> I know it's unpolite to reply to self, but I think I might have cracked
>> this one. Comments welcomed...
>>
>>
>> 2008/10/10 Jose Gomez-Dans <jgomezdans@...
>> <mailto:jgomezdans@...>>
>>
>>
>>    $ gdalwarp --debug on -of GTiff -s_srs "+proj=cea +lat_0=0
>>    +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m" -t_srs 'EPSG:4326'
>>    INPUT OUTPUT.tif
>>    OGR_PROJ4: Can't find ellipse definition in:
>>    +proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
>>    ERROR 1: Translating source or target SRS failed:
>>    +proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
>>
>>
>> If I add the +ellps=sphere (hint is here:
>>  <http://nsidc.org/data/ease/ease_grid.html#whySpherical>. What's wrong with
>> having a flat Earth!!! :D), I am able to reproject the data.
>>
>> Is this a sound approach?
>>
>> Thanks,
>> Jose
>>
>>
>> --
>> Centre for Terrestrial Carbon Dynamics
>> Department of Geography, University College London
>> Gower Street, London WC1E 6BT, UK
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev@...
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev@...
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



--
Open Source Geospatial Foundation
http://www.osgeo.org/
http://www.grassbook.org/
_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: Re: EASE-grid projection

by Bruce Raup :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All,

We at NSIDC had the EASE-Grid projections added to the EPSG code list
last year or so, and I recently noticed that in the "share/proj/epsg"
file in FWTools, for the entry for 3410, it says:

# NSIDC EASE-Grid Global
# Unable to translate coordinate system EPSG:3410 into PROJ.4 format.

I don't understand why it says this, especially since the Proj.4
parameters are defined at

http://nsidc.org/data/atlas/epsg_3410.html

as pointed out by Jose.  Can anyone say why the epsg file says that?

Proj.4 doesn't deal with datums, so it can handle EASE-Grid just fine,
but it should be noted that EASE-Grid maps lon/lat, usually defined on
the WGS-84 datum, to a projection that uses a non-standard spheroid.
In other words, the datum ellipsoid and the projection ellipsoid are
not the same.  This is common for satellite-era data.  Unfortunately,
lots of software and data formats do not properly make this
distinction, or allow for this distinction, and so one can run into
problems.  For example, display software can display the wrong lon/lat
under the cursor by erroneously doing a datum shift after
unprojection.

Best regards,
Bruce

On Fri, Oct 10, 2008 at 12:09 PM, Dan Stahlke <dan@...> wrote:

> Jose,
>
> The north pole version works for me, perhaps because of the '+init=' part:
> (although that probably shouldn't matter...)
>   gdalwarp -t_srs '+init=epsg:3408' ...
> Maybe the equatorial version of EASE is different.
>
> If you are giving the full proj4 definition "+proj=cea ..." you might try
> adding "+no_defs" at the end.  Otherwise, you usually end up getting some
> sort of default flatting value or something that tends to interfere whenever
> an explicit radius is specified.  Probably the "+ellps=sphere" ends up
> overriding the faulty default value.
>
> - Dan
>
> Jose Gomez-Dans wrote:
>>
>> Hi,
>> I know it's unpolite to reply to self, but I think I might have cracked
>> this one. Comments welcomed...
>>
>>
>> 2008/10/10 Jose Gomez-Dans <jgomezdans@...
>> <mailto:jgomezdans@...>>
>>
>>
>>    $ gdalwarp --debug on -of GTiff -s_srs "+proj=cea +lat_0=0
>>    +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m" -t_srs 'EPSG:4326'
>>    INPUT OUTPUT.tif
>>    OGR_PROJ4: Can't find ellipse definition in:
>>    +proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
>>    ERROR 1: Translating source or target SRS failed:
>>    +proj=cea +lat_0=0 +lon_0=0 +lat_ts=30 +a=6371228.0 +units=m
>>
>>
>> If I add the +ellps=sphere (hint is here:
>>  <http://nsidc.org/data/ease/ease_grid.html#whySpherical>. What's wrong with
>> having a flat Earth!!! :D), I am able to reproject the data.
>>
>> Is this a sound approach?
>>
>> Thanks,
>> Jose
>>
>>
>> --
>> Centre for Terrestrial Carbon Dynamics
>> Department of Geography, University College London
>> Gower Street, London WC1E 6BT, UK
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev@...
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev@...
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



--
Bruce Raup
http://cires.colorado.edu/~braup/
_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev

null pointer check needed in shptree.c

by mchapman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Frank,

In the file shptree.c on line 261  (psShape = SHPReadObject( hSHP, iShape
);) in function SHPCreateTree() when the call to SHPReadObject() returns
NULL the code crashes because the following line (262) tries to use the
psShape pointer without checking if it is NULL.  SHPReadObject() correctly
captures the error but stills fails in SHPCreateTree().  I know the shape
file is probably invalid but other shape drivers handle it correctly so it
would be nice if you could stick an if (psShape == NULL) check in there so
it doesn't just crash hard. If you need a file that does this please let me
know and I will send it to you.

Best regards,
Martin


_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: Re: EASE-grid projection

by Frank Warmerdam-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bruce Raup wrote:

> All,
>
> We at NSIDC had the EASE-Grid projections added to the EPSG code list
> last year or so, and I recently noticed that in the "share/proj/epsg"
> file in FWTools, for the entry for 3410, it says:
>
> # NSIDC EASE-Grid Global
> # Unable to translate coordinate system EPSG:3410 into PROJ.4 format.
>
> I don't understand why it says this, especially since the Proj.4
> parameters are defined at

Bruce,

It says this because EPSG projection method 9834 (Lambert Cylindrical
Equal Area) has no translation support in gdal/ogr/ogr_fromepsg.cpp.

If you file a ticket on this issue I can add it.

> http://nsidc.org/data/atlas/epsg_3410.html
>
> as pointed out by Jose.  Can anyone say why the epsg file says that?
>
> Proj.4 doesn't deal with datums, so it can handle EASE-Grid just fine,
> but it should be noted that EASE-Grid maps lon/lat, usually defined on
> the WGS-84 datum, to a projection that uses a non-standard spheroid.
> In other words, the datum ellipsoid and the projection ellipsoid are
> not the same.  This is common for satellite-era data.  Unfortunately,
> lots of software and data formats do not properly make this
> distinction, or allow for this distinction, and so one can run into
> problems.  For example, display software can display the wrong lon/lat
> under the cursor by erroneously doing a datum shift after
> unprojection.

This is most annoying since there seems to be no standard way of representing
such a coordinate system in WKT (for instance).

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


_______________________________________________
gdal-dev mailing list
gdal-dev@...
http://lists.osgeo.org/mailman/listinfo/gdal-dev
LightInTheBox - Buy quality products at wholesale price!