[mapserver-users] Mapserver - cascading a remote ESRI REST service

Robert Sanson Robert.Sanson at asurequality.com
Wed Apr 27 15:12:59 PDT 2016


Thanks for that. 

What values should I use for <SizeX> and <SizeY> in the DataWindow section when the service is a tiled cache made up of many different images with differing pixel resolutions?

Thanks,

Robert

-----Original Message-----
From: Even Rouault [mailto:even.rouault at spatialys.com] 
Sent: Wednesday, 27 April 2016 8:48 p.m.
To: mapserver-users at lists.osgeo.org
Cc: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>; Robert Sanson <Robert.Sanson at asurequality.com>
Subject: Re: [mapserver-users] Mapserver - cascading a remote ESRI REST service

Le mercredi 27 avril 2016 09:32:36, Rahkonen Jukka (MML) a écrit :
> Hi,
> 
> I copied your XML definition file and made a test with GDAL. My 
> command
> was: gdal_translate -outsize 400 400 rest.xml out.tif --debug o
> 
> Result is an error:
> 
> 0ERROR 1: GDALWMS: Unable to download block 0, 0.
>   URL:
> http://maps.six.nsw.gov.au/arcgis/rest/services/sixmaps/LPI_Imagery_Be
> st/
> MapServer
>    
> /export?f=image&bbox=15300000.00000000,-5070000.00000000,17810000.0000
> 0000
> ,-
> 2950000.00000000&size=256,256&dpi=&imageSR=3857&bboxSR=3857&format=ima
> ge/j
> peg&la
> yerdefs=&layers=&transparent=false&time=&layerTimeOptions=&dynamicLaye
> rs=
> HTTP status code: 400, error: (null).
> Add the HTTP status code to <ZeroBlockHttpCodes> to ignore that error 
> (see
> http: //www.gdal.org/frmt_wms.html).
> ERROR 1: rest.xml, band 1: IReadBlock failed at X offset 0, Y offset 0
> 
> With another proxy I get similar error but different code HTTP status 
> code: 0, error: (null).
> 
> The request is OK and shows a map when sent through a browser.
> 
> Fiddler proxy gives a short explanation about what goes wrong and it 
> says that the request headers can’t be parsed. I do not understand 
> what it means but it looks obvious that the issue is in GDAL, not in Mapserver.
> 
> Even R. may be reading but you can also send mail to gdal-dev list. 
> Include your XML file and ask why gdal_translate -outsize 400 400 
> rest.xml out.tif --debug o gives an error.
> 
> 
> -Jukka Rahkonen-
> 
> Robert Sanson wrote:
> 
> 
> Hi
> 
> I am trying to cascade a remote ESRI REST image service via my 
> Mapserver mapfile.
> 
> Here is my XML file:
> 
> <GDAL_WMS>
>   <Service name="AGS">
>     <ServerUrl>
>      
> http://maps.six.nsw.gov.au/arcgis/rest/services/sixmaps/LPI_Imagery_Be
> st/M
> apServer </ServerUrl>

--> white spaces and newline matter inside a XML element (at least for 
--> the XML
parser used by GDAL). If you remove them, like the following, it will work

<ServerUrl>http://maps.six.nsw.gov.au/arcgis/rest/services/sixmaps/LPI_Imagery_Best/MapServer</ServerUrl>

>     <BBoxOrder>xyXY</BBoxOrder>
>     <SRS>3857</SRS>
>     <ImageFormat>image/jpeg</ImageFormat>
>   </Service>
>   <DataWindow>
>     <UpperLeftX>1.53E7</UpperLeftX>
>     <UpperLeftY>-2950000.0</UpperLeftY>
>     <LowerRightX>1.781E7</LowerRightX>
>     <LowerRightY>-5070000.0</LowerRightY>
>     <SizeX>256</SizeX><SizeY>256</SizeY>
>   </DataWindow>
> </GDAL_WMS>
> 
> Here is my mapfile layer:
> 
> LAYER
>   NAME sixmaps
>   GROUP 'highres'
>   TYPE RASTER
>   STATUS ON
>   DATA "/mnt/gisdata/data/aus/sixmaps.xml"
>   PROCESSING "OVERSAMPLE_RATIO=1.0"
>   PROJECTION
>     "init=epsg:3857"
>   END
>   METADATA
>     "wms_title" "sixmaps"
>     "wms_name" "sixmaps"
>     "wms_srs" "EPSG:3857"
>   END
> END
> 
> When I try and request a map using a WMS GetMap request, this is the 
> error message I get:
> 
> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?> <!DOCTYPE 
> ServiceExceptionReport SYSTEM 
> "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
> <ServiceExceptionReport version="1.1.1"> <ServiceException>
> msDrawMap(): Image handling error. Failed to draw layer named 
> 'sixmaps'. drawGDAL(): Unable to access file.
> GDALDatasetRasterIO() failed: GetBlockRef failed at X block offset 0, 
> Y block offset 0 </ServiceException> </ServiceExceptionReport>
> 
> Can anyone point out where the problem is?
> 
> Many thanks,
> 
> Robert L. Sanson

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the mapserver-users mailing list