2

I have some GeoTiff's that are in EPSG:3006 (SWEREF99 TM) atm, and I'm trying to convert them to EPSG:4326 (WGS84) because some other software needs it in this projection.

But after doing the gdalwarp the corners of my tiff's doesn't seem to add up anymore. Is there anything i can do to prevent this from happening?

Some examples (from gdalinfo); the upper right corner of one tile should be in the same position as the upper left corner on the next tile.

The corners in EPSG:3006:

Upper Right (  400000.000, 6200000.000) ( 13d23'57.18"E, 55d56' 5.91"N)
Upper Left  (  400000.000, 6200000.000) ( 13d23'57.18"E, 55d56' 5.91"N)

And the same corners ins EPSG:4326 after gdalwarp:

Upper Right (  13.4282324,  55.9349761) ( 13d25'41.64"E, 55d56' 5.91"N)
Upper Left  (  13.3992179,  55.9453750) ( 13d23'57.18"E, 55d56'43.35"N)

Now they don't line up anymore.

I'm using QGIS, which is using gdalwarp to do this. The commandline for the operation:

gdalwarp -overwrite -s_srs EPSG:3006 -t_srs EPSG:4326 -of GTiff C:/data/example.tif C:/data/example_warped.tif
2

They are not the same corners. Warping rotetes the image and I hope that this image explains the rest.

enter image description here

  • Thank you! I'm pretty new to this so I thought i could do it that way. Is there any other way to do what i want? – bjarven Apr 19 '16 at 15:07
  • I thought about merging all the tiff's in EPSG:3006, then warp the merged tiff, and split it up into many tiff's again. Could that be a solution perhaps? – bjarven Apr 19 '16 at 15:09
  • You can do it that way. The image areas do stand side by side after conversion but you must make the sliver triangles transparent by assigning a NoData value with -dstnodata or alpha channel with -dstsalpha gdal.org/gdalwarp.html. Merging first, rotating then is good suggestion. Which approach is better depends on use case. – user30184 Apr 19 '16 at 15:13

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.