Hot answers tagged

6

You can use st_translate to move the point SELECT ST_MakeLine(geom, st_translate(geom,0,-500)) FROM liechtenstein.punkte_test;


5

It may not be the most elegant way. However, you use "Extend line" to extend lines by the distance of the longest edge of the polygon. The output looks like this and you can clip by Polygon with the "Intersection" tool. And the output looks like this


5

Use this expression with geometry generator or the Geometry by expression tool - the expression is adapted to the data you provided (layer name: 'Bounding Box', distance to extend the line: 65): intersection ( extend ( $geometry,65,65 ), geometry ( get_feature_by_id( 'Bounding Box',0 ) ) )


4

First an algorithmic description how this solution works. Afterwards the implementation in QGIS, using expressions to create new geometries. Description You can create for each vertex of your polygons the closest point on the line representing the street: make a perpendicular line on the streetline going through each vertex and where this connecting line ...


3

You polygons must have a unique identifier in the attributes, in my case the field named fid. I also presume the line layer has the name line. If you have other names, change it in the following expressions accordingly. Be aware: the expression overlay_nearest is available since QGIS 3.16, see visual changelog. For older versions, use the refFunctions plugin ...


2

A completely different solution with yet another resulting polygon shape consists of "stretching" the polygons: just extend the length (longer side) of the rectangle until its intersection with the lines layer. This is more intuitive, but not necessarily easier to realize. You can do it as follows. Remark: your polygon should have an uniqe ...


2

It is annoying when it is necessary to do an extraction of line segments and layer is LinesSring type (not Polygon type). It is because it depends of the way as lines were digitized. Your approach was correct but your "Extract by location" method doesn't have a "convexHull" option. In a PyQGIS script you can do that. First, I downloaded ...


2

Instead of step 5, create a new geometry by expression (go to Menu Processing / Toolbox), using the expression boundary ($geometry), see: The result:


2

Have a look at the help for the Integrate tool. Integrate allows you to collocate vertices based on distance. Make a backup of your data first since this tool is going to alter the original geometry of your data. This tool may not give the results you need as it may merge lines that you do not intend to merge. Tools in ArcGIS respect selections - maybe ...


2

As your polygon layer has invalid geometries, you have to run first this method of Processing tool (Fix geometries). Both layers (I named Polygons as Polygons_fixed) loaded in QGIS look as follow. Afterward, you need to run Difference Processing tool with following parameters: After click in Run, resulting layer looks as follow. I used an opacity of 20 % ...


1

A simpel example cutting the lines not intersecting a polygon using QGIS Virtual Layers. select p.id, st_intersection(l.geometry, p.geometry) as geometry from test_line l inner join test_poly p on st_intersects(l.geometry, p.geometry) Input a linestring and three polygons. New virtual layer with linestring intersecting polygons.


1

If you just want to calculate the distance from each buidling the the outline of the plots, go to the bottom to see how to calculate a new attribute field for that. Here, I first give some more detailed information and also a visualization of the line you're looking for. Let's supposte you have three layers named: buildings (polygon), plots (polygon) and ...


1

From the QGIS Toolbox: choose Extract specific vertices in the Vertex indices field, specify the first and last vertex index as comma-separated list: 0, -1 This will create a layer with the start and end vertices only, rather than excluding them from your result set.


1

A way to approach this problem could be by switching from sp to sf objects, and then use sfnetworks and tidygraph which internally use igraph. First we recreate the lines and points as sf objects. x <- c(1,5,6,8) y1 <- c(1,3,4,7) y2 <- c(5,5,5,2) library(sf) #> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1 L = st_sf( ID = c("a", &...


1

The problem can be solved in several simple steps - 5 in total as you can see below. The core of the solution conists in using the Join attributes by nearest tool. Let's say you have a the following line segments with white dots representing start- and end points and the number the id of the line segments. Some segments are connected (end point of 1 = start ...


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