<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hey Jan,<br>
<br>
Thanks for the response. My process will need to be automated so
excel won't help. I also will be working with potentially large
amounts of data (200MB - ~4GB). I would like the output to be in
a flat binary format (just the data), but if I can pull the data
out of another format that will do for now. The output data will
be used in other software that I have written to place the data in
any format I request (geotiff, AWIPS compatible netCDF files,
etc). I was hoping to use gdal_grid for its algorithms to do the
interpolation from input swath pixels to output grid pixels. I am
working with "raw" satellite observation data that is not
equidistant (so it can't be put through gdalwarp which expects an
equidistant grid as input).<br>
<br>
The x and y arrays are created by software I have written. The
values in these arrays state the x and y offset from the grid
origin of where the image pixel is. For example, a single pixel
might be at column 1.14 and row 1.6 of the grid I am mapping to.
I would like gdal_grid (or some other code) to use an algorithm
(nearest neighbor, averaging, etc) to interpolate this image pixel
value onto the surrounding grid points. Does that make sense?
It's difficult for me to describe since I've been working with it
so much lately.<br>
<br>
The start-to-finish goal is essentially what gdalwarp does when
remapping one grid to another, but this doesn't make the
assumption that the data points are equidistant. The gridding
utility I'm currently using is old and only offers a single
algorithm for interpolation. That algorithm does not produce
"pretty" images for a specific instrument's data so I'm looking
for alternatives without having to hack up the old utility. Maybe
looking at it this way will make more sense:<br>
<br>
(lat,lon,projection) -> my software -> (y,x)<br>
(x,y,image_in) -> gdal_grid -> (gridded_image_out)<br>
<br>
Maybe I'll just write the python wrapper for GDALGridCreate since
the rest of my software is python. As far as I know GDAL doesn't
have anything else that does gridding and doesn't have anything
that can do non-equidistant data points. Thanks for the help so
far. Man this email got long fast.<br>
<br>
-Dave<br>
<br>
On 1/22/13 2:58 PM, Jan Heckman wrote:<br>
</div>
<blockquote
cite="mid:CAKMUAtDyUBO0pvvfit5s00NSmoxLgM-ngj53Zxzy5uAee4L6TA@mail.gmail.com"
type="cite">Hi Dave,
<div>So you have effectively three arrays, one for pixel values,
one for x, one for y (probably offsets), which are coordinated
and you want to generate a raster or grid which you can display
/ use in a GIS?</div>
<div>
Sort of sparse array to be converted to a full array,
effectively?</div>
<div>It sounds crazy, maybe, but consider converting these to
separated text (numbers), bring them into excel (columns), tell
(arc)gis to convert to a (point) shapefile and finally, if
necessary, convert that to a raster.</div>
<div>If this is the job, it can alternatively be done quite simply
by writing a small procedure (C++ or python (or something else,
I'm sure)), without using excel etc, as long as you know the
output format (and maybe have a geoprocessor to call upon). A
simple output format is .bil. This is roughly simlar to
shapefiles, with some supporting files to use it in a GIS.
Possibly flat 32 bit float (.flt) is understood by gdal as well.</div>
<div>Sorry that I can't help you with the gdal/ogr commands.</div>
<div>If you don't get a helpful gdal command, give me a yell with
an example.</div>
<div>Jan<br>
<br>
<div class="gmail_quote">On Sun, Jan 20, 2013 at 9:51 PM, 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
flat binary files that I would like to use to grid data. The
3 binary files are the "scattered" image data pixels and the
other two specify the fractional column and row for each
input pixel in the output grid. So the image pixel in the
first file at offset 0 is mapped to the grid column at
offset 0 (from the columns file) and the grid row at offset
0 (from the rows file).<br>
<br>
One way I think I can get the data gridded is to use the
"gdal_grid" utility, but I'm not really sure how to get the
flat binary files to be accepted by "gdal_grid". I thought
I could use VRT files, but I'm not exactly sure how I would
do that. I wasn't sure since the documentation here <a
moz-do-not-send="true"
href="http://www.gdal.org/ogr/drv_vrt.html"
target="_blank">http://www.gdal.org/ogr/drv_vrt.html</a>
says that I need to specify a "SrcLayer", but binary files
don't have layers. So then would I need an intermediate VRT
file to define layers for the binaries? If I need an
intermediate VRT maybe I should just push the data into a
geotiff (with no projection info) and try using that? Could
someone clear this up for me?<br>
<br>
My other question is has there been any work done to make a
python wrapper for GDALGridCreate(). I found email threads
and a ticket (<a moz-do-not-send="true"
href="http://trac.osgeo.org/gdal/ticket/2023"
target="_blank">http://trac.osgeo.org/gdal/ticket/2023</a>)
talking about creating one, but then conversation just stops
and those are from 5 years ago. I didn't notice anything
that screamed "this is impossible" when skimming through
those threads and the ticket. I'm also sure a lot has
changed for GDAL and numpy in the last 5 years. If it's a
time thing I'm willing to add it if someone can point me in
the right direction to start (how-to on adding to GDAL).<br>
<br>
Thanks.<br>
<br>
-Dave<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"
target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>