[mapserver-users] kml superoverlays

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Jan 14 14:59:43 PST 2016


On 2016-01-14 6:55 PM, Even Rouault wrote:
> Le jeudi 14 janvier 2016 23:21:30, Jeff McKenna a écrit :
>> On 2016-01-14 4:51 PM, Even Rouault wrote:
>>>> Could this 'OGRDB2DriverOpen' be the issue?
>>>
>>> This is just a harmelss debug message (that shouldn't be printed IMHO in
>>> the Open() method of the DB2 driver. cc'ing David)
>>>
>>>> Shouldn't GDAL use the
>>>> "KMLSUPEROVERLAY" driver here?  (for the record that driver is listed in
>>>> both my Windows and Ubuntu builds, through 'gdalinfo --formats').
>>>
>>> No the issue is that the \ windows directory separator was used instead
>>> of / for http ressources.
>>> Just fixed with https://trac.osgeo.org/gdal/ticket/6310
>>>
>>> You might get some extra open speedup by defining
>>> GDAL_DISABLE_READDIR_ON_OPEN=EMPTY as env. var/config. option (this
>>> prevents probing for (most) side-car files. This is not something to use
>>> in general however.
>>
>> Thanks Even, that worked!
>>
>> Now onto MapServer :)  Unfortunately that same vsicurl superoverlay in
>> MapServer-master works on Ubuntu, but now on Windows.  Here is more
>> details:
>
> Hum I didn't try with MapServer, but looking at the GDAL request it does in the logs, I tried
> something close with gdal_translate:
>
> gdal_translate /vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml out2.tif -outsize 312 300
>
> and the good or bad news is that fails on both Ubuntu and Windows (well at least on wine/Linux) with
> a similar error to yours:
>
> VSICURL: Start download for http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/422.kml
> VSICURL: Stop download for http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/422.kml
> VSICURL: Start download for http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/422.JPEG
> VSICURL: Stop download for http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/422.JPEG
> GDAL: GDALOpen(/vsimem/kmlsuperoverlay/6_0x1d0f878, this=0x1d12bd0) succeeds as JPEG.
> GDAL: GDALDefaultOverviews::OverviewScan()
> GDAL: GDALDefaultOverviews::OverviewScan()
> ERROR 5: /vsimem/kmlsuperoverlay/3_0x1cf4ce8, band 1: Illegal nBlockXOff value (2) in GDALRasterBand::TryGetLockedBlockRef()
>
> ERROR 5: /vsimem/kmlsuperoverlay/3_0x1cf4ce8, band 1: Illegal nBlockXOff value (2) in GDALRasterBand::GetLockedBlockRef()
>
>
> Not sure why you get different results.
>
> Mind opening a GDAL ticket about that ? I'm debugging something else tricky right now ;-)

no problem, willdo, I know the feeling :)

-jeff



>
>>
>> Mapfile
>> =======
>>
>> MAP
>> NAME "superoverlay"
>> STATUS ON
>> SIZE 400 300
>> EXTENT -122.1293127 37.3727086 -122.0593424 37.4398034
>> UNITS DD
>> IMAGECOLOR 255 255 255
>>
>> LAYER
>>     NAME "mountain-view-superoverlay"
>>     TYPE RASTER
>>     STATUS ON
>>     #DATA "mv-doqq.kml"
>>     DATA
>> "/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml"
>>     CLASS
>>       NAME "Superoverlay"
>>       STYLE
>>       END
>>     END
>> END # layer
>>
>> END # Map File
>>
>> Test1: MapServer with superoverlay+VSICURL, on Windows
>> ======================================================
>>
>> shp2img -m superoverlay-kml.map -o ttt.png -all_debug 5
>>
>> result (fail)
>> -------------
>>
>> msLoadMap(): 0.000s
>> msDrawMap(): rendering using outputformat named png (AGG/PNG).
>> msDrawMap(): WMS/WFS set-up and query, 0.000s
>> msDrawRasterLayerLow(mountain-view-superoverlay): entering.
>> msDrawRasterLayerGDAL(): Entering transform.
>> msDrawRasterLayerGDAL(): src=0,0,16384,16384, dst=44,0,312,300
>> msDrawRasterLayerGDAL(): source raster PL (-4.888,-27.409) for dst PL
>> (44,0).
>> msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,4
>> drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed:
>> /vsimem/kmlsuperoverlay/3
>> _085CA378, band 1: Illegal nBlockXOff value (2) in
>> GDALRasterBand::GetLockedBlockRef()
>>
>> msDrawMap(): Image handling error. Failed to draw layer named
>> 'mountain-view-superoverlay'
>> .
>> msDrawMap(): Image handling error. Failed to draw layer named
>> 'mountain-view-superoverlay'
>> . <br>
>> drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed:
>> /vsimem/kmlsuperoverlay/3
>> _085CA378, band 1: Illegal nBlockXOff value (2) in
>> GDALRasterBand::GetLockedBlockRef()
>>    <br>
>> msFreeMap(): freeing map at 061BA7F0.
>> freeLayer(): freeing layer at 07273208.
>>
>> Test2: MapServer with superoverlay+VSICURL, on Ubuntu
>> ======================================================
>>
>> $ shp2img -m superoverlay-kml.map -o ttt.png -all_debug 5
>>
>> result (success)
>> ----------------
>>
>> [Thu Jan 14 18:20:02 2016].525687 msLoadMap(): 0.000s
>> [Thu Jan 14 18:20:02 2016].525906 msDrawMap(): rendering using
>> outputformat named png (AGG/PNG).
>> [Thu Jan 14 18:20:02 2016].525919 msDrawMap(): WMS/WFS set-up and query,
>> 0.000s
>> [Thu Jan 14 18:20:02 2016].527354
>> msDrawRasterLayerLow(mountain-view-superoverlay): entering.
>> [Thu Jan 14 18:20:11 2016].774926 msDrawRasterLayerGDAL(): Entering
>> transform.
>> [Thu Jan 14 18:20:11 2016].774950 msDrawRasterLayerGDAL():
>> src=0,0,16384,16384, dst=44,0,312,300
>> [Thu Jan 14 18:20:11 2016].774955 msDrawRasterLayerGDAL(): source raster
>> PL (-4.888,-27.409) for dst PL (44,0).
>> [Thu Jan 14 18:20:11 2016].774969 msDrawRasterLayerGDAL():
>> red,green,blue,alpha bands = 1,2,3,4
>> [Thu Jan 14 18:20:13 2016].225477 msDrawMap(): Layer 0
>> (mountain-view-superoverlay), 10.700s
>> [Thu Jan 14 18:20:13 2016].225507 msDrawMap(): Drawing Label Cache, 0.000s
>> [Thu Jan 14 18:20:13 2016].225512 msDrawMap() total time: 10.700s
>> [Thu Jan 14 18:20:13 2016].244934 msSaveImage(ttt.png) total time: 0.019s
>> [Thu Jan 14 18:20:13 2016].244971 msFreeMap(): freeing map at 0x15256f0.
>> [Thu Jan 14 18:20:13 2016].244994 freeLayer(): freeing layer at 0x152d120.
>> [Thu Jan 14 18:20:13 2016].245030 shp2img total time: 10.720s
>>
>>
>>
>> -jeff
>




More information about the MapServer-users mailing list