<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 6/1/12 1:44 PM, Jose Gomez-Dans wrote:
<blockquote
cite="mid:CAMWde5qM9aAzeru0FZ5xD6iD--opRJ+_4bgtXGbsPHNog2b+dA@mail.gmail.com"
type="cite">Hi David,<br>
<br>
<div class="gmail_quote">On 1 June 2012 18:47, David Hoese <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:dhoese@gmail.com" target="_blank">dhoese@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
I have 3 binary files, the image/swath 2D data and the
corresponding 2D latitude and longitude pixel data from a
previous processing step. The binary files were all created
using numpy's tofile().<br>
</blockquote>
<div>
<br>
</div>
<div>the link you posted was mostly there. Basically, you create
(in Python) the corresponding VRT files (you may want to use
gdalbuildvrt to give you a flavour of how they look like).
Once the files are in the system, you can reproject in python,
using eg gdal.AutoCreateWarpedVRT, or gdal.ReprojectImage (see
example here: <a moz-do-not-send="true"
href="http://jgomezdans.github.com/gdal_notes/reprojection.html">http://jgomezdans.github.com/gdal_notes/reprojection.html</a>).</div>
<div><br>
</div>
<div>Using VRTs is quite nice if you are still going to do some
further processing in Python/GDAL. You can convert to
something like a GeoTIFF as a final stage. </div>
<div><br>
</div>
<div> Anyway, hope that's useful</div>
<div>J</div>
</div>
</blockquote>
<br>
Thanks Jose,<br>
<br>
I looked at your notes and most of it makes sense to me except I'm
still having a few problems.<br>
<br>
First, if I understand it correctly to get the GDAL utilities to use
the external GEOLOCATION files you have to specify the "-geoloc" on
the command line with programs like gdalwarp and gdal_translate.
How do I do that in the python API, or did I read something wrong?
When I open the VRT file and do a GetGeoTransform() I get the
default (0, 1, 0, 0, 0, 1), which means its not getting the lat/lon
data right? I'm also not including any SRS tag in the VRT files
because I was hoping GDAL would get that information from the swath
lat/lon files.<br>
<br>
Second, I tried using gdalwarp as a test to get the data reprojected
and into a tiff. Initially it told me that I had too big of a file,
so I shrunk it down. Then I got the "Too many points (441 out of
441) failed to transform" error message. I'm guessing this has to
do with my reprojection parameters (see next problem).<br>
<br>
Third, for the moment I am trying to reproject to a specific grid
where I know the number of X and Y grid points as well as the type
of projection and the PROJ4 parameters that go along with that. I
haven't found anything about grids except GDALGridCreate which
doesn't seem to be in the python bindings. Any suggestions for how
to do this with out using command line calls?<br>
<br>
-Dave<br>
<br>
<br>
</body>
</html>