<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Gdalwarp resolution</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2995" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>Frank,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>Thanks for the suggestion for down 
sampling....</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>I think I am confused or trying to do too much...&nbsp; 
this is my CLI call </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>gdal_translate -gcp 378.19 196.43 -76.777261&nbsp; 45.67899 
-gcp 6013.13 282.36 -76.744739&nbsp; 45.678655 -gcp 5890.36 7537.81 
-76.745361&nbsp; 45.649344 -gcp 279.98 </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>7464.15 -76.777866&nbsp; 45.649679 -scale&nbsp; -ot byte 
-a_srs EPSG:4201 -outsize 37.5% 37.5% -mo TIFFTAG_XRESOLUTION=300 -mo 
TIFFTAG_YRESOLUTION=300 -mo </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>"Area_or_Point = Area" A38_001.tif 
oA38_001.tif</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>however I have the same issue as I outlined in MSG&nbsp; 
</FONT></SPAN><SPAN class=603173720-22112006><FONT size=3>[Gdal-dev] 
Gdal_translate. Scaling, sizing, georeferencing</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>the issue that I assume that after the above I should have 
a geo-referenced image. Two images side by side should overlap 
60%</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>When I compare with a photo of same area processed using an 
older script in Open EV the old images overlap, and the new gdal_translate 
images are simply SMALLER pictures. The goal is for me to duplicate these 
previously geo-refed images. Both the new and old images line up for the Upper 
left corner, but then it falls apart. What happened to the other three control 
points I passed it? A smaller resolution image should occupy the same physical 
space, right?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>Some other posts have asked the same question but I never 
find the answer.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>As a final product I will be using a&nbsp;-outsize of&nbsp; 
25% or 66.7% whatever resolution they come out as.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>The solution I have come across is the 
following.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>1.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>gdal_translate -gcp 378.19 196.43 -76.777261&nbsp; 45.67899 
-gcp 6013.13 282.36 -76.744739&nbsp; 45.678655 -gcp 5890.36 7537.81 
-76.745361&nbsp; 45.649344 -gcp 279.98 </FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2>7464.15 -76.777866&nbsp; 45.649679 -scale&nbsp; -ot byte -a_srs 
EPSG:4201&nbsp; -mo "Area_or_Point = Area" A38_001.tif 
oA38_001.tif</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2>2.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>gdalwarp -tr 0.0000116774 -0.0000082992 oA38_001.tif 
RoA38_001.tif</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff size=2>For 
this second stage I took info from gdalinfo of an image from step one using the 
67%.&nbsp;I passed that image&nbsp;through gdalwarp without options to set the 
GCP's to the UL LL etc etc. I took the resolution and multiplied in by 1.33. I 
guess I am not achieving a 300 dpi image after all, but I got the file size I am 
looking for.</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff size=2>So 
these new resolution factors were passed again on the same image from step one 
and it seemed to work. But it is messy and I can't evaluate each 
photo.</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff size=2>The 
end result with this two step process&nbsp;is a geo-refed image that is the same 
size that I am trying to duplicate and matches all four 
corners.</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2>Unfortunately I partialy don't realy know what all is ahppening or how I 
could have predicted this outcome.</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff size=2>How 
can I get to the final product quicker and cleaner?</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff size=2>Did I 
goof somewhere along the way?</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff size=2>As 
usual, thanks</FONT></SPAN></DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=603173720-22112006><FONT face=Arial color=#0000ff 
size=2>Cheers</FONT></SPAN></DIV></SPAN>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=603173720-22112006><FONT face=Arial 
color=#0000ff size=2>===============</FONT><BR>If you just want to downsample 
the image, you could try:<BR><BR>&nbsp; gdal_translate -outsize 37.5% 37.5% 
in.tif out.tif<BR><BR>If you also want to override the resolution metadata tags 
(possibly<BR>necessary to make printing software print properly) 
try:<BR><BR>&nbsp; gdal_translate -outsize 37.5% 37.5% 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -mo TIFFTAG_XRESOLUTION=300 -mo 
TIFFTAG_YRESOLUTION=300 \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in.tif 
out.tif</DIV></SPAN><SPAN 
class=603173720-22112006></SPAN>========================<SPAN 
class=603173720-22112006></SPAN><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> gdal-dev-bounces@lists.maptools.org 
[mailto:gdal-dev-bounces@lists.maptools.org] <B>On Behalf Of </B>Sampson, 
David<BR><B>Sent:</B> November 22, 2006 09:52<BR><B>To:</B> 
gdal-dev@lists.maptools.org<BR><B>Subject:</B> [Gdal-dev] Gdalwarp 
resolution<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>Hey folks,</FONT> </P>
<P><FONT face=Arial size=2>I am trying to move a 800 dpi to a 300 dpi image. The 
src image was created using gdal_translate to assign SRS, 4 GCP's and change 
from 16bit to 8bit image. Src image has the following meta_tags</FONT></P>
<P><FONT face=Arial size=2>Metadata:</FONT> <BR><FONT face=Arial size=2>&nbsp; 
AREA_OR_POINT=Area</FONT> <BR><FONT face=Arial size=2>&nbsp; 
TIFFTAG_XRESOLUTION=800</FONT> <BR><FONT face=Arial size=2>&nbsp; 
TIFFTAG_YRESOLUTION=800</FONT> <BR><FONT face=Arial size=2>&nbsp; 
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)</FONT> <BR><FONT face=Arial size=2>&nbsp; 
Area_or_Point =Area </FONT></P><BR>
<P><FONT face=Arial size=2>The command line I am using is:</FONT> </P>
<P><FONT face=Arial size=2>gdalwarp -tr 300 300 oA38_001.tif 
S_A38_001.tif</FONT> </P>
<P><FONT face=Arial size=2>But I get this error</FONT> </P>
<P><FONT face=Arial size=2>Creating output file that is 0P x 0L.</FONT> 
<BR><FONT face=Arial size=2>ERROR 1: Attempt to create 0x0x1 TIFF file, but 
width, height and bands must be positive.</FONT> </P>
<P><FONT face=Arial size=2>Any ideas?</FONT> </P></BODY></HTML>