Snapped or not snapped, that is the Question...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Snapped or not snapped, that is the Question...

Nicolas Cadieux
Hi,

I am working on a network of rivers.

I have singlepart lines (shape file) that appear snapped in QGIS. I even forced the lines to snap using the « snap Geometries to layer » tool. (Using the same line layer as both input layer and Reference layer using a 10m tolerance ). (Behaviour is set to the topmost option.)  Some lines have been snapped using this method but not all.

When I zoom in, I cannot see that the line are not snapped.  But when I use Python Shapely module to count the interesecting geometries on the end nodes, some snapped node in the middle of the network appear to be intersecting with only one geometry (and not two or more).  This seems to be confirm by the spatial selection tool in QGIS also.

How could this be?

Is there a different tolerance to what is considered a snapped line in different software?

How else can I find lines that are not snapped in QGIS?

A penny for your thoughts!
Nicolas

Qgis3.6.2 on Windows X
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Snapped or not snapped, that is the Question...

Nicolas Cadieux
Hi,

Included is a small section of the network with the underlying problem.

Nicolas

On 2019-05-08 1:53 p.m., Nicolas Cadieux wrote:

> Hi,
>
> I am working on a network of rivers.
>
> I have singlepart lines (shape file) that appear snapped in QGIS. I even forced the lines to snap using the « snap Geometries to layer » tool. (Using the same line layer as both input layer and Reference layer using a 10m tolerance ). (Behaviour is set to the topmost option.)  Some lines have been snapped using this method but not all.
>
> When I zoom in, I cannot see that the line are not snapped.  But when I use Python Shapely module to count the interesecting geometries on the end nodes, some snapped node in the middle of the network appear to be intersecting with only one geometry (and not two or more).  This seems to be confirm by the spatial selection tool in QGIS also.
>
> How could this be?
>
> Is there a different tolerance to what is considered a snapped line in different software?
>
> How else can I find lines that are not snapped in QGIS?
>
> A penny for your thoughts!
> Nicolas
>
> Qgis3.6.2 on Windows X
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

FinalNetworkFiles.zip (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Snapped or not snapped, that is the Question...

Nicolas Cadieux
Thanks Micha,

That will be very useful.  I figured out the vertex thing later by manually adding one.  I thought the QGIS snapping tool would do that but it looks like the QGIS tool tolerance looks for the nearest vertex but not the nearest line.  Grass v.clean will be very useful.  

I will make a bug report for the QGIS tool as the option selected should have added a vertex IMHO.

Nicolas

Le 9 mai 2019 à 05:33, Micha Silver <[hidden email]> a écrit :

I made a map showing the vertices on each line, and it's clear that the snapping of line ID 13232 and line 13227 did not create a new vertex at the intersection. Have a look at the left hand image in the attached file.


I tried the v.clean module GRASS, instead and the new vertex was correctly created (right hand image in the attached)


v.in.ogr 3D_RiverNetwork_RiversLakes_SingleLines_190508_ExampleOfSnapProblem.shp output=river_network key=ID --o
v.clean river_network out=river_network_clean error=dummy tool=snap,break thresh=20 --o
v.out.ogr --o river_network_clean format=ESRI_Shapefile out=river_network_clean.shp

After the v.clean operation the report showed one additional vertex, more than the original.
My guess is that if there is no vertex within the threshold snapping distance then a new vertex is not created. The GRASS module, on the other hand, creates new vertices (and also saves to an "error" vector map).

Regards,
Micha


On 08/05/2019 21:40, Nicolas Cadieux wrote:
Hi,

Included is a small section of the network with the underlying problem.

Nicolas

On 2019-05-08 1:53 p.m., Nicolas Cadieux wrote:
Hi,

I am working on a network of rivers.

I have singlepart lines (shape file) that appear snapped in QGIS. I even forced the lines to snap using the « snap Geometries to layer » tool. (Using the same line layer as both input layer and Reference layer using a 10m tolerance ). (Behaviour is set to the topmost option.)  Some lines have been snapped using this method but not all.

When I zoom in, I cannot see that the line are not snapped.  But when I use Python Shapely module to count the interesecting geometries on the end nodes, some snapped node in the middle of the network appear to be intersecting with only one geometry (and not two or more).  This seems to be confirm by the spatial selection tool in QGIS also.

How could this be?

Is there a different tolerance to what is considered a snapped line in different software?

How else can I find lines that are not snapped in QGIS?

A penny for your thoughts!
Nicolas

Qgis3.6.2 on Windows X
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918
<river_network.png>

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user