assuming you are using Linux.... Can you use paste to merge the files first, redirected into a new file of x y z columns, then use GDAL on the result (assuming the order of values is the same in all 3 files)
eg: echo 1 > f1 echo 2 > f2 echo 3 > f3 paste f1 f2 f3 1 2 3 Brent Wood --- On Fri, 2/19/10, Andrew Brooks <[email protected]> wrote: > From: Andrew Brooks <[email protected]> > Subject: Re: [gdal-dev] Warp a file from two separate Lat and Long > To: "gdal-dev" <[email protected]> > Date: Friday, February 19, 2010, 6:42 AM > On Thu, 18 Feb 2010 16:49:36 -0000, > Luisa Peña <[email protected]> > wrote: > > > > I've used GDAL a few times but this is the first time > that I'm lost on what > > I can do with GDAL to solve my problem. I have 3 > separate files, one with my > > data, other with Lattitude and another with Longitude. > They have the same > > size and, as an example, it means that Pixel > (1,1) of data is located in > > latitude retrieved from Pixel (1,1) from latitude and > longitude (pixel (1,1) > > from longitude). All of them are in WGS84 but without > GCP's points. > > I need to create a georreferenced/rectified Geotiff > with this data and, to > > do that, I need lat and Long. How can I do this? > > In the past it has been suggested to use VRT files for this > (don't know if > that's still the best solution?). > > Create one VRT file which describes the Latitude file > Create one VRT file which describes the Longitude file > Create one VRT file which describes the data and references > the > lat and lon VRT files as GEOLOCATION metadata. > > The latter VRT file is the one you reference as the source > image to a > gdalwarp/translate command. It's all actually quite > simple (see examples > below) but if you need some more specific advice then let > me know. > > Andrew > > > Example VRT file for latitude: > > <VRTDataset rasterXSize="2048" rasterYSize="964"> > <SRS>GEOGCS["WGS > 72",DATUM["WGS_1972",SPHEROID["WGS > 7 > 2",6378135,298.26,AUTHORITY["EPSG","7043"]],AUTHORITY[& > quot;EPSG","6322"]],PRIMEM["Greenwich",0,AUTHORITY[&quo > t;EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTH > ORITY["EPSG","9122"]],AUTHORITY["EPSG","4322& > quot;]]</SRS> > <VRTRasterBand dataType="Float32" band="1" > subClass="VRTRawRasterBand"> > <SourceFilename > relativetoVRT="1">data.lat</SourceFilename> > <ByteOrder>LSB</ByteOrder> > </VRTRasterBand> > </VRTDataset> > > Example VRT file for data (just to show the geolocation > metadata reference): > > <VRTDataset rasterXSize="2048" rasterYSize="964"> > <Metadata domain="GEOLOCATION"> > <MDI > key="X_DATASET">data.lon.vrt</MDI> > <MDI key="X_BAND">1</MDI> > <MDI > key="Y_DATASET">data.lat.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> > <SRS> stuff goes here</SRS> > > <VRTRasterBand dataType="UInt16" band="1" > subClass="VRTRawRasterBand"> > <ImageOffset>1500</ImageOffset> > <PixelOffset>10</PixelOffset> > <LineOffset>22180</LineOffset> > <ByteOrder>LSB</ByteOrder> > </VRTRasterBand> > </VRTDataset> > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
