2

I have rasters in ecw format and they are accompanied by tab files which contain their crs information. If I try to translate these rasters to a different format with raster --> conversion --> translate tool (gdal_translate), I get following error message and the process won't start:

ERROR 1: No PROJ.4 translation for destination SRS, coordinate transformation initialization has failed.

ERROR 1: No PROJ.4 translation for source SRS, coordinate transformation initialization has failed.

So assumably the process can't read TAB files for CRS info.

How to proceed?

gdalinfo for input raster (ecw).

enter image description here

Contents of TAB file (I think you can't run gdalinfo for a TAB file).

!table
!version 300
!charset WindowsLatin1

Definition Table File "raster_bw.ecw" Type "RASTER"
(23425461.980317321,6759132.2255573412) (0,0) Label "Pt 1",
(23471612.780317321,6712981.4255573414) (307672,307672) Label "Pt 2", (23471612.780317321,6759132.2255573412) (307672,0) Label "Pt 3",
(23425461.980317321,6712981.4255573414) (0,307672) Label "Pt 4"
CoordSys Earth Projection 24, 115, "m", 23, 0, 1, 23500000, 0 Units "m" begin_metadata "\IsReadOnly" = "FALSE" "\MapInfo" = "" "\MapInfo\TableID" = "3ff0e4af-5e08-48c9-86ac-b8e63ca4cf00" end_metadata

My gdal_data file location is in: C:\OSGeo4W64\share\gdal? Though, running echo %GDAL_DATA% in cmd gives me a file location in my PostgreSQL folder which seems to have an identical Gdal-data folder.

  • Where's the data supposed to be? (approximate latitude-longitude or city/state/etc.) – mkennedy Jul 19 '18 at 19:05
  • In Southern Finland. In WGS84 the centre of the above raster image has approximate coordinates of 22.01 / 60.75. – Ville Koivisto Jul 23 '18 at 5:18
2
+50

It seems that you are right and while GDAL does get the corner coordinates right from the ground control points which are stored into the .tab file it does not recognize the coordinate reference system which is the Finnish KKJ zone 2 (EPSG:2392). Reference: http://www.3d-system.net/forum/viewtopic.php?t=26

Now when you know the source SRS you can run gdalwarp manually

gdalwarp -of GTiff -s_srs epsg:2392 -t_srs epsg:4326 source.ecw target.tif 

However, as a first step you can just assign the coordinate system with EPSG code because it is known and by looking at the ground control points the image is not roteted.

gdal_translate -of GTiff -a_srs epsg:2392 source.ecw kkj2_target.tif 

GDAL and QGIS should have no problems with the new tiff file.

Document http://reference1.mapinfo.com/software/mapxtreme_java/english/4_8_1/advanced/coordinate_system/MXTJ_Coordinate_Systems.pdf defines projection #24 as Transverse Mercator, (modified for Finnish KKJ) and it takes into account the errors of the KKJ system (caused by the bended base line). The unmodified Gauss-Krüger that is used in EPSG:3877 has a code #8 Transverse Mercator, (also known as Gauss-Kruger).

  • 1
    What tells you that it's 2392 and not 3877? – Ville Koivisto Aug 2 '18 at 13:28
  • Running that command, I get an error: ERROR 6: Unknown option name '-s_srs'. Something is off in the syntax? – Ville Koivisto Aug 2 '18 at 13:40
  • I apologize, wrong utility. You need gdalwarp gdal.org/gdalwarp.html for warping instead of gdal_translate. Try the edited command. – user30184 Aug 2 '18 at 14:30
  • Thanks for the correction. Using gdalwarp, I get an error: ERROR 1: Too many points (10201 out of 10201) failed to transform, unable to compute output bounds. As far as I've read here, that might indicate a problem in stated CRS. For example, running -a_srs (defining CRS for a raster) runs successfully. – Ville Koivisto Aug 3 '18 at 5:22
  • I don't understand why it does not work but actually you have discovered the best solution. See my edited asnwer. – user30184 Aug 3 '18 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.