[gdal-dev] gdal_translate wms error

Even Rouault even.rouault at mines-paris.org
Wed Aug 17 14:05:49 EDT 2011


Le mercredi 17 août 2011 09:36:44, symbian11 a écrit :
> Hi, I am trying to download some image data from a private WMS.
> 
> When I try to use gdal_translate I receive the following error (I had to
> remove the server address):
> 
> ERROR 1: GDALWMS: Unable to download block 337235, 219173.
>   URL:
> http://SERVERADDRESS&request=GetMap&version=1.1.0&layers=Orthophoto%2CLuftb
> ild_25cm%2CLuftbild_1m%2CLuftbild_4m%2CSatellitenbild_30m
> &styles=&srs=EPSG:3857&transparent=TRUE&format=image/png&width=256&height=
> 256&bbox=1545531.75694187,6010372.27699605,1545595.75694216,6010436.2769963
> 3 HTTP status code: 0, error: Recv failure: Connection was reset.
> ERROR 1: IReadBlock failed at X offset 337235, Y offset 219173
> 
> But when I copy the URL from the error message and use it in my browser it
> works fine.

That might be a sign that your WMS server doesn't support well the load of 
requests sent by the client and sometimes return an error (the "Connection was 
reset" is a likely sign that the server has given up at some point). Whereas 
when you try in your browser, it is not overloaded.

You could perhaps try to decrease the value of the <MaxConnections> parameter.

Ideally, we would perhaps need a parameter to specify a number of retries and 
a delay between them to workaround that behaviour of servers.

> 
> Here is the XML (I was not sure which parameters to use for the DataWindow.
> I just chose SizeX/Y to be four times the extent because the resolution is
> 25cm.)
> 
> <GDAL_WMS>
>     <Service name="WMS">
> <ServerUrl>SERVERADRESS</ServerUrl>
> <Layers>Orthophoto%2CLuftbild_25cm%2CLuftbild_1m%2CLuftbild_4m%2CSatelliten
> bild_30m </Layers>
> <SRS>EPSG:3857</SRS>
> <Transparent>TRUE</Transparent>
> <ImageFormat>image/png</ImageFormat>
>     </Service>
> 
>     <DataWindow>
>         <UpperLeftX>-20037508.34</UpperLeftX>
>         <UpperLeftY>20037508.34</UpperLeftY>
>         <LowerRightX>20037508.34</LowerRightX>
>         <LowerRightY>-20037508.34</LowerRightY>
>         <SizeX>160300066.72</SizeX>
>         <SizeY>160300066.72</SizeY>
>         <YOrigin>top</YOrigin>
>     </DataWindow>
> 
>     <Projection>EPSG:3857</Projection>
>     <BlockSizeX>256</BlockSizeX>
>     <BlockSizeY>256</BlockSizeY>
>     <BandsCount>3</BandsCount>
>     <MaxConnections>5</MaxConnections>
> </GDAL_WMS>
> 
> Here are the WMS Capabilities:
> 
> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
> &lt;!DOCTYPE WMT_MS_Capabilities SYSTEM
> &quot;http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd&quot;
> [
> &lt;!ELEMENT VendorSpecificCapabilities EMPTY&gt;
> ]>
> 
> <WMT_MS_Capabilities version="1.1.1">
> 
> 
> 
> <Service>
> <Name>OGC:WMS</Name>
> <Title>Orthofoto-Revital</Title>
> <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/>
> <ContactInformation>
> </ContactInformation>
> </Service>
> 
> <Capability>
> <Request>
> <GetCapabilities>
> <Format>application/vnd.ogc.wms_xml</Format>
> <DCPType>
> <HTTP>
> <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Get>
> <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Post>
> </HTTP>
> </DCPType>
> </GetCapabilities>
> <GetMap>
> <Format>image/png</Format>
> <Format>image/jpg</Format>
> <Format>image/gif</Format>
> <Format>image/png; mode=24bit</Format>
> <Format>image/wbmp</Format>
> <Format>image/tiff</Format>
> <Format>image/svg+xml</Format>
> <DCPType>
> <HTTP>
> <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Get>
> <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Post>
> </HTTP>
> </DCPType>
> </GetMap>
> <GetFeatureInfo>
> <Format>text/plain</Format>
> <Format>application/vnd.ogc.gml</Format>
> <DCPType>
> <HTTP>
> <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Get>
> <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Post>
> </HTTP>
> </DCPType>
> </GetFeatureInfo>
> <DescribeLayer>
> <Format>text/xml</Format>
> <DCPType>
> <HTTP>
> <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Get>
> <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Post>
> </HTTP>
> </DCPType>
> </DescribeLayer>
> <GetLegendGraphic>
> <Format>image/png</Format>
> <Format>image/jpg</Format>
> <Format>image/gif</Format>
> <Format>image/png; mode=24bit</Format>
> <Format>image/wbmp</Format>
> <DCPType>
> <HTTP>
> <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Get>
> <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Post>
> </HTTP>
> </DCPType>
> </GetLegendGraphic>
> <GetStyles>
> <Format>text/xml</Format>
> <DCPType>
> <HTTP>
> <Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Get>
> <Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
> xlink:href="SERVERADDRESS;"/></Post>
> </HTTP>
> </DCPType>
> </GetStyles>
> </Request>
> <Exception>
> <Format>application/vnd.ogc.se_xml</Format>
> <Format>application/vnd.ogc.se_inimage</Format>
> <Format>application/vnd.ogc.se_blank</Format>
> </Exception>
> <VendorSpecificCapabilities />
> <UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1"
> RemoteWFS="0"/>
> <Layer>
> <Name>Orthofoto-Revital</Name>
> <Title>Orthofoto-Revital</Title>
> <SRS>EPSG:31287</SRS>
> <SRS>EPSG:4326</SRS>
> <SRS>EPSG:3857</SRS>
> <SRS>EPSG:900913</SRS>
> <LatLonBoundingBox minx="9.35676" miny="46.0872" maxx="17.3099"
> maxy="49.2092" />
> <BoundingBox SRS="EPSG:31287"
> minx="110000" miny="250000" maxx="690000" maxy="590000" />
> <Layer>
> <Name>Orthophoto</Name>
> <Title>Orthophoto</Title>
> <Abstract>Orthophoto</Abstract>
> <Layer queryable="0" opaque="0" cascaded="0">
> <Name>Luftbild_25cm</Name>
> <Title>Luftbild_25cm_LB</Title>
> <SRS>EPSG:31287</SRS>
> <SRS>EPSG:4326</SRS>
> <SRS>EPSG:3857</SRS>
> <SRS>EPSG:900913</SRS>
> <ScaleHint min="0" max="1.99561139371855" />
> </Layer>
> <Layer queryable="0" opaque="0" cascaded="0">
> <Name>Luftbild_1m</Name>
> <Title>Luftbild_1m_LB</Title>
> <SRS>EPSG:31287</SRS>
> <SRS>EPSG:4326</SRS>
> <SRS>EPSG:3857</SRS>
> <SRS>EPSG:900913</SRS>
> <ScaleHint min="1.74665887235216" max="7.73299415065938" />
> </Layer>
> <Layer queryable="0" opaque="0" cascaded="0">
> <Name>Luftbild_4m</Name>
> <Title>Luftbild_4m_LB</Title>
> <SRS>EPSG:31287</SRS>
> <SRS>EPSG:4326</SRS>
> <SRS>EPSG:3857</SRS>
> <SRS>EPSG:900913</SRS>
> <ScaleHint min="7.48404162929299" max="75.0848786886604" />
> </Layer>
> <Layer queryable="0" opaque="0" cascaded="0">
> <Name>Satellitenbild_30m</Name>
> <Title>Satellitenbild_30m</Title>
> <SRS>EPSG:31287</SRS>
> <SRS>EPSG:4326</SRS>
> <SRS>EPSG:3857</SRS>
> <SRS>EPSG:900913</SRS>
> <ScaleHint min="74.835926167294" max="4989.02848429637" />
> </Layer>
> </Layer>
> </Layer>
> </Capability>
> </WMT_MS_Capabilities>
> 
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/gdal-translate-wms-error-tp6694505p
> 6694505.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