]> www.wagner.pp.ru Git - sites/home_page.git/blob - geography/fGIS/tclext.html
fixed broken geography/fGIS/tclext.html
[sites/home_page.git] / geography / fGIS / tclext.html
1 <HTML>
2 <HEAD>
3 <TITLE>fGIS Tcl extension</TITLE>
4 <META NAME="description" CONTENT="Linst of Tcl extensions used in fGIS">
5 </HEAD>
6 <BODY>
7
8 <H1>fGIS Tcl extension</h1>
9
10 <!-- CONTENT NUMBERED NESTED --><OL>
11 <LI><A HREF="#toc_section0">Data objects</A>
12 <LI><A HREF="#toc_section1">Layers</A>
13 <LI><A HREF="#toc_section2">Regions</A>
14 <LI><A HREF="#toc_section3">Planchets - map visualisation</A>
15 <LI><A HREF="#toc_section4">Layer visualisation modes</A>
16 <LI><A HREF="#toc_section5">External program interface</A>
17 <LI><A HREF="#toc_section6">Database connectivity</A>
18 <LI><A HREF="#toc_section7">Tools and bricks</A>
19 </OL>
20 <!-- END CONTENT -->
21
22 fGIS Tcl extnesion consists of two parts:
23 <OL>
24 <LI> one that allows GIS data manipulation within Tcl script
25 <LI> one that allows to view maps in Tk interface.
26 </OL>
27 In future version they would be separated into different Tcl packages,
28 thus allowing to use non-Tk part for processing data without graphical
29 interface.
30 <P>
31 <A NAME="toc_section0"></A><H3>Data objects</H3>
32 <DL>
33 <DT><A HREF=man/raster.n.html>raster</A>
34 <DD> An object which represents raster file in Tcl script. Allows
35    to access data by coordinates, access metadata, stored in raster file
36    itself, edit raster, and even performs some, relatively simple,
37    analysis. 
38    <P>
39    <b>raster</b> object is combination of raster file and reclass table,
40    thus you can create many raster objects with different semantics from
41    one raster file thus saving disk space and other system resources.
42 <DT><A HREF=man/vector.n.html>vector</A>
43 <DD>The same thing for vector maps <B>(not written yet)</B>
44 <DT><A HREF=man/palette.n.html>palette</a>
45 <DD>   Object which handles color table
46 <DT><A HREF=man/patterns.n.html>patterns</A>
47 <DD> Handles set of patterns used to visualize maps
48 <DT><A HREF=man/legend.n.html>legend</A>
49 <DD>Stores table of corespondence between raster object classes and
50 semantic (string) values
51 <DT><A HREF=man/projection.n.html>projection</a>
52 <DD>stores projection information and converts coordinates from lat/long
53 to X/Y and vice versa. It is based on <A
54 HREF="http://kai.er.usgs.gov/ftp/mapgenproj.html">Projection library by
55  Gerald Ian Evenden</a>
56 </DL>
57
58 <A NAME="toc_section1"></A><H3>Layers</H3>
59
60 <A HREF=man/layer.n.html>Layer</a> Tcl representation of functional map
61 concept. This is an object, which can return you semantic information
62 for given coordinate, or draw itself as chartographic representation of
63 information it keeps.
64 <P>
65 There are lot of different layer types which are created from different
66 data sources. Classification looks like:
67 <OL>
68 <LI>raster layers
69  <OL><LI> raster - static data, read from file with tabular legend
70  <LI> dem - static data with values calculated from file classes by
71   mathematical function
72  <LI> chart - dynamic data obtained from database query 
73 </OL>
74 <LI>vector layers
75  <Blockquote>
76    <I>Needs further investigation</I>
77  </blockquote>
78 <LI>point layers
79  <OL>
80   <LI>tag - set of points with arbitrary values, plots itself as labeled
81     signs
82   <LI>diagram - set of points with vector of numeric values each,
83 plotted as bar or pie chart
84   <LI>observation - set of points which get values from database query
85  </OL>
86 </OL>
87
88 Layer object have some methods and properties, but usially end-user
89 should operate with layer as whole, passing its name to high-level
90 library procedures, rather than invoking its individual method. Even
91 visualisation of layer is handled by &quot;asking plachet (mapping
92 window) to show particular layer&quot; as opposed to &quot;asking layer
93 to show itself in particular planchet&quot;.
94
95 <A NAME="toc_section2"></A><H3>Regions</H3>
96
97 Region is collection of map, which cover same territory and have same
98 projection, but may differ in spatial resolution. <A
99 HREF="man/region.n.html">region</a> tcl object exist, becouse there
100 are some properties of region itself - projection and division into
101 subregions. It is high level object, which intended to be manipulited
102 by end-user rather than application programmer, like layer.
103
104 <A NAME="toc_section3"></A><H3>Planchets - map visualisation</H3>
105
106 Map visualisation in f(GIS) is handled via special Tk widget, called
107 <a href=man/planchet.n.html>planchet</a>. Planchet is much like Tk
108 canvas and supports all operation of canvas (Actually, it is derived
109 from canvas). In addition, it has real-world coordinates, and knows its
110 current scale. It also keeps track of layers currently displayed, which
111 allows it to handle panning and scaling. 
112 <P>
113 It also have &quot;look
114 feature&quot; which allows it to return values some list of layers (not
115 neccessary ones currently displayed). By default it displays this
116 list in pop-up window upon right mouse click. 
117 <P>
118 Planchet also knows if
119 it has geographical projection defined. If so, it is able to display 
120 current latitude/longitude of mouse pointer. Otherwise it just shows
121 real-world coordinates.
122 <P>
123 To simplify designing of user-interfaces we've introduced a notion of
124 <I>helper widgets</I>. It means that planchet keeps track of several
125 widgets (status line, legend box, zoom/unzoom buttons) and updates 
126 their states according to its own state changes. These widgets are not
127 part of planchet and their placement in application GUI is left to
128 application designer.
129 <P> Additional attributes of planchet are <i>scale ruler</I> and
130 <I>geographic grid</I>, which can be shown or hidden at any time.
131     
132 <A NAME="toc_section4"></A><H3>Layer visualisation modes</H3>
133
134 f(GIS) supports various layer visualisation modes. 
135 Raster layers can be drawn in opaque colors (which is traditional for
136 raster GIS), in patterns, and symbols. Both symbol and pattern view
137 are transparent and can be overlaid over other layers. They both use
138 same pattern set object to store information about pattern symbol
139 shapes. Difference between pattern and symbol mode is that in pattern
140 mode patterns can be clipped by polygon boundaries when in symbol mode
141 symbol is drown wholly if its central point belong to corresponding
142 class or not drawn at all, and never would be drawn partially.
143 <img src=drawing-modes.gif align=center> 
144
145 <A NAME="toc_section5"></A><H3>External program interface</H3>
146
147 Most GIS operations in f(GIS) are implemented as <A HREF="EPU.html">
148 external utilities</a>, which allows to execute them in parallel with
149 main GUI applications. But there should be easy way to invoke them from
150 GUI as well as from Tcl prompt. So, Tcl library provides helper
151 procedures which allows to construct <A
152 HREF="usercmd.html">high-level</a> commands, which invokes utility, 
153 translating high-level concepts as layers and region to lower-level
154 concepts, which are understood by utilities, and displays its progress
155 in separate window.
156
157 <A NAME="toc_section6"></A><H3>Database connectivity</H3>
158
159 It has been said already, that f(GIS) doesn't even try to implement
160 home-grown database management system. Instead, it uses various 
161 RDBMS
162 connectivity extensions, available for Tcl. Unfortunately these
163 extensions don't have so unified interface as provided by DBI package
164 for Perl language. So, it was neccessary to develop additional
165 abstraction layer <A HREF=TclDBI.html>TclDBI</a> which allows to write
166 database-related parts of f(GIS) without regard to particular RDBMS
167 server behind it.  (recently tdbc extension appeared to fill this gap).
168
169 <A NAME="toc_section7"></A><H3>Tools and bricks</H3>
170
171 Being a large and complicated Tcl application, f(GIS) uses a lot of
172 general purpose procedures, widgets and other reusable pieces of code.
173 In difference with commercial applications, all this tools are open 
174 and usable for application developer and even end user. Most notable of 
175 them include:
176 <UL>
177 <LI><A HREF="http://www.cs.uoregon.edu/research/tcl/script/widget/">
178  megawidget library</a> by J. Hobbs
179 <LI><A HREF="http://www.cs.uoregon.edu/research/tcl/capp/">Tabular
180 widget</a> by same author
181 <LI><A
182 HREF="http://www.fe.msk.ru/~vitus/works/works_tcl.html#getopt">Getopt</a>
183 library
184 <LI><B>Object orientend extension</B> used for developing layers.
185 </UL>
186 </BODY>
187 </HTML>