0

I would like to print a map with the Mapfish Print Plugin. As a service a WMTS is used. Here is the link to the service: WMTS Capabilities

Here is the link to the Mapfish Print Documentation: Mapfish Print Doc (WMTS)

My JSON has the following structure:

{
        "layout": "A4 landscape",
        "outputFormat": "pdf",
        "attributes": {
            "datasource": [],
            "comments": "",
            "map": {
                "projection": "EPSG:900913",
                "dpi": 100,
                "center": [center.lon, center.lat],
                "scale": scale,
                "layers": [                                                                        
                    {
                        "baseURL": "http://kartendienste.kreis-borken.de/arcgis/rest/services/Basiskarte/Basiskarte_Kreis_Borken_WM/MapServer/WMTS/tile/1.0.0/Basiskarte_Basiskarte_Kreis_Borken_WM/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
                        "imageFormat": "image/png",
                        "requestEncoding": "REST",
                        "layer": "Basiskarte_Basiskarte_Kreis_Borken_WM",
                        "type": "WMTS",
                        "style": "Default Style",
                        "matrixSet": "EPSG:900913",
                        "matrices": [{
                            "identifier": "0",
                            "matrixSize": [1, 1],
                            "scaleDenominator": 559082264.0287178,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "1",
                            "matrixSize": [2, 2],
                            "scaleDenominator": 279541132.0143589,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "2",
                            "matrixSize": [4, 4],
                            "scaleDenominator": 139770566.0071794,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "3",
                            "matrixSize": [8, 8],
                            "scaleDenominator": 69885283.00358972,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "4",
                            "matrixSize": [16, 16],
                            "scaleDenominator": 34942641.50179486,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "5",
                            "matrixSize": [32, 32],
                            "scaleDenominator": 17471320.75089743,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "6",
                            "matrixSize": [64, 64],
                            "scaleDenominator": 8735660.375448715,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "7",
                            "matrixSize": [128, 128],
                            "scaleDenominator": 4367830.187724357,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "8",
                            "matrixSize": [256, 256],
                            "scaleDenominator": 2183915.093862179,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "9",
                            "matrixSize": [512, 512],
                            "scaleDenominator": 1091957.546931089,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "10",
                            "matrixSize": [1024, 1024],
                            "scaleDenominator": 545978.7734655447,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "11",
                            "matrixSize": [2048, 2048],
                            "scaleDenominator": 272989.3867327723,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "12",
                            "matrixSize": [4096, 4096],
                            "scaleDenominator": 136494.6933663862,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "13",
                            "matrixSize": [8192, 8192],
                            "scaleDenominator": 68247.34668319309,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "14",
                            "matrixSize": [16384, 16384],
                            "scaleDenominator": 34123.67334159654,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "15",
                            "matrixSize": [32768, 32768],
                            "scaleDenominator": 17061.83667079827,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "16",
                            "matrixSize": [65536, 65536],
                            "scaleDenominator": 8530.918335399136,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }, {
                            "identifier": "17",
                            "matrixSize": [131072, 131072],
                            "scaleDenominator": 4265.459167699568,
                            "tileSize": [256, 256],
                            "topLeftCorner": [-20037508.34278925, 20037508.34278925]
                        }]
                    }
                ]
            },
            "scalebar": {
                "align": "right"
            }
        }
    }

As a result I receive currently a pink background. This means that no tiles could be loaded.

Has my JSON false attributes or I use the wrong URL?

  • I've just encountered the same problem. Has anybody found the solution/reason why this thing happens? – SOULPWRD Mar 6 '17 at 18:02
  • Unfortunately, no solution was found for the problem. – eftas Mar 8 '17 at 7:30
1

Use EPSG:3857 projection instead of EPSG:900913.

The WMTS GetCapabilities response doesn't advertise that it supports EPSG:900913 instead it advertises:

<ows:SupportedCRS>urn:ogc:def:crs:EPSG:6.18.3:3857</ows:SupportedCRS>

Even though EPSG:3857 and EPSG:900913 describe the same CRS, you must use the CRS advertised.

  • I'm not so sure it is to do with the GetCapabilities for this particular point as it is using a RESTful URL. The problem lies with Mapfish print and EPSG:900913 (It causes an error). Also I just noticed the maxtrixSet should be "GoogleMapsCompatible" and the style part missing from the baseURL - It needs to match the format of the advertised RESTful URL. And in this case it should be "default". I can't comment on the original. I just came across the EPSG:900913 issue today and stumbled on the post in a rush. Some answer better than no answer? – Ryan How Sep 22 '17 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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