47
votes
Creating point features with exact coordinates in QGIS
No Plugin Required
This is possible with QGIS without extra plugins using the Advanced Digitizing panel. This tool allows entering exact coordinate values as well as constructing points at given ...
30
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 ...
30
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 ...
30
votes
Accepted
How to randomly subset X% of selected points?
Here's a python function that will select random features in a layer based on percent, ignoring current selection:
def SelectRandomByPercent (layer, percent):
#layer variable is the layer name in ...
28
votes
Accepted
Nearest distance between point and line layers in QGIS
As an alternative, you could:
Use the Convert Lines to Points tool from:
Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points
(Add points over small distances. E.g. add a point ...
28
votes
Accepted
Generating rectangle centered by point in QGIS
Check the "Rectangles, Ovals, Diamonds" geoalgorithm in the QGIS's Processing Toolbox (Ctrl+Alt+T)
27
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
27
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 ...
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 ...
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 -> ...
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" ...
20
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 ...
19
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('...
19
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 / ...
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 ...
18
votes
Accepted
What's the difference between QgsPoint, QgsPointXY and QgsGeometry.fromPointXY(QgsPointXY()) 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
# <...
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. "...
17
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 ...
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 ...
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 ...
17
votes
Accepted
Convex Hull in GeoPandas
If you want a single geometry representing the whole DataFrame, this should do it:
within_15_hull = within_15mins.unary_union.convex_hull
According to the unary_union docs:
Returns a geometry ...
16
votes
Accepted
Finding closest polygon to point in PostGIS
Several ways to do this. One is to find the distance and order ascending.
SELECT geom
FROM polys, points
WHERE points.gid = 1
AND ST_DWithin(poly.geom, points.geom, 1000)
ORDER BY ST_Distance(a....
16
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 ...
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&...
15
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!
15
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 ...
15
votes
Accepted
Detecting if point is on left or right side of line in PostGIS?
select (ST_Azimuth(h.vec) - ST_Azimuth(h.seg))
from (
select
ST_MakeLine(cp.p, point.geom) vec,
ST_MakeLine(cp.p,
ST_LineInterpolatePoint(
line.geom,
...
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
-----------------------
...
15
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})'....
15
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, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
point × 2302qgis × 938
arcgis-desktop × 395
line × 290
polygon × 275
distance × 192
postgis × 160
raster × 148
arcmap × 138
r × 104
python × 101
shapefile × 101
coordinates × 96
arcpy × 95
pyqgis × 73
coordinate-system × 71
qgis-3 × 71
symbology × 68
vector × 66
buffer × 66
csv × 59
proximity × 58
postgresql × 56
point-in-polygon × 55
arcgis-10.0 × 54