[gdal-dev] C# bindings - CreateCopy() progress delegate fails for WMS

Maksim Sestic max at geoinova.com
Wed Jan 11 07:01:58 EST 2012


Hi all,

I'm experiencing issues while setting a progress delegate on CreateCopy()
for WMS driver. Here's the example:

Dim ds_in 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) 
...
Dim ds_out As Dataset = drv.CreateCopy("C:\Test.png", ds_in, 0, Nothing, New
Gdal.GDALProgressFuncDelegate(AddressOf ProgressFunc), "")

There's also callback function reporting progress:

Private Function ProgressFunc(Complete As Double, Message As System.IntPtr,
Data As System.IntPtr) As Integer
            MsgBox(Complete.ToString)
End Function

Above example fails with "libpng: No IDATs written into file" exception. 

But, if there's no callback function set:

ds_out = drv.CreateCopy("C:\Test.png", ds_in, 0, Nothing, Nothing, Nothing)

...everything works fine. What am I doing wrong here?

Regards,
Maksim Sestic

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/C-bindings-CreateCopy-progress-delegate-fails-for-WMS-tp7175929p7175929.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list