[gdal-dev] gdal_translate - ECW format and non-UTM projections
Armin Burger
armin.burger at gmx.net
Fri Jun 17 14:56:55 EDT 2011
On 08/06/2011 17:44, Frank Warmerdam wrote:
> Armin,
>
> GDAL skips with a file data/ecw_cs.wkt that lists many ECW
> projections and datums. Perhaps it will be helpful.
>
> There are definately problems translating coordinate system
> into the ECW dictionary. A ticket for a particular case
> *might* lead to some improvement but it is an iffy process.
>
> Part of the problem in the thread mentioned by Jean-Claude
> is that when the coordinate system translation fails GDAL
> also gives up on read the georeferencing transform - or at
> least I think it used to work this way. I think there may
> have been some recent fixes in this regard. If not, a ticket
> might be appropriate.
>
> Best regards,
>
Frank, Jean-Claude
I made some tests and the tool from Jean-Claude was very useful also for
this. I defined new projections by adding them to the "ecw_cs.wkt" file,
taking the definitions GDAL returns using Python bindings for the OSR
and the combination of ImportFromEPSG/ExportToWkt methods.
If with gdalinfo a projection was not recognized for an ECW file I first
tried to add it via the -co "PROJ=..." flag. This alone had no effect
and gdalinfo still did not display any projection. Only when adding as
well the correct datum via -co "DATUM=..." gdalinfo returned the full
and correct projection definition.
I tested this then not only with gdal tools directly but also with
programs that use GDAL for image rendering, like QGIS and ArcGis 10.
Also there, when adding the new projections to the "ecw_cs.wkt", the
programs recognized the projection information correctly.
So for me a first solution would be to define all missing projections
and adding them to the "ecw_cs.wkt" file. In principal using the EPSG
code as projection name would be sufficient (and easy to define), but
this seems not to follow standard naming conventions so I will define
short names for them. The projections I'm interested in are mainly
national European projections and some pan-European ones (the ETRS
types). I would be glad if these definitions could be added later on to
the GDAL sources and go into future releases. Maybe sooner or later they
might be included as well in the programs that use GDAL for image rendering.
Then I need to define at least for my own use a CSV table with
EPSG, projection, datum
in order to identify the projection names and datums corresponding to a
certain EPSG code. I will use it when creating ECW files or updating the
ECW headers where I have the projection available as EPSG code. For me a
great solution would be if GDAL could make use of such a table eg. in
gdal_translate when it can identify the EPSG code or when it is passed
via the "-a_srs" option, but I don't know if this is somehow feasible.
Another helpful addition would be the possibility to set projection and
datum in an ECW header via update functions of GDAL SWIG bindings, like
it is currently possible eg. for GeoTiff files.
Frank, if you think some of this might be feasible I will create
ticket(s) for this.
Cheers
Armin
More information about the gdal-dev
mailing list