On Tue, 17 Nov 2009 07:07:59 -0000, Raspaud Martin <martin.rasp...@smhi.se> wrote: > > Now I would like to project satellite data for which I have the 2d lat > and lon grids onto, say, a polar stereographic projection for example.
GDAL can do this using VRT files. First create a VRT file to represent your raw data set, eg. <VRTDataset rasterXSize="2048" rasterYSize="100"> <VRTRasterBand dataType="UInt16" band="1" subClass="VRTRawRasterBand"> <SourceFilename relativetoVRT="1">input.dat</SourceFilename> <ByteOrder>LSB</ByteOrder> <other stuff like ImageOffset, PixelOffset, LineOffset, ...> </VRTRasterBand> <other bands...> </VRTDataset> Then do similar for each of your latitude and longitude files, eg. <VRTDataset rasterXSize="2048" rasterYSize="100"> <VRTRasterBand dataType="Float32" band="1" subClass="VRTRawRasterBand"> <SourceFilename relativetoVRT="1">latitude.dat</SourceFilename> <ByteOrder>LSB</ByteOrder> <other stuff like ImageOffset, PixelOffset, LineOffset, ...> </VRTRasterBand> <other bands...> </VRTDataset> and similarly for longitude.dat Finally add pointers to the lat/lon VRT files into your data VRT <Metadata domain="GEOLOCATION"> <MDI key="X_DATASET">longitude.vrt</MDI> <MDI key="X_BAND">1</MDI> <MDI key="Y_DATASET">latitude.vrt</MDI> <MDI key="Y_BAND">1</MDI> <MDI key="PIXEL_OFFSET">0</MDI> <MDI key="LINE_OFFSET">0</MDI> <MDI key="PIXEL_STEP">1</MDI> <MDI key="LINE_STEP">1</MDI> </Metadata> Then use the data VRT as input to the gdalwarp program. You may need to use the -tps option, see the manual page. That's the general idea; let us know if you have any success or problems. Andrew _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev