[gdal-dev] error result in SDEDataset::ComputeRasterInfo()
Howard Butler
hobu.inc at gmail.com
Tue Dec 4 23:29:43 EST 2007
A couple of things:
1) Are you calling GDALRegister_SDE() twice by virtue of calling =20
GDALAllRegister() once already in your program? Are you attempting to =20=
use the SDE raster driver in some sort of plugin (ie, where you could =20=
potentially have out-of-dll or cross-dll allocations going on)
2) The following Python script works for me on linux (using the latest =20=
version of the code from svn) under valgrind with no memory errors:
> from osgeo import gdal
>
> gdal.UseExceptions()
>
> ds =3D gdal.Open('SDE:localhost,5151,sde,sde,sde,SDE.ANDREAS')
> print 'X Size: ', ds.RasterXSize, 'Y Size: ', ds.RasterYSize
>
>
> band1 =3D ds.GetRasterBand(1)
> print 'Band X Size: ', band1.XSize, 'Band Y Size: ', band1.YSize
>
> print 'Number of Overviews: ', band1.GetOverviewCount()
>
The above code prints the following:
> X Size: 7872 Y Size: 9743
> Band X Size: 7872 Band Y Size: 9743
> Number of Overviews: 4
3) Are you using the latest svn version of the code?
4) Do you see the same problem with a layer that *is not* of floating =20=
point type?
5) Can you try a version of the raster layer that does not use LZ77 =20
compression? There is a pretty serious conflict with an internal zlib =20=
that the ArcSDE libraries has embedded =
http://forums.esri.com/Thread.asp?c=3D2&f=3D1718&t=3D212867&mc=3D3
On Dec 4, 2007, at 9:09 PM, chenxuexia wrote:
> hi,
> Thank you for reply.
> My software version is arcsde9.2 for oracle9i without any service =20
> pack. The data is imported into database through arcgis9.0. This is =20=
> some information of the data displayed in arcmap:
> DataSource:
> Raster : sde.dem
> Data Type: SDE raster
> server: mypc
> Raster information:
> Columns and Rows: 5204,4488
> Number of Bands : 1
> Uncompressed Size: 89.00MB
> Format: SDR
> Source Type: continous
> Pixel Type: floating point
> Pixel Depth: 32 Bit
> NodataValue: -3.402823E+38
> Colormap: absent
> Pyramids: level:5,resampling: Nearest neighbor
> Compression : LZ77
>
> I just wanna get the most detailed rasterband(the first overview). =20
> My code like this:
>
> OpenSdeDEM(const char* pszFilename)
> {
> GDALRegister_SDE();
> GDALOpenInfo OpenInfo(szFileName , GA_ReadOnly);
> GDALDataset* poDataset =3D SDEDataset::Open(&OpenInfo);
> // trace to sdeDataset::ComputeRasterInfo(),after exectuting =20
> SetBand(),
> //the (GDALRasterBand*)b's value looks like memory dislocation!
> if( poDataset !=3D NULL )
> {
> //Fetching a Raster Band and adfGeometry...
> nBands =3D poDataset ->GetRasterCount();
> if (nBands<=3D0)
> return FALSE;
> poBand =3D poDataset ->GetRasterBand( 1 );
> iCols =3D poBand->GetXSize();// iCols=3D512, ---iCols !=3D 5204, =
what's =20
> the problem?
> iRows =3D poBand->GetYSize(); // iRows=3D512,--- not 4488
> ...}
> ..
> }
>
> The attachment is the snapshot of the trace result--=20
> (GDALRasterBand*)b's value.
>
> --
> //////////////////////////////////////////////////////////////////
> To a world, you're little, but to a person, you're the world.
> //////////////////////////////////////////////////////////////////
>
> =D4=DA2007-12-04=A3=AC"Howard Butler" <hobu.inc at gmail.com> =D0=B4=B5=C0=A3=
=BA
> Can you provide more detail about how to reproduce the issue?
>
> Are you working with an overview band, or just the base data?
>
> Which version of ArcSDE are you using and is it fully updated with its
> service packs (both the client and the server)?
>
>
>
> On Dec 3, 2007, at 9:20 PM, chenxuexia wrote:
>
> >
> >
> >
> >
> > ---------- =D7=AA=B7=A2=D3=CA=BC=FE=D0=C5=CF=A2 ----------
> > =B7=A2=BC=FE=C8=CB=A3=BA"chenxuexia <xuex_chen at 126.com>"
> > =B7=A2=CB=CD=C8=D5=C6=DA=A3=BA2007-12-04 10:44:24
> > =CA=D5=BC=FE=C8=CB=A3=BAgdal <gdal-dev at lists.maptools.org>
> > =D6=F7=CC=E2=A3=BA error result in SDEDataset::ComputeRasterInfo()
> > hi,
> > I use gdal1.4.1(added sdedataset and sderasterband) and VC6.0 to
> > read data from sde4oracle database. i can't get the right rasterband
> > value.Here is the debugging errors:
> > When run into SDEDataset::ComputeRasterInfo(),
> >=20
> =
//////////////////////////////////////////////////////////////////////////=
///////////////////////
> > for (int i=3D0; i < nBands; i++) {
> > SetBand( i+1, new SDERasterBand( this, i+1, -1,
> > &(paohSDERasterBands[i]) ));
> > }
> > GDALRasterBand* b =3D GetRasterBand(1);
> >=20
> =
//////////////////////////////////////////////////////////////////////////=
///////////////////////
> > now the b value is:
> >
> > we can see that b->nRasterYSize is not equal to b->pods-
> > >nRasterYSize, and b->eAccess is wrong!
> > Does the sentence SetBand (i+1, new SDERasterBand (this, i+1,
> > -1, &(paohSDERasterBands[i]) )) work well? Any way to solve it?
> >
> >
> >
> >
> >
> > --
> > //////////////////////////////////////////////////////////////////
> > To a world, you're little, but to a person, you're the world.
> > //////////////////////////////////////////////////////////////////
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> <=CE=B4=C3=FC=C3=FB.jpg>
More information about the gdal-dev
mailing list