georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

Printing with non standard SRS #495

Open jusabatier opened 2 years ago

jusabatier commented 2 years ago

On our platform, Mapstore2 is configured with EPSG:2154

All of our backgrounds load tiles from EPSG:2154 grids, and it work well on the map.

But when we use the printing tool, the preview tool send request to get background in 3857 SRS. So, as our WMTS are not provided in other TileMatrix sets than EPSG:2154, it result in an error 400 :

<ExceptionReport xmlns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://geowebcache.org/schema/ows/1.1.0/owsExceptionReport.xsd">
<Exception exceptionCode="InvalidParameterValue" locator="TILEMATRIXSET">
<ExceptionText>Unable to match requested TILEMATRIXSET EPSG:3857 to those supported by layer</ExceptionText>
</Exception>
</ExceptionReport>

And the backround layer is not show in the preview and in the printed pdf (blank).

jusabatier commented 2 years ago

After some investigations, the generated PDF show the background, but the preview still show no background due to loading it in 3857 instead of the current used SRS.

jusabatier commented 2 years ago

I just have some returns from users as we deploy MS2 available for end users.

I appear that there are also problems with printing preview area and scale on our instance...

In summary :

I use this config for print plugin :

{
  "cfg": {
    "useFixedScales": true,
    "mapPreviewOptions": {
      "enableScalebox": true
    },
    "overrideOptions": {
      "geodetic": true
    }
  },
  "override": {}
}

And our mapstore is configured to use EPSG:2154.

Can I have some returns for these problems as they are critical, because they block the print function.

@tdipisa ?

tdipisa commented 2 years ago

@jusabatier it would be good if you can provide the following, so that we will do a check as soon as we can.

jusabatier commented 2 years ago

Here is a public context : https://geoportail.lepuyenvelay.fr/mapstore/#/context/Cadastre The used localConfig is this one : https://geoportail.lepuyenvelay.fr/mapstore/configs/localConfig.json And the defined context is this one : https://geoportail.lepuyenvelay.fr/mapstore/rest/geostore/misc/category/name/CONTEXT/resource/name/Cadastre

The use case :

  1. Load context and close Cadastrapp
  2. Open print popup
  3. At this point, the scale in the combobox is 1:350000 so :
    • It's ok as the current map scale is 1:366999 and it's the nearest in list
    • But the preview isn't at this scale (it look to be a lot lower)
    • The background is blank (try to load WMTS layer with SRS 3857, but should use 2154 as configured)
  4. Try to zoom and unzoom the map, there still be problems with scale :
    • The combobox scale doesn't adapt correctly to the current map scale (nearest value)
    • The preview doesn't show the good scale (current combobox selection)

Is it good for you ? Tell me if you need other infos.

tdipisa commented 2 years ago

Thank you @jusabatier we will try to do a quick check as soon as we can to get back to you.

Gaetanbrl commented 1 year ago

But the preview isn't at this scale (it look to be a lot lower)

I think reproduce same wrong print preview with EPSG:32620

image

Added to localConfig :

{
      "code": "EPSG:32620",
      "def": "+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs +type=crs",
      "extent": [166021.44, 0.0, 833978.56, 9329005.18],
      "worldExtent": [-66.0, 0.0, -60.0, 84.0]
    }