[Gdal-dev] Re: vrt loading as strings

gwalter at atlsci.com gwalter at atlsci.com
Thu Dec 5 17:42:55 EST 2002


Hi Frank,

I've just tried loading a vrt by passing gdal.Open() a string with the vrt
contents, but it didn't work.  I get the error below.  Do I need to do something
special in formatting the string?  I just read in all the lines and concatenated
them by adding them to each other.

ERROR 4: `<VRTDataset rasterXSize="256" rasterYSize="256">
  <VRTRasterBand dataType="Byte" band="1">
    <ColorInterp>Red</ColorInterp>
    <SimpleSource>
      <SourceFilename>mandrill.tif</SourceFilename>
      <SourceBand>1</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/>
      <DstRect xOff="0" yOff="0" xSize="256" ySize="256"/>
    </SimpleSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="Byte" band="2">
    <ColorInterp>Green</ColorInterp>
    <SimpleSource>
      <SourceFilename>mandrill.tif</SourceFilename>
      <SourceBand>2</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/>
      <DstRect xOff="0" yOff="0" xSize="256" ySize="256"/>
    </SimpleSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="Byte" band="3">
    <ColorInterp>Blue</ColorInterp>
    <SimpleSource>
      <SourceFilename>mandrill.tif</SourceFilename>
      <SourceBand>3</SourceBand>
      <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/>
      <DstRect xOff="0" yOff="0" xSize="256" ySize="256"/>
    </SimpleSource>
  </VRTRasterBand>
</VRTDataset>
' does not exist in the file system,
and is not recognised as a supported dataset name.

Gillian


Frank Warmerdam wrote:

>
> I would add that it is possible to pass the entire contents of the VRT
> file as a string to gdal.Open() and it will get opened "as if" it were
> reading the file from disk.
>
> The fixes for out-of-place labels should be done within the next three
> weeks as well as investigating the upsidedown raster problem.  It may
> well be that for your next release you should disable the display list
> support by default if we don't completely trust it yet.
>
> You might also want to look into the upside rasters yourself if you
> have time.  The raster symbol rendering support is in the
> gv_shapes_draw_symbol() function in gvshapeslayer.c.
>
> Best regards,
>
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list