[gdal-dev] using gdalwarp to reproject swath data

Charles Thompson faux.black.francis at gmail.com
Fri Apr 13 19:48:13 EDT 2012


I am a new GDAL user and have been trying to use gdalwarp to reproject a 2D
array of swath-based (satellite) floating-point data values (no projection)
that reside in a flat binary file.  I also have the corresponding
floating-point geolocation binary files that are the same dimensions as the
data array.  Data extent ranges from 19.0 to 58.0 longitude and -61.0 and
-40.0 latitude.  All missing data values are set to -9999.0.  From poring
over various postings I came across, I created three .vrt files, the
contents which are posted below.  Question: assuming these .vrt files are
correct, what is the gdalwarp command command to reproject this data to a
basic geographic lon-lat grid, retaining the floating-point values in a
flat binary file?  I've had very limited success so far, and that has only
occurred when I convert the data values to byte.  Even then, something
doesn't look exactly correct.  This is an example of the gdalwarp command
I've tried to use:

*gdalwarp -geoloc -te 19.0 -61.0 58.0 -40.0 data_values.vrt out_proj.raw*

Any help appreciated, thank you.

Charles


*VRT file (data_values.vrt) for data array stored in file data_values.raw:*

<VRTDataset rasterXSize="1354" rasterYSize="2030">
  <Metadata domain="GEOLOCATION">
    <MDI key="LINE_OFFSET">5416</MDI>
    <MDI key="LINE_STEP">1</MDI>
    <MDI key="PIXEL_OFFSET">4</MDI>
    <MDI key="PIXEL_STEP">1</MDI>
    <MDI key="X_BAND">1</MDI>
    <MDI key="X_DATASET">longitudes.vrt</MDI>
    <MDI key="Y_BAND">1</MDI>
    <MDI key="Y_DATASET">latitudes.vrt</MDI>
  </Metadata>
  <VRTRasterBand dataType="Float32" band="1" subClass="VRTRawRasterBand">
    <NoDataValue>-9999.0</NoDataValue>
    <SourceFilename relativeToVRT="1">data_values.raw</SourceFilename>
    <ImageOffset>0</ImageOffset>
    <PixelOffset>4</PixelOffset>
    <LineOffset>5416</LineOffset>
    <ByteOrder>LSB</ByteOrder>
  </VRTRasterBand>
</VRTDataset>

*VRT file (longitudes.vrt) for longitude array stored in file
longitudes.raw:

*<VRTDataset rasterXSize="1354" rasterYSize="2030">
  <VRTRasterBand dataType="Float32" band="1" subClass="VRTRawRasterBand">
    <SourceFilename relativetoVRT="1">longitudes.raw</SourceFilename>
    <ImageOffset>0</ImageOffset>
    <PixelOffset>4</PixelOffset>
    <LineOffset>5416</LineOffset>
    <ByteOrder>LSB</ByteOrder>
    <NoDataValue>-9999.0</NoDataValue>
  </VRTRasterBand>
</VRTDataset>

*VRT file (latitudes.vrt)  for latitude array stored in file latitudes.raw:

*<VRTDataset rasterXSize="1354" rasterYSize="2030">
  <VRTRasterBand dataType="Float32" band="1" subClass="VRTRawRasterBand">
    <SourceFilename relativetoVRT="1">latitudes.raw</SourceFilename>
    <ImageOffset>0</ImageOffset>
    <PixelOffset>4</PixelOffset>
    <LineOffset>5416</LineOffset>
    <ByteOrder>LSB</ByteOrder>
    <NoDataValue>-9999.0</NoDataValue>
  </VRTRasterBand>
</VRTDataset>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120413/a6e280fe/attachment.html


More information about the gdal-dev mailing list