Re: [gdal-dev] Cassini_Soldner warping using WGS84 GCPs is distorted

2009-09-21 Thread Martin Geng
Hi Frank,

thank you for your answer. I have tried
gdalwarp -t_srs EPSG:4326 -tr 0.031156 0.019021 pic_gcp.tif result.tif
but neither with QGis nor with SharpMap the map is rendered undistorted.
And that although the sizes now have proper values...

Any idea?

Best regards,
Martin

..\FWTools2.4.2\bingdalinfo result.tif
Driver: GTiff/GeoTIFF
Files: result.tif
Size is 15141, 11373
Coordinate System is:
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.257223563,
AUTHORITY[EPSG,7030]],
AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4326]]
Origin = (13.437037980137905,52.481881537880760)
Pixel Size = (0.0311560,-0.0190210)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  13.4370380,  52.4818815) ( 13d26'13.34E, 52d28'54.77N)
Lower Left  (  13.4370380,  52.4602490) ( 13d26'13.34E, 52d27'36.90N)
Upper Right (  13.4842113,  52.4818815) ( 13d29'3.16E, 52d28'54.77N)
Lower Right (  13.4842113,  52.4602490) ( 13d29'3.16E, 52d27'36.90N)
Center  (  13.4606246,  52.4710652) ( 13d27'38.25E, 52d28'15.83N)
Band 1 Block=15141x1 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
0: 0,0,0,255
1: 1,1,1,255
2: 2,2,2,255

 Original-Nachricht 
 Datum: Fri, 18 Sep 2009 10:39:09 -0400
 Von: Frank Warmerdam warmer...@pobox.com
 An: Martin Geng martin.g...@gmx.de
 CC: gdal-dev@lists.osgeo.org
 Betreff: Re: [gdal-dev] Cassini_Soldner warping using WGS84 GCPs is distorted

 Martin,
 
 Examining the GCPs in WGS84 space I see:
 
   (13.4841338099227  - 13.4370322252183) / 15118
 3.1155962894827404e-06
   %.10f % ((13.4841338099227  - 13.4370322252183) / 15118)
 '0.031156'
   %.10f % ((52.4818154665202 - 52.4602476117909)/ 11339)
 '0.019021'
 
 
 Basically, in WGS84 space your source pixels are distinctly
 non-square and gdalwarp distorts your image to produce square
 pixels in the output projection.  If you want to preserve
 the original aspect ratio try:
 
-tr 0.031 0.019
 
 on the gdalwarp commandline.
 
 But basically WGS84 and Cassini-Soldner have quite different
 characteristics in the area of your image, and WGS84 may not
 be a good working coordinate system for the image.
 
 Best regards,
 -- 
 ---+--
 I set the clouds in motion - turn up   | Frank Warmerdam,
 warmer...@pobox.com
 light and sound - activate the windows | http://pobox.com/~warmerdam
 and watch the world go round - Rush| Geospatial Programmer for Rent

-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Cassini_Soldner warping using WGS84 GCPs is distorted

2009-09-18 Thread Frank Warmerdam

Martin Geng wrote:

I have a city map in Cassini_Soldner projection with a separate file
containing the Soldner coordinates of the 4 corners.
I want to reproject it to WGS84 in order to render it e.g. with SharpMap and
display some GPS positions.
I have tried it with some different parameter settings of gdalwarp but in

 every case the resulting image is distorted (the size of the generated tif is

decreased to 15141, 6943).
Even if with the parameter -ts 15118 11339 the original size is adjusted
SharpMap or QGis will display it distorted (IrfanView without distortion).

Is there another way to get a non distorted image or what did I wrong?
Martin

..\FWTools2.4.2\bingdalinfo pic.tif
Driver: GTiff/GeoTIFF
Files: pic.tif
Size is 15118, 11339

...

gcp mapXmapYpixelX  pixelY

upper left  27200   17200   0   0
upper right 30400   17200   15118   0
lower right 30400   14800   15118   -11339
lower left  27200   14800   0   -11339


Gcp mapXmapYpixelX  pixelY
---
upper left 13.4370322252183 52.4818154665202 0 0
upper right 13.4841338099227 52.4818815506509 15118 0
lower right 13.4842034283538 52.4603136448411 15118 -11339
lower left 13.4371248633278 52.4602476117909 0 -11339


Martin,

Examining the GCPs in WGS84 space I see:

 (13.4841338099227  - 13.4370322252183) / 15118
3.1155962894827404e-06
 %.10f % ((13.4841338099227  - 13.4370322252183) / 15118)
'0.031156'
 %.10f % ((52.4818154665202 - 52.4602476117909)/ 11339)
'0.019021'


Basically, in WGS84 space your source pixels are distinctly
non-square and gdalwarp distorts your image to produce square
pixels in the output projection.  If you want to preserve
the original aspect ratio try:

  -tr 0.031 0.019

on the gdalwarp commandline.

But basically WGS84 and Cassini-Soldner have quite different
characteristics in the area of your image, and WGS84 may not
be a good working coordinate system for the image.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev