# converting vector points to lines using QGIS 2.8 [closed]

I have about 350k of vector points that represent parking spaces, I need these points to be converted to lines and connected to the nearest point available.

I've tried the point2one plugin, but connects parking points that aren't relevant to each other, and I've tried doing a nearest neighbor analysis in GRASS, but the data is to large and just crashes the program.

any suggestions?

• Can you add a diagram of what you mean by "points to be converted to lines and connected to the nearest point available"? Nov 17, 2015 at 19:30
• This sounds less like 'converting' points to lines and more like just connecting two sets of points with lines. Actually, this sounds like a spider diagram. You might start by looking at gis.stackexchange.com/questions/2823 and its Related questions on the right side of the page. Nov 17, 2015 at 20:31
• My apologies, yes essentially I'm basically connecting two sets of points, but when I tried with the point2one it created lines connecting to just random points, I need the lines to connect to the next corresponding parking points on it's path if that makes sense? -Again my apologies, don't use this much. Nov 19, 2015 at 16:57
• A graphic or screenshot edited into your question may help here. I thought you were talking about something like tying parking points to an assigned central pay station point or something. From your comment it looks more like you're trying to create some sort of route to go from one parking point to the next like someone doing meter inspections or something, which is a completely different problem. In one case you need common attributes to establish a relationship between the two point sets. In the other you need some kind of ordering attribute to establish sequence. Nov 20, 2015 at 18:00

```SELECT a.osm_id, ( SELECT b.osm_id FROM planet_osm_point b ORDER BY a.way <#> b.way LIMIT 1) FROM planet_osm_point a;```
• There is no need for attribute join. The <#> operator calculates the distance. If you have two layers simply substitute one for `planet_osm_point a` and the other for `planet_osm_point b`. Dec 4, 2015 at 0:08