<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Sean,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks a lot for your answer! It works for me. I have one follow up question: is there a way to make the background transparent instead of being white?
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I really appreciate your help!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regard,<o:p></o:p></p>
<p class="MsoNormal">Guodong<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> gdal-dev <gdal-dev-bounces@lists.osgeo.org> <b>
On Behalf Of </b>Sean Gillies<br>
<b>Sent:</b> Thursday, March 5, 2020 11:24 AM<br>
<b>To:</b> gdal dev <gdal-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [gdal-dev] Using Python gdalwarp to read gif file and world file, re-project to another picture<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Guodong,<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Wed, Mar 4, 2020 at 9:23 PM Guodong <<a href="mailto:gd.zhu@outlook.com">gd.zhu@outlook.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">Hello,<br>
<br>
I want to re-project a radar image<br>
(<a href="https://radar.weather.gov/Conus/RadarImg/latest_radaronly.gif" target="_blank">https://radar.weather.gov/Conus/RadarImg/latest_radaronly.gif</a>) which is in<br>
NAD83/EPSG4326 to WGS84/Pseudo-Mercator/EPSG3857. There is a world file<br>
associated with this gif<br>
(<a href="https://radar.weather.gov/Conus/RadarImg/latest_radaronly.gfw" target="_blank">https://radar.weather.gov/Conus/RadarImg/latest_radaronly.gfw</a>). I was<br>
wondering how can I do this projection using Python gdalwarp package, and<br>
how to extract the coordinates bounds from the new re-projected picture?<br>
<br>
I'm very new to GIS. I know world file contains georeferencing information,<br>
but I stucked at the first step and don't know how to read gif file along<br>
with the world file...<br>
<br>
Thanks a lot for your time and help!<br>
<br>
Best regards,<br>
Guodong<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you save the .gif and the .gfw file to the same directory, so that they are siblings, GDAL will find the .gfw automatically when the .gif file is opened. This is a common GIS paradigm. Many GIS file formats are actually multi-file formats.
One file, usually the image file, is the primary file and it may have auxiliary or "sidecar" files that carry additional information. A world file is one such auxiliary file.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You can convert and warp like like this:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">gdalwarp -r near -s_srs EPSG:4326 -t_srs EPSG:3857 -of GTiff latest_radaronly.gif warped.tif<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The gdalinfo program will show you the bounds of the result and you can confirm they are what you expect.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Sean Gillies<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>