ECW registration information not recognised in ESRI

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ECW registration information not recognised in ESRI

Delfos, Jacob
ECW registration information not recognised in ESRI

Hi All,

Have a bit of a mystery:

I am translating some geotiffs to ecw. These geotiffs have their geographic information internally in the headers, as well as in a tfw file. They all translate fine, and the coordinate information in the ecw file is recognised in ESRI ArcGIS.

One TIFF file, however, I have modified in photoshop, so it lost its geographic information in the header, but it still has its tfw file. When I translate it to ecw (using the same command as for the other files), its coordinate information is not recognised by ESRI ArcGIS. However, its internal coordinate information IS recognised by other software (gdalinfo, er viewer, global mapper, etc.).

So when translating a TIFF with worldfile, the coordinate information seems to exist internally in the ecw file, is recognised by most software, but not by ArcGIS. To make it more interesting: If I translate the same file with the freeware "ecw compressor" from ER Mapper, the resulting ecw file is correctly referenced by ArcGIS.

In ER Viewer, the image properties are different: the one created by the compressor has a WGS84 Datum, Coordinate System "Local", Coordinate type "UTM (Eastings/Northings)" (which should be latlong). For the Gdal ECW, these properties are set to "RAW".


The command I used:

C:\install\gdal\compiling\apps>gdal_translate -of ECW C:\temp\gdal\SRTM4_tasmania_ACRES_trueColour.tif C:\temp\gdal\SRTM4_tasmania_ACRES_trueColour.ecw -co "QUALITY=6"

