Skip to main content
78 votes

Сreating polygons with straight lines and right angles in QGIS

There is a Shape Digitizing toolbar in which has an option to add rectangle using different methods: To show the toolbar, right-click the main menu and select Shape Digitizing toolbar I am using ...
ahmadhanb's user avatar
  • 40.9k
38 votes

Creating polygon grid using GeoPandas

Previous answer gives correct result, but I allowed myself to improve the code, to avoid many unnecessary lines, as well as iterating on indexes instead of values on the list. import geopandas as gpd ...
Mativane's user avatar
  • 639
29 votes

Сreating polygons with straight lines and right angles in QGIS

No plugin needed In addition to the Shape Digitizing Toolbar it's also possible to add right angles through the Advanced Digitizing Tools. Activate the Advanced Digitizing Tools and lock the angles ...
Matthias Kuhn's user avatar
29 votes
Accepted

Generating rectangle centered by point in QGIS

Check the "Rectangles, Ovals, Diamonds" geoalgorithm in the QGIS's Processing Toolbox (Ctrl+Alt+T)
Taras's user avatar
  • 33k
26 votes
Accepted

Creating polygon grid using GeoPandas

There are many solutions. One of them import geopandas as gpd from shapely.geometry import Polygon import numpy as np points = gpd.read_file('points.shp') xmin,ymin,xmax,ymax = points....
gene's user avatar
  • 55k
24 votes
Accepted

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

