Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of vector lines in grass which I need to convert into polygons. However, because of bad base data, the polygons don't always close. To fix this, I need to extend each disjointed line by a certain distance and connect it to the first line it hits. The problem is that I can't figure out how to do this. I have experimented with v.clean, v.generalize, v.edit, and (converting to a thinned raster) r.grow, r.neighbors and even r.flow, but I can't find anything which will let me do this.

Can anyone point me to a tool that would do this?

share|improve this question
possible duplicate of How do I draw on a vector map in GRASS? – R.K. Oct 14 '12 at 17:55

You should use the tool v.clean with the option tool=snap and specify the correct thresh setting to snap the lines to the closest vertex. More details can be found here [1]


share|improve this answer
I tried that, but there are two problems: 1, it seems to snap to the first point found in threshold, not necessarily the closest. And 2, it also snaps ends which are already joined together. Am I doing something wrong? – aquavitae Sep 14 '12 at 12:21
if there aren't too many polygons to edit, you could the use vector digitizer in the wxgui… – dmci Sep 14 '12 at 12:33
Only a few million... It definitely needs to be automatible. – aquavitae Sep 14 '12 at 13:37
... then will be interesting. – markusN Sep 14 '12 at 14:32
I looked at v.edit, but can't see a way to do it with that either. – aquavitae Sep 26 '12 at 12:07

Your Answer


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.