3

I have two layers:

Layer1: Linelayer with different types (stored als attribute values. Example: soil/material in which pipes are installed)

Layer2: Point-Layer to mark transition between different Line-types.

I wonder if it's possible to create the points automatically (one point at every transition of my attribute line-type):

enter image description here

Edit1: A tool that just sets a point at the end of every line segment is not enough as there can be two or more linesegments with the same attribute in succession. (See screenshot2: the point in the red rectangle should not exist in the point layer!) the point in the red rectangle should not exist in the point layer!

5
  • 1
    You can create a dissolved layer before generating points. (Vector --> Geoprocessing Tools --> Dissolve...) as a dissolve field choose your "type" attribute. – Oto Kaláb Nov 14 '16 at 14:37
  • When I dissolve the layer then I will have only one line segment for each type.but there can be several segments within one longer line with the same type. so the dissolve does not work for me :( – markgraeflerland Nov 14 '16 at 15:14
  • maybe it's not the properly workaround, but if you select i.e. all the asphalt lines, export them, extract end vertices, do it again with the other two classes? in the end you will have duplicate points, but you can easily delete them identifying the overlapping ones – Vale Nov 14 '16 at 15:56
  • 1
    After Dissolve, convert from multi part to Single part. – klewis Nov 14 '16 at 15:56
  • 1
    sorry, I forgot this :). Try convert multipart to singleparts features (Vector --> Geometry Tools --> Multipart to Singleparts) – Oto Kaláb Nov 14 '16 at 15:59
1

Maybe this is not the best solution, but you might try.

  1. Based on the pipes types, split the pipes shapefiles into 3 shapefiles, which are "asphalt.shp", "cobblestone.shp" and "wetland.shp".
  2. By using "Line intersections" tool, generate the intersection points between them. But need to repeat this steps for few times. For example, asphalt - cobblestone, asphalt - wetland, cobblestone - wetland. Line intersections
  3. Merge the 3 outputs (intersection points) into 1 shapefile "allintersectionpoint.shp"
  4. Generate the starting and ending points along the pipes polyline by using "Locate points along lines" which mentioned by @CwecU
  5. Get the intersection of "starting_ending_points" with "allintersectionpoint". The result will only includes the transition points which located at the starting/ending of different types of pipes.
0

There is a plugin that can do that:

"Locate points along lines" is simple tool for creating points along lines with given offset and interval.

With "Locate points along lines" plugin you can:

  • create points only on selected polylines;
  • define offset and interval parameters;
  • choose whether points should inherit attributes from source polylines;
  • force adding endpoints of polylines;
  • force adding vertices of polylines.

The resulting layer is 'memory layer' which you can export to different vector format. Setting interval to 0 will cause adding vertices only (startpoints, endpoints or all vertices - depends on the options checked).

https://plugins.qgis.org/plugins/LocatePoints/

Important information added from comments:

You can create a dissolved layer before generating points. (Vector --> Geoprocessing Tools --> Dissolve...) as a dissolve field choose your "type" attribute.

After that try convert multipart to singleparts features (Vector --> Geometry Tools --> Multipart to Singleparts).

2
  • thanks for your answer. but if two or more line segments with the same attribute succeed the tool will create a point where no point should be created – markgraeflerland Nov 14 '16 at 14:04
  • With the dissolve tool I wil end up with one feature for each type and not single (merged) lines for each connected part of lines with the same attribute. if I use multipart to singlepart as recommended afterwards I will get the same result as the input-Layer – markgraeflerland Aug 22 '17 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.