[Gdal-dev] Help with reprojection of a quicklook...

Jeff Jacober jeff at terraengine.com
Mon Aug 18 17:12:51 EDT 2003


Thanks a bunch for the VRT info Frank.

I think I am very close now, but still not quite there.

First, a quick gdalinfo on my .jpg file produces this:

Driver: JPEG/JPEG JFIF
Size is 500, 500
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  500.0)
Upper Right (  500.0,    0.0)
Lower Right (  500.0,  500.0)
Center      (  250.0,  250.0)
Band 1 Block=500x1 Type=Byte, ColorInterp=Red
Band 2 Block=500x1 Type=Byte, ColorInterp=Green
Band 3 Block=500x1 Type=Byte, ColorInterp=Blue


I then used:

gdal_translate -of VRT wrk.jpg wrk.vrt

to make my .vrt file.  I then edited this file and added my GCP info. The 
result looks like:

<VRTDataset rasterXSize="500" rasterYSize="500">
  <GCPList>
    <GCP Id="1" Pixel="1.0000" Line="1.0000" X="-1.158517000000E+002" 
Y="5.543430000000E+001"/>
    <GCP Id="2" Pixel="500.0000" Line="1.0000" X="-1.147091000000E+002" 
Y="5.515110000000E+001"/>
    <GCP Id="3" Pixel="500.0000" Line="500.0000" X="-1.150872000000E+002" 
Y="5.465420000000E+001"/>
    <GCP Id="4" Pixel="1.0000" Line="500.0000" X="-1.162180000000E+002" 
Y="5.493420000000E+001"/>
    <GCP Id="5" Pixel="250.0000" Line="250.0000" X="-1.154786000000E+002" 
Y="5.504810000000E+001"/>
  </GCPList>
  <VRTRasterBand dataType="Byte" band="1">
    <ColorInterp>Red</ColorInterp>
    <SimpleSource>
      <SourceFilename>wrk.jpg</SourceFilename>
      <SourceBand>1</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="500" ySize="500"/>
      <DstRect xOff="0" yOff="0" xSize="500" ySize="500"/>
    </SimpleSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="Byte" band="2">
    <ColorInterp>Green</ColorInterp>
    <SimpleSource>
      <SourceFilename>wrk.jpg</SourceFilename>
      <SourceBand>2</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="500" ySize="500"/>
      <DstRect xOff="0" yOff="0" xSize="500" ySize="500"/>
    </SimpleSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="Byte" band="3">
    <ColorInterp>Blue</ColorInterp>
    <SimpleSource>
      <SourceFilename>wrk.jpg</SourceFilename>
      <SourceBand>3</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="500" ySize="500"/>
      <DstRect xOff="0" yOff="0" xSize="500" ySize="500"/>
    </SimpleSource>
  </VRTRasterBand>
</VRTDataset>

Now I need to warp it.  When I try:

gdalwarp -t_srs "+proj=utm +zone=11 +datum=WGS84" wrk.vrt utm11.tif

I get the following output:

ERROR 1: Failed to import coordinate system `'.
Creating output file is that 977P x 505L.
ERROR 1: Failed to import coordinate system `'.
:0...10...20...30...40...50...60...70...80...90...100 - done.

And the output image doesn't appear to look quite right. It seems no 
matter what target projection I specify, I get the same result.

Do I need to somehow specify a coordinate system for my raw input file? 
My control point X Y coords are in lat/long. Is this just assumed?

Jeff J





More information about the Gdal-dev mailing list