Hot answers tagged

4

In PostGIS, this can be done quite easily with a Cartesian product or CROSS JOIN in SQL, ie, joining a table on itself and using the 2nd form of ST_MakeLine. So, assuming a table called points with an id and a geometry called geom, this would look like: SELECT a.id, b.id, ST_MakeLine(a.geom, b.geom) FROM points a, points b WHERE a.id < ...


4

Tested on QGIS 2.18 and QGIS 3.4 I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Let's assume we have 10 features in "points" layer respectively, see image below. With the following Queries, it is possible to achieve the lines between all possible connection of points excluding themselves. SELECT p1.id ||...


3

Depends on the software. If the start and end points of a polyline overlap, the polyline can either be seen as open or closed. Some software like AutoCAD can automatically close polylines allowing you to extrude them immediately in the z-direction to create a 3D polygon. Other software like QGIS will see the same polyline as open (which may explain why ...


3

If you're willing to use GRASS, you can do this with the v.clean module, choosing the rmdangle tool, and a suitable threshold. # STart GRASS using your polyline shapefile (to determine the coordinate system for a new location) grass -c polyline.shp YourPathToGISDBASE/YourLocation/YourMapset # Import the shapefile v.import polyline.shp output=polylines # And ...


3

You may be able to accomplish this, using the clip function and a buffer. If you place a very thight buffer and delete everything that either touches it or is completly encased you may get your results.


3

Using Expression in QGIS Geometry by Expression tool - Provided: Road layername is roads and it has road_no field to represent the road name (A, B, C) State layername is states and it has state_no field (1, 2, 3) Start Geometry by expression tool in the QGIS Processing toolbox - Vector geometry Select your roads layer as input (1), and choose Line as ...


2

Here is a PyQGIS code for do this, comment in code. Just adapt variables in the beginning of the script. The result is a new mutliline layer with one field "Line". from qgis.PyQt.QtCore import QVariant # variables layer_name = "My_layer_name" line_field_name = "Line" m_threshold = 0.5 new_name = "new_lines" order_variable = "Fiducial" # find point vector ...


2

I believe the best way would be rasterizing your polygon and calculating the best cost-effective route, as proposed here: Create an optimised path between nodes avoiding polygons entities


1

If you prefer a solution using the built-in tools, this can be done in two steps using tools from the Processing Toolbox. Use densify by interval to add vertices in any lines longer than 0.5m. (Note: this tool measures distance in the same units used by the layer CRS.) Use explode lines to split the lines at their vertices.


1

Simplest solution I found so far: Create a vector line object Draw a segment In the Processing Toolbox, under Vector Geometry, double-click Extend lines and set the extend distance for either end of the segment Click Run: it creates a new layer with the extended line. To add it as a button in the toolbar for quick access: Go in Settings > options > ...


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