Gdalinfo on the TIFF:
------------------------------------------------------------
Driver: GTiff/GeoTIFF
Size is 6150, 5217
Coordinate System is `'
Origin = (143.624867,-39.368522)
Pixel Size = (0.00083333,-0.00083333)
Metadata:
  TIFFTAG_SOFTWARE=Adobe Photoshop CS Windows
  TIFFTAG_DATETIME=2005:06:09 16:18:41
  TIFFTAG_XRESOLUTION=72
  TIFFTAG_YRESOLUTION=72
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  ( 143.6248668, -39.3685216)
Lower Left  ( 143.6248668, -43.7160216)
Upper Right ( 148.7498668, -39.3685216)
Lower Right ( 148.7498668, -43.7160216)
Center      ( 146.1873668, -41.5422716)
Band 1 Block=6150x1 Type=Byte, ColorInterp=Red
Band 2 Block=6150x1 Type=Byte, ColorInterp=Green
Band 3 Block=6150x1 Type=Byte, ColorInterp=Blue


Why is the coordinate information written to the header of the ECW file different if a TFW is used? It's not a drama, but it would be nice if it worked in ESRI.

Regards,

Jacob


JACOB DELFOS
SPATIAL INFORMATION ANALYST
Maunsell Australia Pty Ltd
629 Newcastle Street, Leederville, WA 6007

PO Box 81, Leederville, WA 6902
Western Australia
ABN 20 093 846 925

Tel     + 61 8 9281 6185
Fax    + 61 8 9281 6297
[hidden email]


_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW registration information not recognised in ESRI

tflynch
On 6/10/05, Delfos, Jacob <[hidden email]> wrote:

>  
>
> Hi All,
>
> Have a bit of a mystery:
>
> I am translating some geotiffs to ecw. These geotiffs have their geographic
> information internally in the headers, as well as in a tfw file. They all
> translate fine, and the coordinate information in the ecw file is recognised
> in ESRI ArcGIS.
<snip>

Hi Jacob,

There are some subtleties in ECW georeferencing, which I can explain
for you.  I think the issue you're seeing is probably a minor flaw in
GDAL, though I haven't checked this.

ER Mapper uses a proprietary georeferencing system called GDT (which
AFAIK predates the popularisation of EPSG) in which a dataset is
referenced by a projection string, a datum string, and registration
information.

This data is embedded in a binary header of an ECW file, and includes
x and y origins, x and y cell sizes, and cell size units, as well as
the projection and datum.  For example, "WGS84/GEODETIC" is one of the
most common datum/projection pairs, corresponding to EPSG code 4326.

ER Mapper supports importing datasets with EPSG codes using an
in-built correspondence between EPSG and GDT.  Usually non-geographic
rasters are stored with RAW/RAW as their projection/datum.  However,
if a raster marked RAW/RAW also contains embedded georeferencing
information (such as you might find in a TFW) indicating it has a
geographical purpose, it is imported into ER Mapper software with a
"fake" projection/datum "WGS84/LOCAL" allowing it to be world-aligned
with datasets in other map layers.

There are several flaws in the system.  One of them is that the
EPSG<-->GDT correspondence is not 1-1, so converting between a GeoTIFF
and an ECW file and back again may lose or change the referencing.
Another is that ECW does not support the storage of rotated or sheared
registrations (only origin and pixel scale are supported).  Finally,
non-EPSG coordinate system information embedded in a GeoTIFF will
usually be ignored by ER Mapper software at this point in time.

As far as registration is concerned, the ECW JPEG 2000 SDK is fairly
"blind" concerning the binary values stored in the registration area
of an ECW file, so third party applications may store invalid data in
this location.  ArcGIS is one application that has problems if (for
example) the sign of the y cellsize is inverted.  So that's probably
the reason you can't view the GDAL-translated file in ArcGIS with the
ECW plug-in.

--
Tom Lynch
Development, ER Mapper
Phone:      +61 8 93882900
Fax:        +61 8 93882901
Email:      [hidden email]
Web:        http://www.ermapper.com
Forums:     http://forum.ermapper.com
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: ECW registration information not recognised in ESRI

Delfos, Jacob
In reply to this post by Delfos, Jacob
Hi Tom,
 
Thanks for that explanation. Now I understand where the WGS84/LOCAL info keeps coming from. So probably ArcGIS doesn't like that dataset, because the SDK (or Gdal) didn't put this fake coordinate system in it. It could be because of the inverted Y sign, but if I copy the .tfw (of the original TIF) to a .eww, ArcGIS reads and registers the ECW fine.
 
Regarding rotated and sheared registrations: ArcGIS allows you to georeference an ECW, and as long as you use an affine projection, it will create a .eww file for it (with rotation or shear if applicable). So is this technically incorrect?
 
regards,
 
Jacob
 
 
 
 
-----Original Message-----
From: Tom Lynch [mailto:[hidden email]]
Sent: 10 June 2005 09:43
To: Delfos, Jacob
Cc: [hidden email]
Subject: Re: [Gdal-dev] ECW registration information not recognised in ESRI
 
On 6/10/05, Delfos, Jacob <[hidden email]> wrote:


>
> Hi All,
>
> Have a bit of a mystery:
>
> I am translating some geotiffs to ecw. These geotiffs have their geographic
> information internally in the headers, as well as in a tfw file. They all
> translate fine, and the coordinate information in the ecw file is recognised
> in ESRI ArcGIS.
<snip>
 
Hi Jacob,
 
There are some subtleties in ECW georeferencing, which I can explain
for you.  I think the issue you're seeing is probably a minor flaw in
GDAL, though I haven't checked this.
 
ER Mapper uses a proprietary georeferencing system called GDT (which
AFAIK predates the popularisation of EPSG) in which a dataset is
referenced by a projection string, a datum string, and registration
information.
 
This data is embedded in a binary header of an ECW file, and includes
x and y origins, x and y cell sizes, and cell size units, as well as
the projection and datum.  For example, "WGS84/GEODETIC" is one of the
most common datum/projection pairs, corresponding to EPSG code 4326.
 
ER Mapper supports importing datasets with EPSG codes using an
in-built correspondence between EPSG and GDT.  Usually non-geographic
rasters are stored with RAW/RAW as their projection/datum.  However,
if a raster marked RAW/RAW also contains embedded georeferencing
information (such as you might find in a TFW) indicating it has a
geographical purpose, it is imported into ER Mapper software with a
"fake" projection/datum "WGS84/LOCAL" allowing it to be world-aligned
with datasets in other map layers.
 
There are several flaws in the system.  One of them is that the
EPSG<-->GDT correspondence is not 1-1, so converting between a GeoTIFF
and an ECW file and back again may lose or change the referencing.
Another is that ECW does not support the storage of rotated or sheared
registrations (only origin and pixel scale are supported).  Finally,
non-EPSG coordinate system information embedded in a GeoTIFF will
usually be ignored by ER Mapper software at this point in time.
 
As far as registration is concerned, the ECW JPEG 2000 SDK is fairly
"blind" concerning the binary values stored in the registration area
of an ECW file, so third party applications may store invalid data in
this location.  ArcGIS is one application that has problems if (for
example) the sign of the y cellsize is inverted.  So that's probably
the reason you can't view the GDAL-translated file in ArcGIS with the
ECW plug-in.
 
--
Tom Lynch
Development, ER Mapper
Phone:      +61 8 93882900
Fax:        +61 8 93882901
Email:      [hidden email]
Web:        http://www.ermapper.com
Forums:     http://forum.ermapper.com

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW registration information not recognised in ESRI

Frank Warmerdam-2
In reply to this post by Delfos, Jacob
On 6/9/05, Delfos, Jacob <[hidden email]> wrote:
> Have a bit of a mystery:
>
> I am translating some geotiffs to ecw. These geotiffs have their geographic
> information internally in the headers, as well as in a tfw file. They all
> translate fine, and the coordinate information in the ecw file is recognised
> in ESRI ArcGIS.

Jacob,

I would suggest trying to apply the coordinate system while you are
translating to ECW.  Adding '-a_srs WGS84' on the gdal_translate
commandline should do the trick.

A longer term solution on my part might be to apply a more
appropriate dummy coordinate system instead of RAW if I am
translating data with no coordinate system, but a meaningful
geotransform.  If you open a bug on this issue, I will look into it.
I may need Tom's advise on appropriate fallback coordinate systems
for coordinates that are apparently geodetic or projected.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
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
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: ECW registration information not recognised in ESRI

tflynch
In reply to this post by Delfos, Jacob
Jacob - sounds right.

With respect to affine and sheared registrations - the situation is that it isn't possible to store them in the header of an ECW file (the file header stores world origin and world cell size rather than affine values).  There is nothing to stop an application such as ArcGIS from reading the raster data and applying an affine transformation to it based on some other content - such as a world file - or creating an auxiliary file when saving a working set out to ECW.  But a problem can then arise if the dataset gets separated from the metadata file.

Cheers

Tom.

On 6/10/05, Jacob Delfos <[hidden email]> wrote:

>  
> Hi Tom,
>  
> Thanks for that explanation. Now I understand where the WGS84/LOCAL info
> keeps coming from. So probably ArcGIS doesn't like that dataset, because the
> SDK (or Gdal) didn't put this fake coordinate system in it. It could be
> because of the inverted Y sign, but if I copy the .tfw (of the original TIF)
> to a .eww, ArcGIS reads and registers the ECW fine.
>  
> Regarding rotated and sheared registrations: ArcGIS allows you to
> georeference an ECW, and as long as you use an affine projection, it will
> create a .eww file for it (with rotation or shear if applicable). So is this
> technically incorrect?
>  
> regards,
>  
> Jacob
>  
>  
>  
>  
>  
> -----Original Message-----
> From: Tom Lynch [mailto:[hidden email]]
> Sent: 10 June 2005 09:43
> To: Delfos, Jacob
> Cc: [hidden email]
> Subject: Re: [Gdal-dev] ECW registration information not recognised in ESRI
>  
> On 6/10/05, Delfos, Jacob <[hidden email]> wrote:
> >  
> >
> > Hi All,
> >
> > Have a bit of a mystery:
> >
> > I am translating some geotiffs to ecw. These geotiffs have their
> geographic
> > information internally in the headers, as well as in a tfw file. They all
> > translate fine, and the coordinate information in the ecw file is
> recognised
> > in ESRI ArcGIS.
> <snip>
>  
> Hi Jacob,
>  
> There are some subtleties in ECW georeferencing, which I can explain
> for you.  I think the issue you're seeing is probably a minor flaw in
> GDAL, though I haven't checked this.
>  
> ER Mapper uses a proprietary georeferencing system called GDT (which
> AFAIK predates the popularisation of EPSG) in which a dataset is
> referenced by a projection string, a datum string, and registration
> information.
>  
> This data is embedded in a binary header of an ECW file, and includes
> x and y origins, x and y cell sizes, and cell size units, as well as
> the projection and datum.  For example, "WGS84/GEODETIC" is one of the
> most common datum/projection pairs, corresponding to EPSG code 4326.
>  
> ER Mapper supports importing datasets with EPSG codes using an
> in-built correspondence between EPSG and GDT.  Usually non-geographic
> rasters are stored with RAW/RAW as their projection/datum.  However,
> if a raster marked RAW/RAW also contains embedded georeferencing
> information (such as you might find in a TFW) indicating it has a
> geographical purpose, it is imported into ER Mapper software with a
> "fake" projection/datum "WGS84/LOCAL" allowing it to be world-aligned
> with datasets in other map layers.
>  

> There are several flaws in the system.  One of them is that the
> EPSG<-->GDT correspondence is not 1-1, so converting between a GeoTIFF
> and an ECW file and back again may lose or change the referencing.
> Another is that ECW does not support the storage of rotated or sheared
> registrations (only origin and pixel scale are supported).  Finally,
> non-EPSG coordinate system information embedded in a GeoTIFF will
> usually be ignored by ER Mapper software at this point in time.
>  
> As far as registration is concerned, the ECW JPEG 2000 SDK is fairly
> "blind" concerning the binary values stored in the registration area
> of an ECW file, so third party applications may store invalid data in
> this location.  ArcGIS is one application that has problems if (for
> example) the sign of the y cellsize is inverted.  So that's probably
> the reason you can't view the GDAL-translated file in ArcGIS with the
> ECW plug-in.
>  
> --
> Tom Lynch
> Development, ER Mapper
> Phone:      +61 8 93882900
> Fax:        +61 8 93882901
> Email:      [hidden email]
> Web:        http://www.ermapper.com
> Forums:     http://forum.ermapper.com
>  
>  
> _______________________________________________
> Gdal-dev mailing list
> [hidden email]
> http://xserve.flids.com/mailman/listinfo/gdal-dev
>
>
>


--
Tom Lynch
Development, ER Mapper
Phone:      +61 8 93882900
Fax:        +61 8 93882901
Email:      [hidden email]
Web:        http://www.ermapper.com
Forums:     http://forum.ermapper.com

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: ECW registration information not recognised in ESRI

Delfos, Jacob
In reply to this post by Delfos, Jacob
Frank,
 
That fixed it. Even though ArcGIS cannot tell the projection, putting that option in makes it look at the coordinate values, and recognises them as degrees.
 
I would open a bug, but I lost my password, and the password reminders don't seem to arrive.... Is that a problem on my side?
 
Regards,
 
Jacob
 
-----Original Message-----
From: Frank Warmerdam [mailto:[hidden email]]
Sent: 10 June 2005 21:29
To: Delfos, Jacob
Cc: [hidden email]
Subject: Re: [Gdal-dev] ECW registration information not recognised in ESRI
 
On 6/9/05, Delfos, Jacob <[hidden email]> wrote:
> Have a bit of a mystery:
>
> I am translating some geotiffs to ecw. These geotiffs have their geographic
> information internally in the headers, as well as in a tfw file. They all
> translate fine, and the coordinate information in the ecw file is recognised
> in ESRI ArcGIS.
 
Jacob,
 
I would suggest trying to apply the coordinate system while you are
translating to ECW.  Adding '-a_srs WGS84' on the gdal_translate
commandline should do the trick.
 
A longer term solution on my part might be to apply a more
appropriate dummy coordinate system instead of RAW if I am
translating data with no coordinate system, but a meaningful
geotransform.  If you open a bug on this issue, I will look into it.
I may need Tom's advise on appropriate fallback coordinate systems
for coordinates that are apparently geodetic or projected.
 
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
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
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev