Changes between Version 5 and Version 6 of UserDocs/RasterProcTutorial


Ignore:
Timestamp:
Sep 24, 2007, 10:10:42 AM (17 years ago)
Author:
warmerdam
Comment:

add vrt and brief optimizing section.

Legend:

Unmodified
Added
Removed
Modified
  • UserDocs/RasterProcTutorial

    v5 v6  
    286286----------
    287287
    288 ... produce an optimized version of the previous mosaic.
    289 
    290 ideally demonstrate effect using a mapfile and shp2img?
     288gdal_translate -co TILED=YES -co COMPRESS=DEFLATE mosaic4.tif tiled.tif
     289
     290gdaladdo tiled.tif 2 4 8 16 32 64
     291
     292Thats about it!
    291293
    292294
     
    294296-------------
    295297
     298a) Create an example VRT with gdal_translate.
     299
     300   gdal_translate -of VRT east.dem east.vrt
     301
     302   Inspect east.vrt, for instance with notepad.
     303
     304b) Skim VRT tutorial, available in Related Pages at www.gdal.org.
     305
     306   Compare the elements of the tutorial to the elements of the file.
     307
     308c) Create VRT from geoworld.tif.
     309 
     310   gdal_translate -of VRT geoworld.tif 0to360.vrt
     311
     312d) Edit the <GeoTransform> tag and change:
     313
     314   -1.800000e+02
     315
     316   to
     317   
     318   0.0
     319
     320   to set the origin to 0 longitude instead of -180 (the dateline).  Then
     321   check the .vrt file with gdalinfo and OpenEV.
     322
     323   gdalinfo 0to360.vrt
     324   openev 0to360.vrt
     325
     326   Our extents are right, but the imagery is still wrong!
     327
     328e) Duplicate and modify this section:
     329
     330    <SimpleSource>
     331      <SourceFilename relativeToVRT="1">geoworld.tif</SourceFilename>
     332      <SourceBand>1</SourceBand>
     333      <SrcRect xOff="0" yOff="0" xSize="2048" ySize="1024"/>
     334      <DstRect xOff="0" yOff="0" xSize="2048" ySize="1024"/>
     335    </SimpleSource>
     336
     337   to look like this:
     338
     339    <SimpleSource>
     340      <SourceFilename relativeToVRT="1">geoworld.tif</SourceFilename>
     341      <SourceBand>1</SourceBand>
     342      <SrcRect xOff="0" yOff="0" xSize="1024" ySize="1024"/>
     343      <DstRect xOff="1024" yOff="0" xSize="1024" ySize="1024"/>
     344    </SimpleSource>
     345    <SimpleSource>
     346      <SourceFilename relativeToVRT="1">geoworld.tif</SourceFilename>
     347      <SourceBand>1</SourceBand>
     348      <SrcRect xOff="1024" yOff="0" xSize="1024" ySize="1024"/>
     349      <DstRect xOff="0" yOff="0" xSize="1024" ySize="1024"/>
     350    </SimpleSource>
     351   
     352  Check the result with openev ... now the hemispheres are appropriately
     353  swapped!
     354
     355f) Now lets create an overlapping wrap world going from -180 to 360.
     356
     357   gdal_translate -of VRT geoworld.tif overlap.vrt
     358
     359   Change rasterXSize from 2048 to 3072.
     360
     361   Leave GeoTransform unchanged.
     362
     363   Add this SimpleSource for the 180 to 360 portion.
     364 
     365    <SimpleSource>
     366      <SourceFilename relativeToVRT="1">geoworld.tif</SourceFilename>
     367      <SourceBand>1</SourceBand>
     368      <SrcRect xOff="0" yOff="0" xSize="1024" ySize="1024"/>
     369      <DstRect xOff="2048" yOff="0" xSize="1024" ySize="1024"/>
     370    </SimpleSource>
     371   
     372
     373Python Scripting
     374----------------
     375
     376Do a demonstration of reading east.dem into a  Numeric array,
     377setting all pixel values less than 1 to -100, and saving to a new
     378file.
     379
    296380}}}
    297381