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

Wrong size of legend symbols size and map symbol when using geometry generator on a point layer #33755

Closed
gwenandres opened this issue Jan 13, 2020 · 21 comments · Fixed by #50200
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering

Comments

@gwenandres
Copy link

Hello,
I get really big symbols in the legend on a point layer with surface or line geometry generator when I choose categorized symbols.

For example :

  • I create a new point memory layer
  • I add a column "type" (integer)
  • For style, I choose categorized symbols on "type" column
  • For symbols, I choose surface geometry generator (buffer ($ geometry, 2))
  • Then in legend I get really big symbols for each type.

I am working with QGIS 3.4.14 LTR on Windows 7 or 10.
I try with QGIS 3.10.1, I have the same behaviour.
Qgis_issue_categorized_symbols

@gwenandres gwenandres added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 13, 2020
@gioman gioman added the Feedback Waiting on the submitter for answers label Jan 14, 2020
@gioman
Copy link
Contributor

gioman commented Jan 14, 2020

@gwenandres your layer has a CRS that has degrees as units?

@gwenandres
Copy link
Author

The CRS is 2154 so it has meters as units.

@gioman
Copy link
Contributor

gioman commented Jan 16, 2020

@gwenandres Can't confirm here on 3.10.1 on Ubuntu 18.04 but I'm not totally sure I followed the exact steps that lead you to see this problem.

Screenshot_20200116_134557

@gwenandres
Copy link
Author

@gioman Sorry if I am not clear. I have the problem on a point layer, not on a surface layer.
QGIS3-pointlayer

Yes it can be strange but I have point layer with surface generator.

@gioman gioman removed the Feedback Waiting on the submitter for answers label Jan 16, 2020
@gioman gioman changed the title Wrong size of legend symbols when using Geometry generator symbology Wrong size of legend symbols size and map symbol when using Geometry generator on a point layer Jan 16, 2020
@gioman
Copy link
Contributor

gioman commented Jan 16, 2020

I have the problem on a point layer

@gwenandres oh I see... moreover not only the legend symbol does not make sense, but also the generated area on map is not visible at all.

@gioman gioman changed the title Wrong size of legend symbols size and map symbol when using Geometry generator on a point layer Wrong size of legend symbols size and map symbol when using geometry generator on a point layer Jan 16, 2020
@SrNetoChan
Copy link
Member

I was able to replicate this. It only happens on Rule-based (maybe categorized too) Symbol, but not in single symbol, where it works just fine.

@jonnyforestGIS
Copy link
Contributor

@SrNetoChan I confirm as well this behaviour when using the geometry generator and happens with categorized symbol. Cheers

@jonnyforestGIS
Copy link
Contributor

@gioman having this #39777 as a possible resolution for this issue, this ticket can be close?

@gioman
Copy link
Contributor

gioman commented Nov 11, 2020

@gioman having this #39777 as a possible resolution for this issue, this ticket can be close?

@jonnyforestGIS have you tested the fix using the scenario described in this ticket?

@gioman gioman added the Feedback Waiting on the submitter for answers label Nov 11, 2020
@jonnyforestGIS
Copy link
Contributor

@gioman you're right.
I did a tested with the master and change the options but the behaviour with the new options but the issue still there. Please see my comment in #39777 , I will wait for @nirvn to answer, maybe I'm doing something wrong. Cheers

@gioman gioman removed the Feedback Waiting on the submitter for answers label Dec 23, 2020
@SrNetoChan
Copy link
Member

I have confirmed this on master. @Nirv fix does not fix the issue when the geometry generator is uses in categorised, graduated or rule based renderers. But works like a charm for single symbol renderer

@gioman
Copy link
Contributor

gioman commented Jan 28, 2021

See also #29119

@SrNetoChan
Copy link
Member

I guess we can close one as duplicate.

@gioman
Copy link
Contributor

gioman commented Jan 28, 2021

I guess we can close one as duplicate.

already did :)

@sickel
Copy link
Contributor

sickel commented Sep 29, 2021

I can confirm the same behaviour in 3.20.3. Using a postGIS point layer with a generated polygon around the point.
I just opened the same project. The height seems to be cropped, the symbols are too wide,
Skjermbilde

After collapsing and reopening the legend, it looks like this:
Skjermbilde

This is the symbol definition:
Skjermbilde

The dataset is in WGS84. The generated geometry is made by another geometry in the the same postGIS table.

@Pedro-Murteira
Copy link

I can still replicate this on QGIS 3.16.14 and 3.22.1.

@SrNetoChan
Copy link
Member

SrNetoChan commented Apr 29, 2022

There is an option to limit the size of the legend patches in the layers panel (settings > options > Map and Legend > Layer legend > Legend maximum size).

image

It seems to work fine for symbols where the size is controlled by an expression, but not by geometry generators.

In this project, this is clear
https://mega.nz/file/5MFkERjQ#OXEO-g6oUypng9eMvx1KDHA4lRmMbC8gKN40gz6dMcc

@martyvis
Copy link

Looks like there is a general problem with Geometry Generator scaling I am seeing as well. I have a Point layer and I add a simple square using Geometry Generator expression as follows 👎
make_line($geometry, translate($geometry,0,10.0), translate($geometry,10.0,10.0), translate($geometry,10.0,0.0), $geometry)

With Map Units set and using a CSR of EPSG:3857 (WGS84/Pseudo Mercator) you would expect the square to be 10m by 10m. Instead it looks like it is maybe 10 degrees x 10 degrees?
Screenshot 2022-06-27 191432
Screenshot 2022-06-27 191355

Running 3.24.2-Tisler on Windows 11

@nyalldawson
Copy link
Collaborator

@martyvis

Is your layer in 4326? The geometry generator map units refer to the layer's units.

@martyvis
Copy link

@nyalldawson Yes it was. I think I have worked out I had a workflow issue. When I create a new layer, usually a scratch layer I change its Geometry Type (say to Points) and add fields if needed but don't change the CRS. Somehow I thought the scratch layer would have followed the map layer I had underneath. I worked out if I change the CRS (eitger on creation or afterwards, it all works). The thing I still notice though is they if you open Geometry Generator expression build and look at the "map_units" variable it shows it as being "meters". So obviously this isn't correctly reflecting the Map Units that the layer is using. (Also if you have the layer selected and move your mouse the coordinates in the bottom still show metres and not degrees.

@CharlesGag
Copy link

Still happening in 3.36.1

I have this symbol, everything works fine
image

If I use the same one, but categorized, I get this :
image

I use EXIF data to generate these points so the layer is in 4326, but my projet is in another projection.

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! Map and Legend Related to map or legend rendering
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants