32 votes

Unable to snap vertices and segment in QGIS 3.0

In QGIS 3.0, the snapping settings are accessed through the snapping toolbar. This is a change from previous versions. In QGIS 2.x they were accessed through Options menu > Snapping Options... ...
csk's user avatar
  • 24.3k
25 votes

Snapping raster grids in R

This question is similar to: Clip raster by raster with data extraction and resolution change, but coming from a different angle. However, I think the answer is likely the same. First off, choose ...
MikeRSpencer's user avatar
16 votes
Accepted

How to snap a road network to a hexagonal grid in QGIS?

My solution involves a PyQGIS script that is faster and more effective than a workflow involving snapping (I gave it a try too). Using my algorithm I've obtained these results: You can run the ...
Germán Carrillo's user avatar
15 votes

Aligning multiple points to line in QGIS?

There's a built-in tool to do this in the (unreleased) QGIS 3.0 version. You can get a nightly snapshot from the QGIS website to test this in advance. To do this: Run the "Snap geometries to layer" ...
ndawson's user avatar
  • 27.3k
15 votes

Snap points shapefile to line shapefile using shapely

The methodology is called linear referencing and a solution was given by Mike T in Coordinate of the closest point on a line with Shapely. There is also a recipe in the Python Geospatial Analysis ...
gene's user avatar
  • 54.2k
15 votes

Snapping a point to a unique hexagon in QGIS

