Questions tagged [geometry-generator]

For questions about the geometry generator symbol layer style in QGIS.

Filter by
Sorted by
Tagged with
1 vote
1 answer
44 views

QGIS: How to use 'case when' statement in geometry generator

I intent to expand a layer's symbology by a geometry generator using the following expression: case when attribute > 2 then buffer($geometry, attribute) end However it doesn't work (also when ...
user avatar
  • 922
2 votes
1 answer
39 views

Curved labels on curved arrows

I have straight lines in a metric CRS, connecting two points. So each line has exactly two vertices. I want to display these lines as curved arrows with curved labels above these arrows. QGIS version ...
user avatar
  • 24.5k
1 vote
1 answer
52 views

Merge polygons when rendering vector tile layer in QGIS

I'm using a vector tile layer in QGIS, and certain symbology effects don't work very well due to (I presume) how certain features (in this case the river) have been split up across multiple vector ...
user avatar
4 votes
1 answer
64 views

Fieldname as variable in with_variable returns value not the field

I want to use a field name as a variable inside the geometry generator, but it replaces the field name with the current value of the feature instead of taking the field name as the variable. ...
user avatar
1 vote
2 answers
59 views

Specify line length in Geometry Generator QGIS 3

I'm working in Geometry Generator trying to produce a line from a point in an x,y direction with a specific length of 50m. I have the direction and line but I can't figure out how to specify the ...
user avatar
  • 710
2 votes
2 answers
46 views

Connecting points by line number and code in QGIS

I am looking to connect points with a line using Geometry Generator or Virtual layer. Each point has a unique number, a code and a line number. The goal is to display in QField application the lines ...
user avatar
  • 21
3 votes
1 answer
94 views

Creating points along the line on either side of an intersection point

I have a center line and an intersection point. I want to create points on either side of this intersection point along the center line with an interval 50 meters(can vary) starting from the ...
user avatar
2 votes
1 answer
101 views

QGIS Geometry Generator: make_line once per grouped geometries

I am using a Geometry Generator symbol layer to draw lines between grouped points. I am grouping points based on two fields letter and number, which I concatenate to make the groups (GeoPackage ...
user avatar
  • 7,251
0 votes
1 answer
29 views

Rotate markers along a line using a geometry generator

I would like to create a line style for projected tracks. Every kilometer on the line there should be a marker with a number. I hope it possible using geometry generator. Making markers after 1000 ...
user avatar
3 votes
1 answer
58 views

Deformed shapes after using wedge_buffer as Symbol layer in QGIS

I'm trying to display "field of view" cones on the map, using Geometry Generator as Symbol layer: wedge_buffer($geometry, dir, specs_angle, specs_distance/200000, 0) "dir" : ...
user avatar
  • 319
3 votes
0 answers
44 views

Differences in QGIS expression functions using Geometry generator vs. Geometry by expression

Create a line to the closest neighbor: Geometry generator Using QGIS, I have a point layer and use the following expression with Geometry generator to create a line, connecting each point to its ...
user avatar
  • 39.9k
2 votes
1 answer
63 views

Does Geometry by expression in QGIS except layer without geometry?

There is distance matrix with 9.455 features without geometries in GeoJSON format. It was created outside of QGIS with a tool similar to QGIS's "Distance matrix". The matrix looks like this: ...
user avatar
  • 22.6k
0 votes
0 answers
41 views

Registering events in geometry generator

I have a problem with a geometry generator I wrote to display lines in a specific manner. The code is similar to this simplified example: # This contains geometries in a simili-layer line_cache = {} ...
user avatar
  • 139
6 votes
2 answers
173 views

Transforming points into graduated segments in QGIS

In QGIS 3.16 I've got a point layer for several sample points in a coastal stretch. The attribute "EPR0113_er" indicates the erosion rate recorded at that point and I would like to represent ...
user avatar
  • 2,271
3 votes
1 answer
91 views

PyQGIS - create a centroid point symbol layer via Geometry Generator on a polygon layer

I'm trying to created a Geometry Generator symbol layer (point) that creates centroids from myLayer, a polygon map layer. Sounds easy, right? Here is my code - I think I'm missing a line to declare ...
user avatar
  • 869
1 vote
1 answer
74 views

Creating line from center point, angle and length in QGIS

How can I generate a line with given center point, angle and length in QGIS? I am analyzing that auto extraction lineament for geologic structure analyze.
user avatar
2 votes
0 answers
44 views

Dynamic buffer regroup [duplicate]

I am using QGIS 3.16 and I want to create a dynamic buffer around a layer of points, so that every time I move some point the buffer also moves. I have succeed by duplicating the layer and then ...
user avatar
4 votes
2 answers
494 views

Combining point and polygons layers using QGIS

I'm currently trying to compare species sample points vs their actual geographic range. I have: a points layer with species names and each species has multiple corresponding points/records a polygon ...
user avatar
  • 49
5 votes
1 answer
174 views

Create multipart geometry in geometry by expression

I'm trying to create a multiline geometry looking like the lines in my screenshot. I've created it by duplicating a line style 12 times on a point layer, rotating it by +30 degrees. Isn't it possible ...
user avatar
  • 51k
4 votes
2 answers
102 views

Styling lines with centroids by two different fields in QGIS

I have a line layer showing sectors of roads that I want to style by two different fields without duplicating the layer. "Field 1" is an integer ranging from 0-25 defining road usage (...
user avatar
  • 301
1 vote
2 answers
114 views

Displacing polygon labels along perimeter using QGIS

I'm working with QGIS 3.16 Hannover and I'm labelling two adjacent polygons using the following parameters: And labels are shown as this I would like to displace them along the perimeter so they do ...
user avatar
  • 2,271
7 votes
1 answer
298 views

QGIS - how to use geometry generator to place a centroid in each segment of a multiline?

With geometry generator in QGIS I'm trying to place a marker in the midpoint of each segment of a multiline vector (I don't want to use the Highlight line option). My main issue is how to read each ...
user avatar
6 votes
2 answers
112 views

How to make a generic "Perpillou's map" with QGIS

I try to make a Perpilou's map on QGIS, I managed to get a working code but it is not generic at all, so I am looking for ways to improve it. A Perpillou map is a (old-fashioned) cartographic method ...
user avatar
  • 1,237
1 vote
1 answer
209 views

Geometry generator with QGIS expression: collect_geometries for overlaying layers, based on attributes

I have a point layer "Layer1", with an attribute called L1_att. I have a surface layer "Layer2", with an attribute called L2_att. In my symbology of Layer1, I have categorized ...
user avatar
  • 600
4 votes
1 answer
130 views

Making specified shape in QGIS Geometry Generator

I am currently trying to make a special symbol in QGIS My best idea is to use Geometry Generator but I can't seem to find any good tutorials besides converting geometry to various types. Is there any ...
user avatar
2 votes
1 answer
84 views

Place text made with Geometry Generator outside feature

I wished to know if there's a way to make the Font Marker don't cross or be inside the the feature, as shown in the images bellow. The text is not a label, but made in Geometry Generator with "...
user avatar
  • 1,054
5 votes
2 answers
201 views

Styling line pattern fills with geometry generator

I try to style line pattern fills of polygones with the geometry-generator to get zigzag-line/wavy lines with this script Custom QGIS linestyle but somehow I never get the lines displayed. For lines &...
user avatar
  • 851
3 votes
1 answer
83 views

Generating parallel points along with lines or outline of polygon

In QGIS using the Geometry generator, how can we generate the square points within a polygon (e.g. built-up layer) that parallel with other features (e.g. road layer) like in the map below?
user avatar
4 votes
2 answers
407 views

Using multiple line fill patterns with common base point in QGIS

I have a polygon layer that I want to show with different symbologies. When I select a line pattern fill without a stroke line, I want the patterns of adjacent polygons to to blend seemlessly into ...
user avatar
2 votes
1 answer
54 views

Duplicates Not Highlighted

Actually I am using Geometry Generator and a small script for displaying duplicate values in the data. But some duplications are not highlighted. Don't know why its happening. can any one suggest any ...
user avatar
  • 259
0 votes
0 answers
111 views

QGIS - label color setting

I use rule-based labeling with geometry generator on line layer. I use expression @symbol_color, because I want to have color of labels the same as color of lines. However, @symbol_color doesn't work ...
user avatar
  • 405
4 votes
1 answer
262 views

Create an inscribed square inside a polygon

I have polygons of the administrative boundaries and want to create a square polygon inside of them, which will have the maximum area and will be fully covered by these boundaries. In other words: how ...
user avatar
  • 119
3 votes
2 answers
207 views

How to label points with gradient-colored data-defined rectangles in QGIS 3.18?

I am trying to symbolize a point layer with rectangles shaped and colored by gradient according to attribute values. I am trying to do this via label backgrounds rendered as "Geometry generator&...
user avatar
  • 31
3 votes
1 answer
92 views

Convert lines to polygons, but closing the lines first (topographic lines not closed)

I have a topographic layer for a country. I want to select topographic lines of a certain altitude and transform the lines to polygons. All work fine except one thing: since the lines of the ...
user avatar
7 votes
1 answer
1k views

Use QGIS expressions to create geometries: difference between geometry generator and geometry by expression

QGIS has a powerful expression machine that can be used (between other things) to create new geometries, based on existing layers. Basically, there are two options: Geometry generator and Geometry by ...
user avatar
  • 39.9k
2 votes
1 answer
111 views

Filtering features outside features of another layer using QGIS geometry generator

I am trying to filter features in one layer outside features in another layer using geometry generator. I have a buildings layer and an area layer and now I want to only show the buildings outside the ...
user avatar
  • 389
2 votes
1 answer
241 views

Can the ArcGIS solution for uneven buffering be achieved in QGIS? version 2 - uneven tree canopies

I want to create tree canopies with uneven canopy extents. A previous solution is below: Representing uneven tree canopy spread around point in QGIS A solution for uneven buffering has been provided ...
user avatar
  • 41
2 votes
1 answer
265 views

Get_feature and Get_feature_by_id problem

Why does the function works with get_feature_by_id and doesn't with get_feature? closest_point ( geometry (get_feature (@layer, "num_plgnal" , '1')), geometry (get_feature (@layer, ...
user avatar
  • 1,054
4 votes
1 answer
116 views

Closest_point in Geometry Generator

I'm trying to understand the closest_point function in qgis. For that, I created a polygon layer with two features, and through the Geometry Generator I intend to find the closest point between those ...
user avatar
  • 1,054
6 votes
0 answers
153 views

QGIS Geometry Generator not working for some features at some scales

I have a set of layers, one of them is labeled using geometry generator. Thing is, at some scales (1:800 and up) and some features (like 1/30) the geometry generator evalues to null geometry, so the ...
user avatar
  • 333
4 votes
1 answer
117 views

Changing the order of the polygon's nodes using the geometry generator in QGIS

How can I, using the geometry generator, change the order of the polygon's nodes, starting from the most northerly node in QGIS?
user avatar
  • 41
5 votes
3 answers
178 views

Generating start and end points for individual road segments

I have shape file with road network (line layer) as shown in Image 1. The road network contains multiple line segments as shown with blue line in image. I am trying to generate start and end point of ...
user avatar
  • 825
5 votes
2 answers
318 views

Connecting points with line using virtual layer in QGIS

I have 10 points in QGIS layer as shown in Image 1. I am trying to connect points with lines in required sequence as shown in Image 2. However, when I tried to connect all points with virtual layer, ...
user avatar
  • 825
1 vote
1 answer
51 views

Apply transformation to layer on the fly when using tools like Buffer

I know that you can have an on-the-fly transformation on a layer when rendering on the canvas, but is there a way to run a tool like Buffer where the layer should be re-projected on-the-fly just ...
user avatar
  • 3,236
0 votes
1 answer
71 views

Changing length of Shortest_Line for CAD-like slope pattern using QGIS

I haven't found a tool/plugin that could do this, but I am almost there. Here is what I want to do: I want to create a slope like the ones from CAD programs, but I don't have and don't need a DEM. It'...
user avatar
1 vote
1 answer
213 views

Export Polygon generated with Geometry Generator as dissolved polygons

Absolute QGIS newbie (3.10.8) here, so please bear with me. I got a QGIS document where some polygons (countries) are virtually dissolved in regions (like South America), through a rule-based ...
user avatar
3 votes
1 answer
126 views

Relation aggregate function error in QGIS using Geometry by expression

I have a point layer, consisting of 12 points with fid 1 to 12. I want to render points with fid > median (fid) - thus in this case, point 7 to 12. That works perfectly if using geometry generator ...
user avatar
  • 39.9k
4 votes
2 answers
244 views

Connecting points with line in a specific sequence

I have 6 points in one layer as shown in the first image. I am trying to: connect points with lines in a required sequence. Save data of line connections (From_point and To_point) in the seperate ...
user avatar
  • 825
8 votes
1 answer
150 views

Connecting points with lines and saving starting and ending points in new layer

I have 3 points in one layer as shown in the first image. I am trying to connect a building points with junction point by 2 lines. For demo, I have manually drawn a lines in image 2. Here, I am trying ...
user avatar
  • 825
3 votes
2 answers
202 views

Making curved line between points by using QGIS Geometry Generator

I am testing different tree crown drawing options in QGIS. At the moment, I have found this option to be the most suitable for me. Code: convex_hull( combine(buffer(make_point($x-("...
user avatar
  • 45