[mapserver-users] kml superoverlays

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Jan 14 12:31:24 PST 2016


On 2016-01-14 4:22 PM, Jeff McKenna wrote:
> On 2016-01-13 1:20 PM, Even Rouault wrote:
>> Le mercredi 13 janvier 2016 17:59:46, Páll Péter Hunor a écrit :
>>> Hi,
>>>
>>> Thanks for tip, I already have seen that option, but I have not found
>>> any example how to use it.
>>> Does anybody have any experience with that?
>>
>> You can refer to general raster input documentation :
>> http://mapserver.org/input/raster.html
>>
>> Check first with gdalinfo that the KML superoverlay is properly
>> recognized. If
>> that works, you should also be able to open it in a desktop GIS such
>> as QGIS.
>>
>>>
>>> Hunor
>>>
>>> On 2016.01.13. 17:32, Even Rouault wrote:
>>>> Le mercredi 13 janvier 2016 17:15:12, Páll Péter Hunor a écrit :
>>>>> Hi,
>>>>>
>>>>> Does mapserver support raster layers using kml superoverlays as data
>>>>> source, similar to shapefile based tileindexes?
>>>>> I did not find any solution, but I still might exist...
>>>>> Thanks in advance.
>>>>
>>>> GDAL supports opening kml superoverlays file as rasters (probably with
>>>> some caveats), so you can try adding DATA your.kml or your.kmz in the
>>>> mapfile.
>>>>
>>>> (no docs apart mentionning it in
>>>> http://gdal.org/formats_list.html )
>>>>
>>>>> Regards,
>>>>> Hunor
>>
>
> This caught my interest yesterday, so I did some testing locally with a
> KML superoverlay.  I used the file referenced in the KML reference doc:
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml
>
> What I found was that I have troubles getting GDAL to read this file on
> Windows, yet no problems with Ubuntu.
>
> I compile GDAL from source for both Windows and Ubuntu. To be honest, at
> first I thought the issue must be because on Windows I was using GDAL
> 2.0.1, and on Ubuntu I am using GDAL-trunk; but today I did a fresh
> build of GDAL-trunk on Windows, and the same problem exists. I'm sharing
> this because I am stuck on why this occurs.  Here is more details:
>
> Test 1: VSICURL to a remote GeoTIFF, on Windows
> ===============================================
>
> gdalinfo
> /vsicurl/http://svn.osgeo.org/gdal/trunk/autotest/utilties/data/pyramid_shaded_ref.tif
>
>
> result: expected details on the tif extents etc.
>
> Test 2: VSICURL to the remote KML Superoverlay, on Windows
> ==========================================================
>
> gdalinfo
> /vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml
>
> gdalinfo failed - unable to open
> '/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml'.
>
>
> Test 3: VSICURL to the remote KML Superoverlay, on Windows, with debug
> ======================================================================
>
> gdalinfo --config CPL_DEBUG ON
> /vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml
>
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml)=0
>   r
> esponse_code=200
> VSICURL:
> GetFileList(/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples)
> VSICURL: Downloading 0-18446744073709551615
> (http://mw1.google.com/mw-earth-vectordb/kml-s
> amples/mv-doqq.kml)...
> VSICURL: Got response_code=206
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.hdr)=0
>   r
> esponse_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.HDR)=0
>   r
> esponse_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml.hdr)=
>
> 0  response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml.HDR)=
>
> 0  response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/MV-DOQQ.HDR)=0
>   r
> esponse_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.aux)=0
>   r
> esponse_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.AUX)=0
>   r
> esponse_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml.xml)=
>
> 0  response_code=404
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/
> 1.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/1
> .kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501\
> 1.JPEG
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501\1
> .JPEG
> OGRDB2DriverOpen: pszFilename:
> '/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-sampl
> es/mv-doqq.kml'

Could this 'OGRDB2DriverOpen' be the issue?  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').

