[GRASS-user] split 'multi-polygons' in grass, how to?
Martin Koch
m.koch at bridgis.nl
Wed Aug 28 23:44:09 PDT 2013
Op 28 aug. 2013, om 14:41 heeft Moritz Lennert <mlennert op club.worldonline.be>
het volgende geschreven:
> On 12/08/13 13:29, Martin Koch wrote:
>>
>> In the resulting map not all centroids have identical cats.
>
> I imagine this is supposed to say: "not all centroids have unique cats" ?
>
Stand corrected….
>> For the next step in my process, I need all centroids to have unique
>> cats, with their own attributes-record in the database. I have to
>> 'split' the 'multi polygons' (in geometry-terms) so to say.
>
> You try with v.category layer=2 op=add to create new unique cat values for you centroids in layer 2, v.db.addtable to create and attribute table for layer 2 and then v.to.db [...] layer=2 op=query qlayer=1 qcolumn=cat to get the original cat values into the new attribute table.
>
Thanks Moritz … will implement this elegant solution in the next version of my control script. I rarely need more than one layer in my maps, so using that possibility did not come to my mind when I needed it. I now do basically the same with some temporary tables in between.
>> p.s. Some years ago, doing something similar, I did not have this
>> problem…….
>
> Could you give the exact commands and version of GRASS you use ?
>
I have to apologize on this. I was a bit over reacting. Only remembered that at a certain stage in my old process I had unique cat's. Looking closer at the years old script in my repo reveals I send those maps to and from PostGIS for some other reason. Thus magically reappearing with unique cat's.
Kind regards,
Martin
More information about the grass-user
mailing list