0

I want to provide a function that allows users to download cropped raster layer stored in GeoServer on client side. For this purpose, I used GeoServer WPS gs:download process. This is the code I'm using for downloading:

let xhr = new XMLHttpRequest();
xhr.open('POST', 'http://localhost:8080/geoserver/ows?service=wps', true);
xhr.setRequestHeader('Content-Type', 'text/xml');
xhr.onload = function() {};
xhr.send(xmlRequest);

And this is the XML file I sent:

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
    <ows:Identifier>gs:Download</ows:Identifier>
    <wps:DataInputs>
        <wps:Input>
            <ows:Identifier>layerName</ows:Identifier>
            <wps:Data>
                <wps:LiteralData>saxony:dresden_dop</wps:LiteralData>
            </wps:Data>
        </wps:Input>
        <wps:Input>
            <ows:Identifier>outputFormat</ows:Identifier>
            <wps:Data>
                <wps:LiteralData>image/tiff</wps:LiteralData>
            </wps:Data>
        </wps:Input>
        <wps:Input>
            <ows:Identifier>RoiCRS</ows:Identifier>
            <wps:Data>
                <wps:LiteralData>EPSG:25833</wps:LiteralData>
            </wps:Data>
        </wps:Input>
        <wps:Input>
            <ows:Identifier>ROI</ows:Identifier>
            <wps:Data>
                <wps:ComplexData mimeType="application/wkt">&lt;![CDATA[POLYGON (( 401427.7604598588 5658195.9497047, 402604.46020956617 5658195.9497047, 402604.46020956617 5659343.11570035, 401427.7604598588 5659343.11570035, 401427.7604598588 5658195.9497047 ))]]&gt;</wps:ComplexData>
            </wps:Data>
        </wps:Input>
    </wps:DataInputs>
    <wps:ResponseForm>
        <wps:RawDataOutput mimeType="application/octet-stream">
            <ows:Identifier>result</ows:Identifier>
        </wps:RawDataOutput>
    </wps:ResponseForm>
</wps:Execute>

It worked in the WPS Request Builder with the same XML file content. But it failed on the client side when I sent the request. I got the error:

java.lang.IllegalArgumentException: Download Limits Exceeded. Unable to proceed!

And no matter how small the cropped region is, I always get this error.

I turned on the logging to developer, sent the request again and then got this logging messages:

DEBUG [org.geoserver.wps.gs.download] - The underlying reader is not structured; returning native resolution
DEBUG [org.geoserver.wps.gs.download] - Area to read in pixels: 1200000000
DEBUG [org.geoserver.wps.gs.download] - Area exceeds the limits
DEBUG [org.geoserver.wps.gs.download] - Download failed

It seems that the original file exceeds the limit but what I actually want to download is a small region of the original file.

Is there any way to solve this question other than changing the corresponding parameter limit?

3
  • You need to turn up the logging level to developer in the global settings page, and then make the request again. Then edit your question with the relevant part of the log file.
    – Ian Turton
    Commented Jul 4, 2022 at 14:02
  • @ianturton Hi, thanks for the reminder! I just edited and added the logging messages.
    – XH4869
    Commented Jul 4, 2022 at 14:49
  • looks like you need to adjust the limits - I'm not sure if that is a WMS or WCS request or if the limit is in the downloader
    – Ian Turton
    Commented Jul 4, 2022 at 14:57

1 Answer 1

0

Read the documentation on how to setup the download limits, and configure them accordingly:

https://docs.geoserver.org/latest/en/user/extensions/wps-download/index.html#configuring-the-limits

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.