Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option "Avoid artifacts when project is rendered as map tiles" doesn't work on server. #37679

Closed
klipski opened this issue Jul 8, 2020 · 16 comments · Fixed by #41229
Closed
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server

Comments

@klipski
Copy link

klipski commented Jul 8, 2020

Describe the bug

In QGIS 2.18 and newer this option works fine on server side. In QGIS 3.x this option doesn't work, and symbology doesn't match on adjacent tiles.

How to Reproduce

  1. Check option "Avoid artifacts when project is rendered as map tiles" in project properties.
  2. Make GetMap requests with adjacent BBOXes.

QGIS and OS versions
QGIS: 3.X
OS: Ubuntu 18.04.3 Bionic Beaver

Additional context

QGIS 3.10
image

QGIS 2.18
image

@klipski klipski added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 8, 2020
@gioman gioman added the Server Related to QGIS server label Jul 8, 2020
@gioman
Copy link
Contributor

gioman commented Jul 8, 2020

In QGIS 2.18 and newer this option works fine on server side

@klipski did you mean "on Desktop side"?

@gioman gioman added the Feedback Waiting on the submitter for answers label Jul 8, 2020
@klipski
Copy link
Author

klipski commented Jul 9, 2020

I mean server renders wrong symbology on adjacent tiles as you can see on the first picture.

@gioman
Copy link
Contributor

gioman commented Jul 9, 2020

@klipski are you sure that this option applies also to QGIS Server? I just tested with QGIS (Desktop/Server) 2.18 and did two adjacent grtmap requests, and that option does not seems to achieve what you say:

out8

Also from this discussion https://lists.osgeo.org/pipermail/qgis-developer/2020-July/061805.html it seems that the option is about a different context in QGIS Desktop.

Anyway I'm really not sure...

@klipski
Copy link
Author

klipski commented Jul 9, 2020

I think that I found pull request with this feature #2666, and It seems it was created mainly for QGIS Server.

@nyalldawson
Copy link
Collaborator

I can confirm that this option was DEFINITELY designed with server in mind

@gioman
Copy link
Contributor

gioman commented Jul 10, 2020

I can confirm that this option was DEFINITELY designed with server in mind

@nyalldawson right, but mu doubt remains, with this option selected two adjacent getmap requests should return always "matching" symbology? And also, shouldn't this option be (also) in the Server tab?

@nyalldawson
Copy link
Collaborator

Well, it should, but it's broken on server! Works still on desktop...

@gioman gioman added Regression Something which used to work, but doesn't anymore and removed Feedback Waiting on the submitter for answers Regression Something which used to work, but doesn't anymore labels Jul 10, 2020
@gioman
Copy link
Contributor

gioman commented Jul 10, 2020

Well, it should, but it's broken on server!

@nyalldawson thanks. I'm also not sure is a regression, I tried it on a QGIS Desktop/Server 2.18 project and still I'm not getting the expected result, but may be I'm just doing it wrong.

@nyalldawson
Copy link
Collaborator

@klipski #41229 fixes this -- but note that since QGIS 3.16, you probably don't want to enable this setting anyway, as it's an extremely expensive option for the server to use and in QGIS 3.16 a very lightweight approach to avoiding map tiling artefacts was added and always applies, regardless of this setting.

The only situation that I can see warrants the "avoid tile artefacts" option is for some advanced symbology effects like shapeburst fills -- but in this case I'd recommend controlling the behavior on a layer-by-layer basis through individual layer's symbology settings, via unchecking the "Advanced" - "Clip Features to Canvas Extent" option. This allows you to control per-layer the same result as the "avoid tile artefacts" does for an entire project, so you can selectively enable it only for layers which need it and aren't too taxing on your server.

Hope that clarifies the situation!

@elpaso
Copy link
Contributor

elpaso commented Jan 28, 2021

@nyalldawson maybe this setting should be documented to explain when it is useful.
CC @benoitdm-oslandia

@andreasneumann
Copy link
Member

@nyalldawson maybe this setting should be documented to explain when it is useful.
CC @benoitdm-oslandia

Yes - documentation would be quite important here, with examples where this (and the other per layer setting) would be useful (e.g. artifacts with patterns, label placement, gradients, outline issues, etc.) - basically when does it make sense to enable this setting and what "rough" cost it has on rendering speed.

@nyalldawson
Copy link
Collaborator

I'd honestly question whether we shouldn't just remove this option entirely, given that it's been broken since 3.0 and given that there's supported alternatives to achieve the same results without the huge performance cost. I can understand that it was useful prior to 3.16, but with the changes in 3.16 users are getting most of the same results now out of the box, without ANY added server load.

Effectively all this option does now is disable the "clip features to map extent" option for ALL symbols across an entire project. Yes, disabling this option does prevent tiling artefacts if users are relying on shapeburst/gradient/centroid fills, or marker line patterns, but again it comes with a huge performance cost that is incurred by ALL symbols -- so even a simple solid color fill symbol will still render orders of magnitude slower for absolutely no difference.

So, we could either:

  1. Restore the 2.x behavior (as is done in Fix "Avoid artifacts when project is rendered as map tiles" doesn't work on server #41229), with the understanding that it's not a good setting to enable for high load, production servers
  2. Remove the option entirely and require users to manually uncheck "clip features to map extent" for symbols which they are seeing tiling artefacts on. Or,
  3. Rework the setting so that it doesn't apply to ALL symbols in a project, but instead only selectively applies to symbols where tiling artefacts could be noticable (ie. symbols with gradient, shapeburst, centroid fill symbol layers, etc, but skipping those with simple fill, simple line, etc...).

Thoughts?

@klipski
Copy link
Author

klipski commented Jan 29, 2021

@nyalldawson thank you for your help, I really appreciate it! I checked how the symbolization on the adjacent tiles behaves in QGIS 3.16 and it looks like that unchecking the "Advanced" - "Clip Features to Canvas Extent" option meets my expectations for now.

@nyalldawson
Copy link
Collaborator

Thanks for the feedback @klipski ! I'm keen to hear your thoughts regarding the options in #37679 (comment) about the future of this option...

@klipski
Copy link
Author

klipski commented Feb 3, 2021

  1. Remove the option entirely and require users to manually uncheck "clip features to map extent" for symbols which they are seeing tiling artefacts on. Or,

In my opinion this option seems to be the best one, but needs some explanation in the server documentation.

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Feb 12, 2021
settings, that's not a stable place to store things like this which
are designed to apply in both desktop and server contexts!

Refs qgis#37679
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Feb 12, 2021
@nyalldawson
Copy link
Collaborator

I've gone for option (3) here as it seems the best balance between user expectations and ease of use.

nyalldawson added a commit that referenced this issue Feb 12, 2021
settings, that's not a stable place to store things like this which
are designed to apply in both desktop and server contexts!

Refs #37679
nyalldawson added a commit that referenced this issue Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants