geosolutions-it/mapfish-print

Map projection selection for printing

Opened this issue · 1 comments

We want to allow the user to select an alternative CRS for the printed map from the MapStore / GeoNode printing dialog.

New Wireframe 1

We will introduce a reprojection phase of all the stuff to be printed, so that the map is printed using a user-selected projection. For sure we would have to reproject:

  • The map bbox (or center and scale)
  • Vector data
  • BBOX of wms layers

Some types of layers are not, by nature, reprojection friendly, so we would exclude those layers from the printed map, if reprojection occurs (a warning to the user could be displayed in this case. These layers may include WMTS and TMS ones (OSM and similar too), and all the vendor API based ones (google, bing, etc.). We could also check that WMS layers support the chosen CRS (using capabilities). We could somehow use the already existing engine that does the same when the screen map is in a CRS different from EPSG:3857.

Also, CRS may be incompatible, depending on the current bbox, so it may not be possible to reproject the current map at every position and scale (for example, UTM zones are valid only on a specific area). We may advise the user when reprojection is not possible.

Final concern: the map preview would be inconsistent with the printed map when a CRS different than the screen one is selected, so we will hide the map preview box when this happens, with a notice for the user on why the preview map is not shown.

This requires some work at the MapStore level:

  • adding support in MapStore for additional (custom) fields in the printing dialog, as plugins of the printing dialog (#39)
  • adding support for custom spec to mapfish payload transformer pipeline (#40)
  • adding support for custom validation on the printing dialog (#41)
  • implement reprojection of vector layers / annotations (geosolutions-it/MapStore2#7747)

And some work as a custom plugin:

  • implementing a configurable CRS selector as a printing dialog plugin (it should allow listing the allowed CRSs, so that only those requested by AIT are shown, EPSG:3857, EPSG:4326, EPSG:32647, EPSG:32648), that would store the user selection in the printing spec; eventually reuse part of the CRS selector plugin, refactoring where needed
  • implementing and configuring a reprojection step for the spec to mapfish transformer
  • implement custom validation that will notify the user of layers non supported to print on the selected CRS, or of an invalid area for reprojection (geosolutions-it/MapStore2#7748)