2

I'm using Mapfish Print v3 to print a layer from the following link:

http://webapps.sit.puglia.it/arcgis/services/Background/TNOInquadramento/MapServer/WMSServer

To test the printing function I'm using the Test Print page shipped with the 3.3 shapshot. Unfortunately any single attempt I've done so far has been unsuccessful: the pdf file produced always renders a blank map.

Still I can load all the layers into ArcGIS. So I guess the problem must be on my Mapfish configuration/JSON request.

I tested my config.yaml and JSON request against the following link:

http://webapps.sit.puglia.it/arcgis/services/BaseMaps/Ortofoto2013/ImageServer/WMSServer

and it worked fine (although no matter the layers' names in the JSON request, I always got the correct result, anyway...).

This is my config.yaml:

templates:
  #===========================================================================
  A4 landscape: !template
  #===========================================================================
    reportTemplate: simpleReport.jrxml
    attributes:
      map: !map
        maxDpi: 400
        width: 780
        height: 330
    processors:
    - !reportBuilder # compile all reports in current directory
      directory: '.'
    - !createMap
      inputMapper: {map: map}
      outputMapper: {mapSubReport: map}
    - !configureHttpRequests
          httpProcessors:
          - !restrictUris
            matchers:
            - !ipMatch
              ip: webapps.sit.puglia.it

I've made sure to allow the use of the server.

This is my JSON request:

{
    "attributes": {"map": {
        "bbox": [
            2251632.4276,
            4054757.3924,
            2835795.3321,
            5221314.5428 
        ],
        "dpi": 72,
        "layers": [{
            "baseURL": "http://webapps.sit.puglia.it/arcgis/services/Background/TNOInquadramento/MapServer/WMSServer",
            "customParams": {
                "EXCEPTIONS": "INIMAGE",
                "TRANSPARENT": "true"
            },
            "imageFormat": "image/png",
            "layers": ["Confini Provinciali"],
            "type": "WMS",
            "version": "1.3.0"
        }],
        "projection": "EPSG:3004",
        "rotation": 0
    }},
    "layout": "A4 landscape"
}

Actually using the layer's name I get the following error:

Parameter 'layers' contains unacceptable layer names.

which I solved using the layer id.

So what's wrong with the first service? Is it some peculiarity of the service or is it my own Mapfish instance?

1 Answer 1

1

Ok, the problem was that I was requesting the wrong layer.

As stated in the question, for some reason Mapfish has problems loading the layer by its name so I had to find the layer by ID.

To do this I loaded the layer on ArcGIS and gathered its ID from ArcGIS description (right-click on the layer).

But apparently this description is relative to the rest ArcGIS server proprietary protocol, while I have to refer to the WMS capabilities.

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.