[gdal-dev] Using GDalWarp from EPSG:27700 to EPSG:3857 does not create correct image

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

[gdal-dev] Using GDalWarp from EPSG:27700 to EPSG:3857 does not create correct image

Ian Hannah
I am using the C# GDAL interfact to create a GeoTiff file ( test.tiff
<http://osgeo-org.1560.x6.nabble.com/file/t383179/test.tiff>  ).

This file has the EPSG:27700 projection set within it and a GeoTransform as
follows:

                    double[] transform = new double[6];
                    transform[0] = -24000;
                    transform[1] = 1000;
                    transform[2] = 0;
                    transform[3] = 996000;
                    transform[4] = 0;
                    transform[5] = -1000;
                    dataset.SetGeoTransform(transform);

So the GeoTiff image goes from -24000 to 679000 in the Eastings and 996000
to -14000 in the Northings.

I then use the GDAL warp application using this command:

gdalwarp -s_srs EPSG:27700 -t_srs EPSG:3857 -overwrite test.tiff output.tiff

This creates me the output  output.tiff
<http://osgeo-org.1560.x6.nabble.com/file/t383179/output.tiff>  . The large
square in the middle should be over Leeds when placed onto a map but it is
not. The right hand side does not extend out far enough and I have no idea
why.

I just want to know if anyone has had any experience in doing this
transformation or can see anything that I am not doing correctly.

Thanks
Ian




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using GDalWarp from EPSG:27700 to EPSG:3857 does not create correct image

Ian Turton
When I load both of them into QGIS they align pretty well, with the output being slightly smaller than the input file.

Screenshot from 2018-05-21 16-40-32.png

I suspect this is due to  the pixel size changing, but I'm not sure why it is so large as QGis is using GDAL internally to reproject the input to 3857 here.

Ian


On Mon, 21 May 2018 at 16:17, Ian Hannah <[hidden email]> wrote:
I am using the C# GDAL interfact to create a GeoTiff file ( test.tiff
<http://osgeo-org.1560.x6.nabble.com/file/t383179/test.tiff>  ).

This file has the EPSG:27700 projection set within it and a GeoTransform as
follows:

                    double[] transform = new double[6];
                    transform[0] = -24000;
                    transform[1] = 1000;
                    transform[2] = 0;
                    transform[3] = 996000;
                    transform[4] = 0;
                    transform[5] = -1000;
                    dataset.SetGeoTransform(transform);

So the GeoTiff image goes from -24000 to 679000 in the Eastings and 996000
to -14000 in the Northings.

I then use the GDAL warp application using this command:

gdalwarp -s_srs EPSG:27700 -t_srs EPSG:3857 -overwrite test.tiff output.tiff

This creates me the output  output.tiff
<http://osgeo-org.1560.x6.nabble.com/file/t383179/output.tiff>  . The large
square in the middle should be over Leeds when placed onto a map but it is
not. The right hand side does not extend out far enough and I have no idea
why.

I just want to know if anyone has had any experience in doing this
transformation or can see anything that I am not doing correctly.

Thanks
Ian




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
Ian Turton

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev