Opened 15 years ago

Last modified 9 years ago

#906 new defect

r.out.gdal (VRT) broken output

Reported by: epifanio Owned by: grass-dev@…
Priority: normal Milestone: 6.4.6
Component: Raster Version: svn-develbranch6
Keywords: r.out.gdal, VRT Cc:
CPU: x86-64 Platform: MacOSX

Description (last modified by neteler)

tring to generate a VRT file using r.out.gdal i get a broken file (not loadable in ossim and qgis) using gdal_translate i get a different results.

using r.out.gdal

r.out.gdal input=geology@PERMANENT format=VRT type=Byte output=name.vrt

r.out.gdal input=geology@PERMANENT format=VRT type=Byte output=name.vrt         
Exporting to GDAL data type: Byte
Checking GDAl data type and nodata value
Input raster map contains cells with NULL-value (no-data). The value 255 will be used to represent no-data values in the input map. You can specify a nodata value with the nodata option.
Exporting to GDAL raster
ERROR 1: Writing through VRTSourcedRasterBand is not
supported.
Unable to write GDAL raster file
Unable to export raster map <geology at PERMANENT>
r.out.gdal complete.
(Thu Feb  4 00:53:22 2010) Command finished (0 sec)     

i get this output :

#############################################

<VRTDataset rasterXSize="1899" rasterYSize="1398">
  <SRS>PROJCS[&quot;UTM Zone 13, Northern Hemisphere&quot;,GEOGCS[&quot;clark66&quot;,DATUM[&quot;North_American_Datum_1927&quot;,SPHEROID[&quot;Clarke_1866&quot;,6378206.4,294.9786982]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433]],PROJECTION[&quot;Transverse_Mercator&quot;],PARAMETER[&quot;latitude_of_origin&quot;,0],PARAMETER[&quot;central_meridian&quot;,-105],PARAMETER[&quot;scale_factor&quot;,0.9996],PARAMETER[&quot;false_easting&quot;,500000],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;meter&quot;,1]]</SRS>
  <GeoTransform>  5.9001000000000000e+05,  1.0000000000000000e+01,  0.0000000000000000e+00,  4.9280000000000000e+06,  0.0000000000000000e+00, -1.0000000000000000e+01</GeoTransform>
  <VRTRasterBand dataType="Byte" band="1">
    <NoDataValue>2.55000000000000E+02</NoDataValue>
    <ColorInterp>Palette</ColorInterp>
    <ColorTable>
      <Entry c1="197" c2="129" c3="125" c4="255"/>
      <Entry c1="107" c2="250" c3="75" c4="255"/>
      <Entry c1="226" c2="83" c3="250" c4="255"/>
      <Entry c1="246" c2="222" c3="188" c4="255"/>
      <Entry c1="123" c2="225" c3="27" c4="255"/>
      <Entry c1="134" c2="190" c3="1" c4="255"/>
      <Entry c1="48" c2="86" c3="221" c4="255"/>
      <Entry c1="113" c2="70" c3="15" c4="255"/>
      <Entry c1="102" c2="134" c3="101" c4="255"/>
      <Entry c1="89" c2="135" c3="169" c4="255"/>
    </ColorTable>
  </VRTRasterBand>
</VRTDataset>

#############################################


this output is different from the gdal output :

gdal_translate -of VRT /Users/sasha/Downloads/spearfish60/PERMANENT/cellhd/geology /Users/sasha/Desktop/geology.vrt

#############################################

<VRTDataset rasterXSize="190" rasterYSize="140">
  <SRS>PROJCS[&quot;UTM Zone 13, Northern Hemisphere&quot;,GEOGCS[&quot;clark66&quot;,DATUM[&quot;North_American_Datum_1927&quot;,SPHEROID[&quot;Clarke_1866&quot;,6378206.4,294.9786982]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433]],PROJECTION[&quot;Transverse_Mercator&quot;],PARAMETER[&quot;latitude_of_origin&quot;,0],PARAMETER[&quot;central_meridian&quot;,-105],PARAMETER[&quot;scale_factor&quot;,0.9996],PARAMETER[&quot;false_easting&quot;,500000],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;meter&quot;,1]]</SRS>
  <GeoTransform>  5.9000000000000000e+05,  1.0000000000000000e+02,  0.0000000000000000e+00,  4.9280000000000000e+06,  0.0000000000000000e+00, -1.0000000000000000e+02</GeoTransform>
  <Metadata/>
  <VRTRasterBand dataType="Byte" band="1">
    <Metadata>
      <MDI key="COLOR_TABLE_RULES_COUNT">0</MDI>
    </Metadata>
    <NoDataValue>0.00000000000000E+00</NoDataValue>
    <ColorInterp>Palette</ColorInterp>
    <ColorTable>
      <Entry c1="197" c2="129" c3="125" c4="255"/>
      <Entry c1="107" c2="250" c3="75" c4="255"/>
      <Entry c1="226" c2="83" c3="250" c4="255"/>
      <Entry c1="246" c2="222" c3="188" c4="255"/>
      <Entry c1="123" c2="225" c3="27" c4="255"/>
      <Entry c1="134" c2="190" c3="1" c4="255"/>
      <Entry c1="48" c2="86" c3="221" c4="255"/>
      <Entry c1="113" c2="70" c3="15" c4="255"/>
      <Entry c1="102" c2="134" c3="101" c4="255"/>
      <Entry c1="89" c2="135" c3="169" c4="255"/>
    </ColorTable>
    <SimpleSource>
      <SourceFilename relativeToVRT="0">/Users/sasha/Downloads/spearfish60/PERMANENT/cellhd/geology</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="190" RasterYSize="140" DataType="Byte" BlockXSize="190" BlockYSize="1"/>
      <SrcRect xOff="0" yOff="0" xSize="190" ySize="140"/>
      <DstRect xOff="0" yOff="0" xSize="190" ySize="140"/>
    </SimpleSource>
  </VRTRasterBand>
</VRTDataset>

#############################################

the grass output doesn't include :

    <SimpleSource>
...
    </SimpleSource>

it is missed and tring to load the output in ossim or qgis it is not displayed.

from a chat on #gdal seems the problem is related to the "create_copy()" usage .. but i'm not able to debug it.

thanks!

Massimo.

Attachments (2)

grass.vrt (1.5 KB ) - added by epifanio 15 years ago.
grass output
gdal.vrt (2.0 KB ) - added by epifanio 15 years ago.
gdal output

Download all attachments as: .zip

Change History (6)

by epifanio, 15 years ago

Attachment: grass.vrt added

grass output

by epifanio, 15 years ago

Attachment: gdal.vrt added

gdal output

comment:1 by neteler, 15 years ago

I see "Writing through VRTSourcedRasterBand is not supported"

in

http://trac.osgeo.org/gdal/browser/branches/1.6/gdal/frmts/vrt/vrtsourcedrasterband.cpp#L127

Seems to come from GDAL?

comment:2 by hamish, 12 years ago

Component: DefaultRaster
Keywords: r.out.gdal VRT added

comment:3 by neteler, 9 years ago

Description: modified (diff)
Milestone: 6.5.06.4.6

comment:4 by neteler, 9 years ago

I have tried in 6.4.svn:

GRASS 6.4.6svn (nc_spm_08):~ > r.out.gdal input=geology_30m format=VRT type=UInt16 output=name.vrt
Exporting to GDAL data type: UInt16
Checking GDAL data type and nodata value
 100%
Exporting to GDAL raster
ERROR 1: Writing through VRTSourcedRasterBand is not supported.
WARNING: Unable to write GDAL raster file
WARNING: Unable to export raster map <geology_30m>
r.out.gdal complete.

Indeed, the VRT file is generated but without reference to the "geology_30m" map.

Same thing in GRASS GIS 7.0.3svn. I suppose that it is simply not supported.

Note: See TracTickets for help on using tickets.