source: branches/multichoice/examples/mapviewer/gdal/gdal_example.tcl @ 6371

Last change on this file since 6371 was 6371, checked in by dkearney, 8 years ago

merging changes from trunk into multichoice branch

File size: 944 bytes
Line 
1package require Tk
2package require Rappture
3package require RapptureGUI
4
5Rappture::resources::load
6
7set commondir [file join [file dirname [info script]] .. common]
8source [file join $commondir geovis_settings.tcl]
9
10set width 400
11set height 300
12wm geometry . ${width}x${height}
13update
14
15set mapviewer [Rappture::MapViewer .g]
16
17pack .g -expand yes -fill both
18
19# create a Gdal layer from a local geotiff
20# here we use the local:// prefix to specify that the
21# tif file needs to be transferred from the # client to the server.
22
23array set gdalParams {
24    url {local://world.tif}
25}
26array set layerParams {
27    label "UTM GeoTIFF Layer"
28    description "geotiff from gdal website"
29    opacity 1.0
30}
31
32# create a map object
33set map [Rappture::Map #auto]
34
35# add all layers to the map object
36$map addLayer image \
37    test [array get layerParams] \
38    gdal [array get gdalParams]
39
40# add a map to the vis client
41$mapviewer scale $map
42$mapviewer add $map
Note: See TracBrowser for help on using the repository browser.