Skip to main content
36 votes

Calculating latitude and longitude of points using QGIS

With QGIS 3 you can use two simple expressions doing all the reprojection in one go without having to care about settings or projections of the layer. To get decimal degrees as float values use: For x ...
MrXsquared's user avatar
  • 34.9k
33 votes

Extracting raster values at points using Open Source GIS?

I was having problems with the QGIS and SAGA GUI tools mentioned in this thread (Raster values to points was failing for some reason and throwing unhelpful errors and the GRASS v.sample created a ...
Ian's user avatar
  • 495
29 votes

Drawing lines from points in QGIS

To create polygons from points, you can also use "Points to path", then "Lines to polygons" tools without need to install any plugin
ncelik's user avatar
  • 561
29 votes

Displaying overlapping points in QGIS

Try renderers: "Point displacement" or "Point Cluster" from symbology menu. (QGIS 3.x required for point cluster.) As point displacement they can look like this for example: And ...
MrXsquared's user avatar
  • 34.9k
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
  • 33.3k
22 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
22 votes
Accepted

Re-locating points randomly at certain distance in QGIS

This answer has been updated several times to get a solution that gradually adds complexity to the expression. For the final solution, you should go directely to the very bottom (step 5). The history ...
Babel's user avatar
  • 73.1k
21 votes
Accepted

Representing uneven tree canopy spread around point in QGIS

I have exactly the same use case at work, so this is what I have come up with: Solution 1 (ellipse) This looks fairly regular, but is the least precise generally, IMO. Use the ellipse marker symbology ...
she_weeds's user avatar
  • 12.6k
21 votes

Generating start and end points for LineStrings

If you have QGIS 3.4 you can use Extract specific vertices tool to extract the endpoints by inputting 0, -1 at the vertex indices as you can see below: The tool is located in Processing toolbox -> ...
ahmadhanb's user avatar
  • 41.1k
21 votes
Accepted

Difference between QgsPoint, QgsPointXY and QgsGeometry.fromPointXY() in PyQGIS

QgsPoint is a point class which supports Z (3D) and M values. (What are Z and M?) x, y, z, m = 10, 10, 20, 5 QgsPoint(x, y) # 2D # <QgsPoint: Point (10 10)> QgsPoint(x, y, z) # 3D # <...
Kadir Şahbaz's user avatar
21 votes

Creating perpendicular lines on line using QGIS

Edited answer: My first solution (see below) was for visualisation purposes only. But as you mentioned afterwards, you need the actual geometry. So this here is how to do it: Go to Menu Processing / ...
Babel's user avatar
  • 73.1k
20 votes
Accepted

Creating all possible line segments between all points using QGIS

You can achieve your goal using the Field Calculator. Using the Geometry Generator, with Linestring geometry type, use this expression: collect_geometries( array_foreach( aggregate('...
Val P's user avatar
  • 3,878
19 votes

Creating point features with exact coordinates in QGIS

In QGIS 3, the NumericalDigitize tool no longer seems to be available but here is a further solution. As of QGIS 3 you can simply copy and past WKT directly into the canvas. This works for single or ...
MappaGnosis's user avatar
  • 33.9k
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,459
19 votes
Accepted

Creating animated light cone of a lighthouse and part of coastline covered by light in QGIS

Before starting, make sure your point layer contains an attribute speed that contains values for the speed of the light cone for each lighthouse (point). Framerate of 20 fps, left point with speed of ...
Babel's user avatar
  • 73.1k
18 votes

Is it possible to create a point within a Polygon (not a centroid)?

EDIT : answer by @Kampau Ocu : "point on surface is already within QGIS3 Processing Toolbox" You can also use the plugin RealCentroid that does just what you're looking for : RealCentroids plugin ...
gisnside's user avatar
  • 7,858
18 votes

Splitting line layer using another point layer in QGIS

There is the SAGA's "Split Lines at Points" module (search in the Processing Toolbox Ctrl+Alt+T: QGIS Processing Toolbox > SAGA > Vector line tools) In the above example all my points ...
Kazuhito's user avatar
  • 31k
18 votes

Finding nearest neighbor for each point in the same table

This is essentially a duplicate question of multiple others, with the sole difference being a table self-join. However, all queries currently present in this post have delicate CRS misunderstandings, ...
geozelot's user avatar
  • 30.4k
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

Joining attributes from nearest point in QGIS

In QGIS 3.8 and above the "Join attributes by nearest" native tool in Processing Toolbox does the job easily!
Antonis Michalakis's user avatar
17 votes
Accepted

How to use ST_VoronoiPolygons() in PostGIS?

The trick when using a table of points is to feed all the points into ST_VoronoiPolygons by using ST_Collect, which simply combines all the points into a MultiPoint, without performing any spatial ...
John Powell's user avatar
  • 13.7k
17 votes
Accepted

Creating point at line end using QGIS

There is a possibility using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... Let's assume there is a polyline layer called 'polylines' (blue lines). With the ...
Taras's user avatar
  • 33.3k
16 votes

Calculating latitude and longitude of points using QGIS

Since QGIS 3.8 (June 2019), there is now an algorithm to add the X and Y values called "Add X/Y fields to layer". It can reproject coordinates on the fly. If you still need a Degree Minute ...
etrimaille's user avatar
  • 7,290
16 votes
Accepted

Getting coordinates of point on mouse click using PyQGIS

You need QgsMapToolEmitPoint class to do that. Following code works well for that purpose: from qgis.gui import QgsMapToolEmitPoint def display_point( pointTool ): print '({:.4f}, {:.4f})'....
xunilk's user avatar
  • 30k
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
15 votes
Accepted

Getting correct WKT result to 4 decimal places using PostGIS

The simplest way to round geometry coordinates is to use ST_SnapToGrid: SELECT ST_AsText(ST_SnapToGrid('POINT(-0.685239554498251 51.4940418030595)', 0.0001)); st_astext ----------------------- ...
Mike T's user avatar
  • 42.2k
15 votes

Creating point at line end using QGIS

In the Processing Toolbox use the Extract Specific Vertices tool, for the Vertex indices use 0 for the first vertex and -1 for the last vertex. Which one you need will depend on the direction of the ...
TeddyTedTed's user avatar
  • 6,130
15 votes
Accepted

"Move feature" for points, manually moving a set of points with the mouse in QGIS

You need to enable Advanced Digitizing Tools from the Toolbar menu. Right click the main toolbar -> Toolbars -> and enable Advanced Digitizing Tools. The Move feature is located inside this menu:...
ahmadhanb's user avatar
  • 41.1k
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
Accepted

Determining on which side of line points are located using QGIS

By using PyQGIS 2 (I supposed for your tag pyqgis) you can do that with closestSegmentWithContext() method from QgsGeometry and azimuth() method from QgsPoint. I used the shapefile of the following ...
xunilk's user avatar
  • 30k

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