[GRASS-user] negative categories?
Achim Kisseler
ak7 at jupiter.uni-freiburg.de
Sun Oct 11 08:39:13 EDT 2009
Hi Hamish,
thanks! I did like you said and it works fine.
Because the database (sqlite) has its own ids, it can handle the grass
internal cats even when they are negative.
Multiplying forward and backward let me identify old numbers.
I was a bit afraid, that the numbers result are to hight, because I used
three different kinds of objects coded as positive, negative and
negative multiplied with 100000.
Achim
Hamish schrieb:
> Achim wrote:
>> from a raster map I get vector polygons with r.to.vect.
>> As I use the -v flag, I get one category-number for each
>> value. This is what I want.
>>
>> My problem: v.to.db does not update negative cats! Is there
>> any way to handle this?
>>
>> I dont want to loose the identification, nor miss the -v Flag: Having
>> raster-values in a column "value" is not clean, due to the fact, that I
>> have eg. to remove small trapped cells, calc center of gravity and more.
>
>
> the key column ID is meant to be a positive number. attribute columns can
> be whatever you like.
>
> You can keep a form of the number positive with r.mapcalc, e.g.:
>
>
> r.mapcalc "pos_map = if( orig_map <= 0, 100000 - orig_map, orig_map )"
>
>
> then -5 becomes 100005, etc.
>
>
> some SQL magic can add a new column for the vector map and repopulate it
> with the original +/- values.
>
>
> Hamish
>
>
>
>
>
More information about the grass-user
mailing list