> gdalinfo failed - unable to open
> '/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-sam
> ples/mv-doqq.kml'.
>
> Test 4: VSICURL to the remote KML Superoverlay, on Ubuntu, with debug
> =====================================================================
>
> $ gdalinfo --config CPL_DEBUG ON
> /vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml
>
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml)=0
>   response_code=200
> VSICURL:
> GetFileList(/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples)
> VSICURL: Downloading 0-18446744073709551615
> (http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml)...
> VSICURL: Got reponse_code=206
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.hdr)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.HDR)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml.hdr)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml.HDR)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/MV-DOQQ.HDR)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.aux)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.AUX)=0
>   response_code=404
> VSICURL:
> GetFileSize(http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml.xml)=0
>   response_code=404
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/1.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/1.kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/1.JPEG
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/1.JPEG
> GDAL: GDALOpen(/vsimem/kmlsuperoverlay/0_0x14862f8, this=0x149fc60)
> succeeds as JPEG.
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/2.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/2.kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/3.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/3.kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/4.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/4.kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/5.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/5.kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/6.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/6.kml
> VSICURL: Start download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/7.kml
> VSICURL: Stop download for
> http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-070501/7.kml
> GDAL:
> GDALOpen(/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml,
> this=0x14a6280) succeeds as KMLSUPEROVERLAY.
> Driver: KMLSUPEROVERLAY/Kml Super Overlay
> Files:
> /vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml
> Size is 16384, 16384
> Coordinate System is:
> GEOGCS["WGS 84",
>      DATUM["WGS_1984",
>          SPHEROID["WGS 84",6378137,298.257223563,
>              AUTHORITY["EPSG","7030"]],
>          TOWGS84[0,0,0,0,0,0,0],
>          AUTHORITY["EPSG","6326"]],
>      PRIMEM["Greenwich",0,
>          AUTHORITY["EPSG","8901"]],
>      UNIT["degree",0.0174532925199433,
>          AUTHORITY["EPSG","9108"]],
>      AUTHORITY["EPSG","4326"]]
> Origin = (-122.129312658577717,37.439803353779496)
> Pixel Size = (0.000004270647777,-0.000004095141704)
> Metadata:
>    DESCRIPTION=The original is a 7008 x 6720 DOQQ of Mountain View in
> 1991. (Source:
>        http://gis.ca.gov/). This is a Region NetworkLink hierarchy of 900+
>        GroundOverlays each of 256 x 256 pixels arranged in a hierarchy such
>        that more detailed images are loaded and shown as the viewpoint
> nears.
>        Enable the "Boxes" NetworkLink to see a LineString for
>        each Region. Tour the "Boxes" to visit each tile. Visit the
>        "A" and "B" Placemarks to see multiple levels of
>        hierarchy together. Use the slider on various images in the
> hierarchy
>        to see how the resolution varies and of the entire hierarchy to see
>        the imagery below. (Find the Google Campus...).
>
>    NAME=SuperOverlay: MV DOQQ
> Image Structure Metadata:
>    INTERLEAVE=PIXEL
> OGRCT: PROJ >= 4.8.0 features enabled
> OGRCT: Source: +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
> OGRCT: Target: +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
> Corner Coordinates:
> Upper Left  (-122.1293127,  37.4398034) (122d 7'45.53"W, 37d26'23.29"N)
> Lower Left  (-122.1293127,  37.3727086) (122d 7'45.53"W, 37d22'21.75"N)
> Upper Right (-122.0593424,  37.4398034) (122d 3'33.63"W, 37d26'23.29"N)
> Lower Right (-122.0593424,  37.3727086) (122d 3'33.63"W, 37d22'21.75"N)
> Center      (-122.0943275,  37.4062560) (122d 5'39.58"W, 37d24'22.52"N)
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red
>    Overviews: 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512, 256x256
>    Mask Flags: PER_DATASET ALPHA
>    Overviews of mask band: 8192x8192, 4096x4096, 2048x2048, 1024x1024,
> 512x512, 256x256
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green
>    Overviews: 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512, 256x256
>    Mask Flags: PER_DATASET ALPHA
>    Overviews of mask band: 8192x8192, 4096x4096, 2048x2048, 1024x1024,
> 512x512, 256x256
> Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
>    Overviews: 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512, 256x256
>    Mask Flags: PER_DATASET ALPHA
>    Overviews of mask band: 8192x8192, 4096x4096, 2048x2048, 1024x1024,
> 512x512, 256x256
> Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha
>    Overviews: 8192x8192, 4096x4096, 2048x2048, 1024x1024, 512x512, 256x256
> GDAL: GDALClose(/vsimem/kmlsuperoverlay/0_0x14862f8, this=0x149fc60)
> GDAL:
> GDALClose(/vsicurl/http://mw1.google.com/mw-earth-vectordb/kml-samples/mv-doqq.kml,
> this=0x14a6280)
>

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


More information about the mapserver-users mailing list