[FWTools] gdal_translate - what am I missing?

Frank Warmerdam warmerdam at pobox.com
Fri Jan 4 12:30:53 EST 2008


Paul McCullough wrote:
> 
> More info...
> 
> Recal that I said:
>     When I *look* at test2.img I see the following problems:
>        1) georeferecning is incorrect
>        2) aspect ratio is incorrect
>        3) scale is incorrect
> I just found the real location of scene represented by test2.img.
> It is about 16000 feet to the west of the bounding box in the command 
> line (-projwin 6001765 2096567 6003198 2094764)
> Hmmmm, 16000 is suspicious number.
> Also, the scale of test2.img is about 2x larger than it should be.
> 
> 
> 
> *Paul McCullough <Paul.McCullough at sfgov.org>*
> Sent by: fwtools-bounces at lists.maptools.org
> 
> 01/02/2008 11:18 AM
> 
> 	
> To
> 	fwtools at lists.maptools.org
> cc
> 	
> Subject
> 	[FWTools] gdal_translate - what am I missing?
> 
> 
> 	
> 
> 
> 
> 
> 
> 
> All,
> 
> I have a mrsid file:  
>    sf.sid
>    2,119,161,888 bytes
> My end goal is to create an image pyramid with geotiffs from this mrsid 
> file for use with the geoserver image mosaic plugin.
> To that end I am trying to subset this mrsid file with gdal_translate.
> It *seems* that I can use gdal_translate successfully on a small area 
> but not on relatively large area.
> 
> This command appears to work properly for a relatively small area 
> (units=feet, projection=epsg:2227)
>    gdal_translate -of HFA -projwin 6001765 2096567 6003198 2094764 
> sf.sid test1.img
> By "appear" I mean when I *look* at the output using ArcMap, they are 
> georeferenced properly and the image appears (qualitatively) to be the 
> same as the original.
> gdalinfo for test1.img snippets:
>    Size is 2866, 3606
>    Origin = (6001764.559999999600000,2096567.399999999900000)
> 
> Now, here is the command for the larger area:
>    gdal_translate -of HFA -projwin 5978648 2131842 6025550 2085070 
> mrsid\sf.sid pict2004.img
> I see no error and the resulting files include:
>    26,337,579,229 pict2004.ige
>    22,078 pict2004.img
>    11,303 pict2004.img.aux.xml
>    11,972 pict2004.img.info
> gdalinfo for pict2004.img snippets:
>    Size is 93804, 93544
>    Origin = (5978647.559999999600000,2131842.399999999900000)
> Note the size.
> 
> Since this file size from the previous step is unwieldy for visual 
> inspection, I subset again just to do a visual inspection:
>    gdal_translate -of HFA -projwin 6001765 2096567 6003198 2094764 
> pict2004.img test2.img
> gdalinfo for test2.img snippets:
>    Size is 2866, 3606
>    Origin = (6001764.559999999600000,2096567.399999999900000)
> When I *look* at test2.img I see the following problems:
> 1) georeferecning is incorrect
> 2) aspect ratio is incorrect
> 3) scale is incorrect
> 
> I am obviously missing something - can someone please tell me what it is?

Paul,

I'm sorry, but I don't understand why you are getting odd results.  The
gdal_translate commands you have used should pull out subwindows at
full resolution so I can't explain a change of scale.  And I don't know
why you are seeing an offset in the georeferencing unless you have
conflicting georeferencing in a world file and within the .sid itself.

The above commands all seem to show the origin of the output file
matching the origin of the selected projwin.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the FWTools mailing list