vcs icon indicating copy to clipboard operation
vcs copied to clipboard

Places annotations over globe

Open jaigsingla opened this issue 8 years ago • 4 comments

Hello ,

How can I place annotations or vectors layers over globe in this canvas?

thanks Jai

jaigsingla avatar Sep 25 '17 11:09 jaigsingla

I will add a jupyter notebook for this, but essentially if you have two variables (data1, data2) on the same grid

import vcs
x=vcs.init()
vec = vcs.createvector()
x.plot(data1,data2,vec)

To control option on vectors

vec.list()

will show you the list of options.

Annotation are made via templates

t = vcs.createtemplate()
# Move the title
t.title.x = .5
t.title.y = .8
data.title = "My Title"
x.plot(data1,data2,vec,t)

doutriaux1 avatar Sep 25 '17 14:09 doutriaux1

Hello,

Actually i also want to place place names like country names, major river names, mountains etc on the base map.

thanks Jai

jaigsingla avatar Sep 26 '17 08:09 jaigsingla

ok I will create a jupyter notebook to explain this as well. I'll post the link here for now:

import vcs
tmpl = vcs.createtemplate()
gm = vcs.createisofill() # or anyone you want
lon1, lon2 = -180, 180
lat1, lat2 = -90, 90
gm.datawc_x1 = lon1
gm.datawc_x2 = lon2
gm.datawc_y1 = lat1
gm.datawc_y2 = lat2
x.plot(data,gm,tmpl)

txt = vcs.createtext()
txt.viewport = [tmpl.data.x1,tmpl.data.x2,tmpl.data.y1,tmpl.data.y2] # match drawing are to the one of the data
txt.worldcoordinate = [gm.datawc_x1,gm.datawc_x2,gm.datawc_y1,gm.datawc_y2] # match coordinate to the ones used when plotting data
txt.string = ["Livermore, CA"]
txt.x = [-121.768]
txt.y=[37.6819]
txt.color="red"
txt.height =23
txt.halign = "center"
# more can be configured
txt.list()
x.plot(txt)

doutriaux1 avatar Sep 26 '17 16:09 doutriaux1

Hello,

Thanks for sharing this . It works well. So , like that we can go on adding information as n when required.

thanks

jaigsingla avatar Sep 27 '17 06:09 jaigsingla