[gdal-dev] Re: C# bindings - setting up progress delegate for Gdal.Open()

Even Rouault even.rouault at mines-paris.org
Tue Jan 3 09:24:26 EST 2012


Selon Maksim Sestic <max at geoinova.com>:

> Hm, that's strange. I'm using Gdal.Open() to fetch WMS graphics, for example:
>
> Dim ds As Dataset = Gdal.Open("<GDAL_WMS><Service
>
name="WMS"><Version>1.3.0</Version><ServerUrl>http://wms.agiv.be/inspire/wms/orthobeeldvorming</ServerUrl><CRS>CRS:84</CRS><ImageFormat>image/png</ImageFormat><Transparent>True</Transparent><Layers>RGB</Layers><Styles></Styles></Service><DataWindow><UpperLeftX>3.76302095985856</UpperLeftX><UpperLeftY>50.9987228424621</UpperLeftY><LowerRightX>3.76629196690679</LowerRightX><LowerRightY>50.9968195506639</LowerRightY><SizeX>2439</SizeX><SizeY>2255</SizeY></DataWindow><Projection>EPSG:4326</Projection></GDAL_WMS>",
> Access.GA_ReadOnly)
>
> ...returns requested dataset, which I further save to disk using appropriate
> Driver and CreateCopy() method. It works correctly. I hope that above
> example does not perform GetCapabilities() at all?

No it shouldn't

>
> I was thinking about above case, when Gdal.Open(...) actually reads a raster
> dataset from WMS. First it creates "grid" of tiles if pixel size is larger
> than BlockSizeX/Y. Then it reads tile by tile from server, merging them all
> at the end into the final dataset. Downloading each tile would trigger
> progress change. Setting BlockSize to i.e. 256x256 pixels (instead of
> default 1024x1024) should make it granular enough for progress bars.

GDALOpen() will divide into tiles, but will not read them. You need to call
CreateCopy() or RasterIO() for that.

So :

1) Open() on the XML description is a fast operation that doesn't download
anything and doesn't need progress
2) CreateCopy() has a progress callback which will be regularly called.
Depending on the output driver, it might not be called for each tile though, but
perhaps for each line.

>
> Regards,
> Maksim Sestic
>
>
> --
> View this message in context:
>
http://osgeo-org.1803224.n2.nabble.com/C-bindings-setting-up-progress-delegate-for-Gdal-Open-tp7146342p7146691.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list