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