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

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

When I import a shapefile into GRASS, it seems to arrive as 3 layers. I.e. they appear in the qGIS toolbox browser as:

myMap 0_polygon, myMap 1_polygon, myMap 2_polygon

Is there a way to merge the layers into one? I have run:

v.clean tool=snap,break,rmdupl,bpol thresh=10 input=myMap output=myMapCleaned

And searching on this topic suggests that I should now run v.patch to merge the layers. But how do I specify the individual layers in the 'input=...' string? Thanks.

share|improve this question
Is "myMap 0_polygon" really lacking any features? – underdark May 29 '11 at 12:35
@underdark Yes. The polygons in the original shapefile seem to be distributed among the 3 layers. 1_polygon seems to contain most of the area and the other two look like they contain small bits - possibly generated due to me running a vector simplify operation prior to import into GRASS. Though some of the bits are quite big and I need to retain. – spiderplant0 May 29 '11 at 12:39
Have you tried importing into GRASS first? Using GRASS, you can then simplify the polygons while keeping the topology intact. (Imho, GRASS generates multiple layers if there are overlapping polygons in the dataset.) – underdark May 29 '11 at 12:43
@underdark I simplified prior to import as the map is quite large and GRASS seems to grind to a halt and eventually crash if I dont reduce the vector sizes. – spiderplant0 May 29 '11 at 12:49
@underdark Most of the polygons are in one layer and after I do a 'remove small area' there are just 2 left. I want to do a dissolve after this so it shouldnt matter if they overlap? – spiderplant0 May 29 '11 at 12:51
up vote 4 down vote accepted

polygon_0 are the holes

polygon_1 are the areas with one centroid

polygon_2 are the area with two centroids (overlapped areas)

GRASS has a fully topological vector data model, is different from the most of other GIS packages that are relying on the simple features model.

So when you import into GRASS it always import holes and overlapped areas as separate layers. This is a very good way to know how good is our original vector. If you use the parameters "minarea" and "snap" during importing ( you can get rid of many of the topological issues you can have in the original vector.

share|improve this answer

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.