qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

Printing fails when a layer created by qwc2 is added #505

Closed mhaelsig closed 7 months ago

mhaelsig commented 7 months ago

With the Drawing Tool I created a temporary layer (Redlining.json), which I attach, and wanted to print the resulting map. Print fails with

<?xml version="1.0" encoding="UTF-8"?> <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc"> <ServiceException code="Invalid Parameter">HIGHLIGHT_GEOM ('POLYGON ((1273270.06 6131189.07, ...

Test case: add the attached file with 'Import Layer' to the qwc2 Demo Server http://qwc2.sourcepole.ch/. The circles are in the area of Munich, therefore the map should be focused on Munich and display some circles. Then call 'Print'.

Use Case: People create their own annotations on the map and should be able to print the result.

Redlining.json

manisandro commented 7 months ago

This typically happens when a geometry is invalid (self intersections, degenerate lines/polygons, etc). Admittedly it would be nice to show a better error message, resp ideally even report the invalid geometry.

mhaelsig commented 7 months ago

Thank you for your quick response!

Apparently, the issue lies not in the printing itself, but rather in the geometry. This simple geometry (5 circles) had been generated with the Drawing Tool inside the QWC2 Client. Therefore: is there an issue in the geometry generator of the Drawing Tool?

But: the Conformity Test https://www.itb.ec.europa.eu/json/geojson shows no errors in 'Redlining.json'. The only discrepancy I can see: the coordinates of these circles are given in EPGS 3857, and the 'center' coordinates inside 'circleParams' are given in EPSG 25832.

The use case is: a user adds with the Drawing Tool some circles etc. and prints the resulting map with the QWC2 Print function.

Reply to this email directly or view it on GitHub: https://github.com/qgis/qwc2-demo-app/issues/505#issuecomment-1815398014 You are receiving this because you authored the thread.

Message ID: @.***>

manisandro commented 7 months ago

The issue here is an empty circle (radius=0). I've pushed https://github.com/qgis/qwc2/commit/bd5e8c468ef1b1cc72d5ddd09ee19834314c8efd which disallows creating any invalid geometries via redlining.