Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have the following vrt file (input.vrt) with GCPs in EPSG:3857

  <VRTDataset rasterXSize="5409" rasterYSize="5408">
  <Metadata />
  <Metadata domain="IMAGE_STRUCTURE">
  <MDI key="INTERLEAVE">BAND</MDI>
  </Metadata>
  <GCPList>
  <GCP Id="" Pixel="678.0000" Line="1154.0000" X="1.632931421600E+07"  
     Y="-3.355847048000E+06" />
   [..]
  </GCPList>
  <VRTRasterBand dataType="Byte" band="1">
  <Metadata />
   <ColorInterp>Gray</ColorInterp>
   <SimpleSource>
    <SourceFilename relativeToVRT="1">input.tif</SourceFilename>
  <SourceBand>1</SourceBand>
  <SourceProperties RasterXSize="5409" RasterYSize="5408" DataType="Byte" BlockXSize="5409" BlockYSize="1" />
  <SrcRect xOff="0" yOff="0" xSize="5409" ySize="5408" />
  <DstRect xOff="0" yOff="0" xSize="5409" ySize="5408" />
  </SimpleSource>
  </VRTRasterBand>
  </VRTDataset>

Then I warp the input image to the final geotiff one by using

     gdalwarp -order 2 -co "TFW=YES" input.vrt output.tif

but the problem is that my output.tif has size (5419, 5414) instead of (5409, 5408), what am I doing wrong?

share|improve this question
    
-ts width height: set output file size in pixels and lines. If width or height is set to 0, the other dimension will be guessed from the computed resolution. Note that -ts cannot be used with -tr gdal.org/gdalwarp.html –  nickves Dec 4 '12 at 11:37
    
ok, thank you! I raised this question because I remember I did not have to set output sizes because gdalwarp was automatically outputting an image with the same dimensions of the input file. –  user123892 Dec 4 '12 at 15:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.