You can try the script below. Note: Before you do anything else, please make a backup copy of your point layer file in case of unexpected or undesired results (don't just duplicate the layer in the ...
Ben W's user avatar
  • 20.2k
11 votes
Accepted

Split line by nearest points using geopandas

First make sure you union your GeoDataFrames into a MultiLineString and MultiPoint line = gdf_line.geometry.unary_union coords = gdf_point.geometry.unary_union Using shapely.ops.snap and shapely.ops....
Mattijn's user avatar
  • 956
10 votes
Accepted

Why is Shapely's snapping (GEO snaps) not working as expected?

The shapely.ops.snap function snaps to the vertices of geometries only. See the illustration below. On the left, the red vertex is within the snapping tolerance to the blue vertex, so it will snap. ...
Snorfalorpagus's user avatar
10 votes

How to edit geometry of multiple layers simultaneously in QGIS 3?

(QGIS 3.4.1) Make sure all layers you want to edit have editing toggled on. Using the vertex tool in the digitizing toolbar, ensuring the option for 'All layers' is selected from the dropdown next to ...
Matt's user avatar
  • 14.2k
10 votes
Accepted

How can I enable topological editing in QGIS 3

In QGIS 3.4 you may need to enable Snapping toolbar by right-click the main menu bar and select Snapping toolbar, and you will find this menu: The last three icons are Enable Topological Editing, ...
ahmadhanb's user avatar
  • 40.3k
10 votes
Accepted

Highlighting snapping position in PyQGIS

Add the following lines to __init__ method: self.snapIndicator = QgsSnapIndicator(canvas) self.snapper = self.canvas.snappingUtils() And add a canvasMoveEvent method like this: def canvasMoveEvent(...
Kadir Şahbaz's user avatar
9 votes
Accepted

How do I create a target geometry to use with JTS GeometrySnapper?

For this scenario, I would suggest using the JTS GeometryPrecisionReducer class rather than GeometrySnapper. GeometrySnapper is intended for snapping one geometry to another. If you wanted to use ...
dhollema's user avatar
  • 361
9 votes

Snapping a point to a unique hexagon in QGIS

You can use the following script. It creates a new layer for the relocated points. # h: hexagon, p: point h_lyr = QgsProject.instance().mapLayersByName("Hexagons")[0] p_lyr = QgsProject....
Kadir Şahbaz's user avatar
8 votes

Snapping function doesn't work with complex polygons in QGIS?

With reference to the error you get, it seems that some geometries are invalid (in this case, the lake layer). You may check it by running several tools, for example the Check validity algorithm from ...
mgri's user avatar
  • 16.1k
8 votes
Accepted

Quickly temporarily disabling snapping in QGIS 3?

Yes using s will enable/disable snapping.
Nathan W's user avatar
  • 34.6k
8 votes

Snapping to segments not working in QGIS

To get the snap to vertices to work make sure you have the following options selected: Enable Snapping (U magnet button) Enable topological editing Enable snapping on intersection Enable tracing Make ...
Garth Cooper's user avatar
7 votes

Enabling "Snapping" in QGIS while drawing polygons?

Note that in the latest QGIS release snapping options is no longer visible by default. To use it right-click settings to activate snapping options.
Maarten 's user avatar
7 votes

Aligning multiple points to line in QGIS?

This can be afforded with PyQGIS. For next situation: following code, considering a tolerance of 5 map units, was ran at the Python Console of QGIS: from math import sqrt registry = ...
xunilk's user avatar
  • 29.4k
6 votes

Removing small spaces (slivers) between polygons

There is an "Eliminate sliver polygons" function in QGIS 2.12 (Lyon) Toolbox. I am sure it is also in some earlier version.
dnltsk's user avatar
  • 354
6 votes

How to snap a road network to a hexagonal grid in QGIS?

I did it in ArcGIS, surely can be implemented using QGIS or simply python with package capable of reading geometries. Make sure that roads represent network, i.e. intersect each other at the ends only....
FelixIP's user avatar
  • 22.6k
6 votes

Is there any option in QGIS to draw parallel lines that snap on the outside part of the line (adjacent lines) that are independent from scale?

Not sure this is what you are really after, but you can use a single line with a different symbolisation to create the appearance of two parallel lines. Starting with a 1.1 km line in CRS 3857 (...
Simbamangu's user avatar
  • 14.8k
6 votes
Accepted

Digitizing without gaps in QGIS

The title of your question was misleading. Your issue is more probably about snapping, which is one of the several tools used for digitizing features. Simply, enable snapping mode from Settings >&...
mgri's user avatar
  • 16.1k
6 votes

Connect newly drawn lines to existing lines in QGIS?

What you are looking for is doing a snapping operation, which is a very common task in a GIS software. Simply, go to Settings >> Snapping Options... and set where to apply the snapping and a ...
mgri's user avatar
  • 16.1k
6 votes

Snapping to sketch' vertices while editing in QGIS?

There is no "snap to sketch" equivalent in QGIS, unfortunately. There are a couple of ways to deal with this situation, but each involve a couple of steps. Go to View > Toolbars, and enable the Shape ...
jcarlson's user avatar
  • 3,810
6 votes
Accepted

Snapping to a segment of the point symbol (QGIS)

You can achieve this using a virtual layer. Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. select st_buffer(geometry,dist) from myPointLayer ...
JGH's user avatar
  • 39.8k
5 votes

Creating new lines along specifically selected existing lines using QGIS?

Tracing is now implemented in Advanced Digitizing Toolbar The layer(s), you want to snap to, has(ve) to be visible and snapping option has to be turned on. If you want to snap to a certain layer, use ...
Mykola Kozyr's user avatar
5 votes

Snapping while measure in QGIS?

The snapping has moved for QGIS3. Project 🠊 Snapping Options... to display the Project Snapping Settings toolbar: Then you need to toggle on the snapping and away you go! [
Jay Cummins's user avatar
  • 14.6k
5 votes

How to snap lines to nearest point?

In QGIS 3.0 there is a geoprocessing algorithm called 'Snap Geometries to Layer' which works for lines or points (possibly polygons, haven't tested) and has some options on how the algorithm behaves. ...
James Norris's user avatar
5 votes
Accepted

Snapping multiple points to nearest edge of polygon using ArcGIS for Desktop?

There is an ArcToolbox tool called Snap found in the "Editing Tools" toolset. You could use Select by Location to select all the points that don't intersect one of your polygons (the ones that are ...
Midavalo's user avatar
  • 29.5k
5 votes
Accepted

Road snapping in R - snapPointsToLine / Projection Problem

The warning message is quite clear here: 1: In RGEOSDistanceFunc(spgeom1, spgeom2, byid, "rgeos_distance") : Spatial object 1 is not projected; GEOS expects planar coordinates It requires planar (...
dof1985's user avatar
  • 3,146

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