[R-sig-Geo] plotKML - set color according to category

Almut Schlaich - Werkgroep Grauwe Kiekendief almut.schlaich at grauwekiekendief.nl
Wed Jul 29 17:12:37 CEST 2015


Dear Dr. Hengl,

First of all, I would like to thank you and your colleagues for the 
great package plotKML that I really enjoy using.
This was indeed a missing link to visualize data, in our case tracking 
data, in Google Earth to easily explore them visually.

I would like to ask you a question about the possibilities to color the 
points according to a variable.
In my data table I have a column with classification category "phase" 
(e.g. migration, stopover, breeding, wintering etc.).
Using e.g.: 
kml_layer(data,colour=phase,colour_scale=worldgrids_pal[[4]]), I get 
tracks nicely colored depending on category.

But the difficulty arises when one bird has less levels of the category 
than another (e.g. one bird making no stopover).
In this case the same colors are used, but for different values of the 
category, just in the order of first appearance.
To easily compare tracks between individuals I would like to color the 
same category always in the same color. I tried to
define the colors for each category and give the column with a color 
value per point to the kml_layer function, but this
didn't work. Is it possible to determine the color of each point?

At the moment I just use the combination of kml_open, kml_layer and 
kml_close to produce the output.
Unfortuntely, the much more beautiful and handy plotKML for Space-time 
Trajectory Data Frames doesn't work for the
tracks since they have too many points. Could you tell me what is the 
limit for this? And might it be possible for more
points in near future?

Thank you in advance for your help!

Kind regards,
Almut Schlaich

-- 
Almut Schlaich

Werkgroep Grauwe Kiekendief
telefoon: +31(0)650459766
e-mail: almut.schlaich at grauwekiekendief.nl
postadres: Postbus 46, 9679 ZG Scheemda
www.grauwekiekendief.nl
twitter: @grauwekiek
facebook: www.facebook.com/pages/Werkgroep-Grauwe-Kiekendief/190585087622000



More information about the R-sig-Geo mailing list