Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

My problem is the following: i have a line shp (target layer) and a point shp (join layer). the second one (point layer) holds an attribute which i want to join with a line layer based on closest distance to the line. Points and lines are not intersecting

I can do this with arcgis and spatial join(match option: closest), but i don't know how can i achieve this in Qgis.

I'd really appreciate an answer for this.

Miha

share|improve this question
1  
There is a tool to do Join by location but it doesn't have an option "closest". I don't know if there is any workaround. In general please evaluate to support the development of your missing, favorite options/tools, it is also this way that users can help this piece of software grow. – Giovanni Manghi Oct 16 '11 at 16:43

1 Answer

I don't think there's a 'core' QGIS function for this. However, install the MMQGIS plugin, and use the 'hub distance' tool. Chose your points as the "Source Points" layer, and your lines as the "Destination Hubs Layer" and set "Output Shape Type" to "Line to Hub." This will give you a shapefile of lines (with length) that join the closest features. Conveniently, it also adds the ID of the closest feature to the attribute table.

share|improve this answer
this should be marked as the answer, subject to minor edit of "lines" v "points" – Willy May 10 '12 at 1:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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