I'm trying to figure out a way to snap lines to a polygon layer, but only at the intersecting point. Here is a sample picture of what I'm working with. I have a layer of polygons and a line string layer.
My goal is to create a topology from the polygons, thin the verticies, and then snap the line layer to polygon verticies within some threshold (i.e. 20 meters). However, I haven't figured out a way to do this using any of my available software, which is QGIS, Grass 7, and PostGIS. Ultimately I would like to be able to make changes to say the polygon layer, and have those changes affect the line string layer, but still be able to differentiate the layers and all their attributes. I have tried various tools in GRASS to no avail, and have only just begun to learn and investigate PostGIS.
Does anyone have suggestions on ways to accomplish this task using these open source tools? Even multi-step, more complex solutions would be welcome, as I hope to eventually script this work flow as much as possible.