2

I am importing a GADM Global Administrative Areas shapefile into GRASS (using QGIS 2.8.2 interface).

When I do this, multiple additional rows are created in the attribute table.

It goes from this:

Original Attribute Table

To this:

Attribute Table After Import

This makes it difficult to work with. I am using v.in.ogr with and without the "-c" flag, but this doesn't make a difference.

Is there anything I can do to keep the attribute table in the original form?

There is a discussion on importing GADM into GRASS stating that importing causes it to crash, but it doesn't help here. Further I am importing a very small subset of GADM (~20 polygons, some with edges touching). There is documentation on simplifying GADM, but this is beyond my capabilities.

5

You need to use the "key" parameter of v.in.ogr and define it in a way that the ID column is used.

In your case try "ID_0" as name of column used for categories (i.e. "key=ID_0"). If not given, categories are generated as unique values and stored in 'cat' column - this is what happened in your case so far.

  • Thank you very much for this! This works perfectly. I had to install GRASS 7.0.1, as the "key" parameter doesn't seem to be available on the version of GRASS which is currently available through QGIS (v.6). – Sarracenia Oct 17 '15 at 12:27
  • Good - and you may enjoy all the trac.osgeo.org/grass/wiki/Grass7/NewFeatures – markusN Oct 18 '15 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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