1 | package require RapptureGUI |
---|
2 | |
---|
3 | set commondir [file join [file dirname [info script]] .. common] |
---|
4 | source [file join $commondir geovis_settings.tcl] |
---|
5 | |
---|
6 | set width 400 |
---|
7 | set height 300 |
---|
8 | wm geometry . ${width}x${height} |
---|
9 | update |
---|
10 | |
---|
11 | Rappture::MapViewer::SetServerList $GEOVIS_SERVERS |
---|
12 | set s [Rappture::MapViewer .g [list localhost:2015]] |
---|
13 | |
---|
14 | pack .g -expand yes -fill both |
---|
15 | |
---|
16 | # create a OSGeo WMS layer |
---|
17 | set dp1 [Rappture::GeoMapDataProviderWMS #auto \ |
---|
18 | {http://vmap0.tiles.osgeo.org/wms/vmap0} "basic" "jpeg" -transparent false] |
---|
19 | set l1 [Rappture::GeoMapLayerImage #auto $dp1 \ |
---|
20 | -label "OSGeo WMS Layer" \ |
---|
21 | -description "base layer from OSGeo" \ |
---|
22 | -opacity 0.9 ] |
---|
23 | |
---|
24 | # create a Population Density 2000 layer |
---|
25 | set dp4 [Rappture::GeoMapDataProviderWMS #auto \ |
---|
26 | {http://sedac.ciesin.columbia.edu/geoserver/wms} \ |
---|
27 | "gpw-v3:gpw-v3-population-density_2000" "png" -transparent true] |
---|
28 | set l4 [Rappture::GeoMapLayer #auto $dp4 \ |
---|
29 | -label "Population Density 2000" \ |
---|
30 | -description "Columbia Population Density 2000 Data" \ |
---|
31 | -opacity 0.9 ] |
---|
32 | |
---|
33 | # create a crop climate layer |
---|
34 | set dp5 [Rappture::GeoMapDataProviderWMS #auto \ |
---|
35 | {http://sedac.ciesin.columbia.edu/geoserver/wms} \ |
---|
36 | "crop-climate:crop-climate-effects-climate-global-food-production" \ |
---|
37 | "png" -transparent true] |
---|
38 | set l5 [Rappture::GeoMapLayer #auto $dp5 \ |
---|
39 | -label "Crop Climate" \ |
---|
40 | -description "Columbia Crop Climate Data" \ |
---|
41 | -opacity 0.5 ] |
---|
42 | |
---|
43 | |
---|
44 | # create a map object |
---|
45 | set m [Rappture::Map #auto] |
---|
46 | |
---|
47 | # add all layers to the map object |
---|
48 | $m layer add -format blt_tree [$l1 export -format blt_tree] |
---|
49 | $m layer add -format blt_tree [$l4 export -format blt_tree] |
---|
50 | $m layer add -format blt_tree [$l5 export -format blt_tree] |
---|
51 | |
---|
52 | # add a map to the vis client |
---|
53 | $s scale $m |
---|
54 | $s add $m |
---|