Quick overview how to create new geometries using QGIS expressions with either Geometry generator or Geometry by expression: Geometry generator: Open Layer Styling panel / add additional symbol layer (...
Babel's user avatar
  • 71.6k
22 votes
Accepted

Buffering only sides of polygons in QGIS

Starting with a polygon (or several polygons): Run the "Polygons to Lines": Then "Explode lines". This won't look any different but if you enable "Show feature count" ...
Spacedman's user avatar
  • 64.4k
21 votes

Generating rectangle centered by point in QGIS

There is "Geometry by Expression" tool. You should use in a Projected Coordinate System. Select "Polygon" as "Output geometry type" option. Click "Expression" ...
Kadir Şahbaz's user avatar
20 votes

Filling holes in polygons using QGIS

I faced the same problem as yours with this shapefile, having many gaps between polygons. In order to solve the problem, You could use a slight modification of tshiffle's method: First, perform the ...
gtapko's user avatar
  • 831
19 votes
Accepted

Convex Hull in GeoPandas

If you want a single geometry representing the whole DataFrame, this should do it: With geopandas 1+ PR: within_15_hull = within_15mins.union_all().convex_hull With geopandas < 1: within_15_hull = ...
snowman2's user avatar
  • 7,419
19 votes

Changing polygon circles to hexagons using QGIS

Yes, try to use the make_regular_polygon() via the "Geometry by expression" from the Processing Toolbox (Ctrl+Alt+T). Let's assume there is a layer 'Polygon' with circles, see image below. ...
Taras's user avatar
  • 33k
18 votes
Accepted

Making ellipse based on ellipse-like polygon in QGIS

Apply the "Oriented minimum bounding box" (see documentation) From these, create ellipses with values from the attribute table calculated in the first step: make_ellipse(centroid($geometry),...
Babel's user avatar
  • 71.6k
18 votes
Accepted

Creating equally split buffers between points in QGIS

You can use "Voronoi Polygons", "Buffer" and "Clip" tools, respectively (or "Buffer" > "Voronoi Polygons" > "Clip"). Step 1. "...
Kadir Şahbaz's user avatar
17 votes
Accepted

Drawing ellipse with shapely

Answer First, define a circle of radius 1. Then define an ellipse along x and y axis. Rotate the ellipse. Finally, actually draw the ellipse. Code from matplotlib import pyplot from shapely.geometry....
swiss_knight's user avatar
  • 10.4k
17 votes

Splitting circle polygon into equal sectors in QGIS

5 degrees is 1/72 of a circle. Use the "Minimum enclosing circles" tool to create a circle with 72 segments. Use "Extract Vertices" to turn this circle into 72 points in a layer called Ring. ...
Spacedman's user avatar
  • 64.4k
16 votes
Accepted

Сreating polygon from coordinates in GeoPandas

This simple code is working for Python 3.9 and geopandas 0.9.0, and it works for older versions too. Separate lists with latitude and longitude coordinates import geopandas as gpd from shapely....
Davma's user avatar
  • 850
16 votes

Creating square polygons of given length from single corner point in QGIS

There is "Vector geometry > Geometry by Expression" tool in Processing Toolbox. You should use in a projected coordinate system. Select "Polygon" as "Output geometry type&...
Kadir Şahbaz's user avatar
16 votes

Best practices to show extent of Print Composer maps in main canvas in QGIS

There is a native feature in QGIS to display print extents in the map canvas. But if you want proper GIS polygons in a layer, you should indeed use some PyQGIS with the script provided in the other ...
etrimaille's user avatar
  • 7,260
15 votes
Accepted

Creating wedge buffers from many point to one in QGIS

Open "Create Wedge Buffer" tool. Select the layer containing the start points as input layer. Click "Data defined override" option () near the "Azimuth" and select "...
Kadir Şahbaz's user avatar
15 votes

Creating nested grid in QGIS

This answer was given to the original question prior the edit: Here is a graphical model you can use: So basically, you first need to create your parent grid as rectangles and order them with an SQL ...
MrXsquared's user avatar
  • 34.5k
15 votes
Accepted

Changing points into hexagon polygons using QGIS

There is an equivalent tool, namely "Rectangles, Ovals, Diamonds", in the QGIS's Toolbox(Ctrl+Alt+T) under Vector geometry. Set Shape as Oval and Segments value as 6 to get a hexagon.
Kadir Şahbaz's user avatar
14 votes

Merging neighbouring polygons in QGIS

You can use the dissolve tool from the QGIS Processing Toolbox. You find it at Vector > Geoprocessing Tools > Dissolve (see documentation). This will give you a large polygon where all parts are ...
Matte's user avatar
  • 6,245
13 votes
Accepted

Extracting holes from polygons in shapefile using QGIS

If you don't mind a two step process: Run "Delete Holes" from QGIS's Processing Toolbox (Ctrl+Alt+T) on your "PolygonWithHoles" Run "Difference" and use your "...
MrXsquared's user avatar
  • 34.5k
13 votes
Accepted

Creating circle around point with specific radius taken from column in QGIS

Using Vector geometry > Buffer tool in Processing Toolbox, you can specify the field that contains the radius value, as in the image: After selecting a field, Distance parameter will be inactive.
Kadir Şahbaz's user avatar
13 votes
Accepted

Rotating polygons to follow the curve (line) in 90 degree in QGIS

Create the line (if not already done) Use the algorithm "Points along geometry" to create your points. This algorithm will automatically add a field called "angle" to the points. ...
MrXsquared's user avatar
  • 34.5k
13 votes
Accepted

Splitting line buffers into two separate polygons in QGIS

Algorithms(tools): Use the "Single Sided Buffer" twice for left and right side Merge two results using the "Merge Vector Layers" Tool options: Two results: Merged:
Kadir Şahbaz's user avatar
13 votes
Accepted

Making an octagon using QGIS geometry generator

You can do this much easier with the function make_regular_polygon() like this: make_regular_polygon( $geometry, project($geometry,5,radians(360/16)), 8 ) 5 in line 3 is the size of the ...
Babel's user avatar
  • 71.6k
12 votes
Accepted

Creating variable distance buffers in QGIS

It's now part of the "Buffer" tool. You can now enter a buffer value in the distance text box or you could click on the button on the right of the distance text box to set a variable ...
J.R's user avatar
  • 16.3k
12 votes

Making ellipse based on ellipse-like polygon in QGIS

You could try something like: make_ellipse( centroid($geometry), bounds_width($geometry)/2, bounds_height($geometry)/2, main_angle($geometry), 45 ) 45 is the number of ...
MrXsquared's user avatar
  • 34.5k
12 votes

Creating equally split buffers between points in QGIS

Buffer the points Voronoi the points with "buffer region..:" 500 % (whatever percentage large enough to include the buffers) Intersect buffers with voronois Extract by location the ...
BERA's user avatar
  • 73.8k

Only top scored, non community-wiki answers of a minimum length are eligible