I have a street map where one street(consisting of 2 lanes each) is shown as one line. If I click on that line, there are two objects (one object for each lane) listed like in the following image:
For each object, I do have the From/To Node which gives me the direction of the lane. What I want to do is to assign street signs (which are represented as blue points) to the nearest lane. That is why I need to move both Lane objects in the opposite direction so they approach the proper street sign. In the end, it should look like this.
So, with respect to the direction of the vector, the vector must always be shifted to the right.
Is there some sort of algorithm to achieve this?
As I have to do this which 6000 other streets, I will probably have to write a python script to do this.
Is there a possibility to move curved lines too without converting them to points?
What I have tried so far is a QGIS plugin called "Line Offset" which creates a parallel line of a selected polyline feature at a given distance. I do not know if this plugin solves my problem, but I would like to give it a try. I unchecked all layers in my layer window except the street map layer. Furthermore, I selected (in the attribute table) all objects I want to move. In the plugin's interface, I have the following options set:
But it always stops running and gives me the following error:
Maybe someone has already worked with this plugin and can figure out what I am doing wrong. It says "QgsRasterLayer" object has no attribute.. but isn't my streetmap layer a polyline-layer?
This doesn't make sense to me.
I have selected both the layer and the objects of the layer, but I still get the same error.
Line Offsest
plugin did not work for me in QGIS 2.18.16. Alternatively I usedSingle sided buffers (and offset lines) for lines
tool, which is in theProcessing toolbox | GDAL/OGR | [OGR] Geoprocessing
. Hope this works for you too. (Just chooseOffset curve
option for the "Operation" option).