[gdal-dev] write projection to ECW file in Gdal 1.9

Even Rouault even.rouault at mines-paris.org
Wed Oct 3 04:56:59 PDT 2012


Selon netcadturgay <turgay.osna at netcad.com.tr>:

> I use Gdal 1.9 library including ERDAS R-W SDK 4.2 and when I try to write
> projection to ECW file(SetProjection) in update mode, some projections can
> written successfully. But some projections cannot written(cannot update to
> the file). Any solution about this problem?

GDAL doesn't manage always to automatically translate from WKT definition into
ECW 'DATUM' and 'PROJ' concepts.

Quoting http://gdal.org/frmt_ecw.html :

"""
Coordinate system and georeferencing transformations are read, but in some cases
coordinate systems may not translate."
"""

"""
When writing coordinate system information to ECW files, many less common
coordinate systems are not mapped properly. If you know the ECW name for the
coordinate system you can force it to be set at creation time with the PROJ and
DATUM creation options.
""""

""""
ECW metadata domain / Georeferencing update
(Starting with GDAL 1.9.0)

The PROJ, DATUM and UNITS found in the ECW header are reported in the ECW
metadata domain. They can also be set with the SetMetadataItem() method, in
order to update the header information of an existing ECW file, opened in update
mode, without modifying the imagery.

The geotransform and projection can also be modified with the SetGeoTransform()
and SetProjection() methods. If the projection is set with SetProjection() and
the PROJ, DATUM or UNITS with SetMetadataItem(), the later values will override
the values built from the projection string.
"""

So have a look at ecw_cs.wkt in the data directory of GDAL, and find which
values match the best.

My intuition for

PROJCS["(UTM)Universal Transvers Merkator 6º",GEOGCS["EUROPEAN
1950",DATUM["European_Datum_1950",SPHEROID["International",6378388.0,297.0],TOWGS84[-87.0,-98.0,-121.0,0.0,0.0,0.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.01745329],AUTHORITY["EPSG","4230"]],PROJECTION["TRANSVERSE_MERCATOR"],PARAMETER["SCALE_FACTOR",0.9996],PARAMETER["CENTRAL_MERIDIAN",33.0],PARAMETER["LATITUDE_OF_ORIGIN",0.0],PARAMETER["FALSE_EASTING",500000.0],PARAMETER["FALSE_NORTHING",0.0],UNIT["meter",1.0]]

would be to set DATUM to ED50 and PROJ to NUTM36 , but you have to check


More information about the gdal-dev mailing list