6 |
<!-- $Revision$ --> |
<!-- $Revision$ --> |
7 |
<book> |
<book> |
8 |
<bookinfo> |
<bookinfo> |
9 |
<title>Thuban Manual</title> |
<title>User's Manual for Thuban 1.0</title> |
10 |
<author> |
<authorgroup> |
11 |
<firstname>Jonathan</firstname><surname>Coles</surname> |
<author> |
12 |
</author> |
<firstname>Jonathan</firstname><surname>Coles</surname> |
13 |
<author> |
</author> |
14 |
<firstname>Jan-Oliver</firstname><surname>Wagner</surname> |
<author> |
15 |
</author> |
<firstname>Jan-Oliver</firstname><surname>Wagner</surname> |
16 |
<author> |
</author> |
17 |
<firstname>Frank</firstname><surname>Koormann</surname> |
<author> |
18 |
</author> |
<firstname>Frank</firstname><surname>Koormann</surname> |
19 |
|
</author> |
20 |
|
</authorgroup> |
21 |
<copyright> |
<copyright> |
22 |
<year>2003</year> |
<year>2003</year> |
23 |
<holder>Intevation GmbH</holder> |
<holder>Intevation GmbH</holder> |
24 |
</copyright> |
</copyright> |
25 |
|
<revhistory> |
26 |
|
<!-- comment this first revision out when releasing a real version --> |
27 |
|
<revision> |
28 |
|
<revnumber>1.0pre1 CVS $Id$</revnumber> |
29 |
|
<date>$Date$</date> |
30 |
|
<revremark>Under development.</revremark> |
31 |
|
</revision> |
32 |
|
<revision> |
33 |
|
<revnumber>1.0pre1</revnumber> |
34 |
|
<date>08-Aug-2003</date> |
35 |
|
<revremark>Corresponds to Thuban development release 0.8.1</revremark> |
36 |
|
</revision> |
37 |
|
</revhistory> |
38 |
|
|
39 |
</bookinfo> |
</bookinfo> |
40 |
|
|
41 |
<chapter><title>Introduction</title> |
<chapter><title>Introduction</title> |
42 |
<para> |
<para> |
43 |
Thuban is a Free Software Geographic Information Systems (GIS) viewer. |
Thuban is an interactive geographic data viewer. |
44 |
It is being developed because there is currently no simple interactive |
It has been developed because there was no simple interactive |
45 |
viewer for geographic information available as Free Software. Thuban is |
viewer for geographic information available as Free Software. Thuban is |
46 |
written in Python and C++ and uses the wxWindows library allowing it to |
written in Python and C++ and uses the wxWindows library allowing it to |
47 |
run on many different platforms, including GNU/Linux and Windows. |
run on many different platforms, including GNU/Linux and Windows. |
48 |
</para> |
</para> |
49 |
<para> |
<para> |
50 |
GIS viewers are a necessary tool as they allow one to get a visual |
Geographic data viewers are a necessary tool as they allow one to |
51 |
|
get a visual |
52 |
impression of the positional relationship of the information that may not |
impression of the positional relationship of the information that may not |
53 |
be apparent from simple inspection of the data values themselves. |
be apparent from simple inspection of the data values themselves. |
54 |
Thuban allows the user to create a session that displays |
Thuban allows the user to create a session that displays |
65 |
<section><title>Installation</title> |
<section><title>Installation</title> |
66 |
<para> |
<para> |
67 |
Thuban is actively supported under Debian Testing (sarge), RedHat 7.2, |
Thuban is actively supported under Debian Testing (sarge), RedHat 7.2, |
68 |
and Windows 2000. All the necessary files can be found on the |
and Windows 2000. Thuban depends on the following packages. These |
69 |
|
packages can also be found on the |
70 |
<ulink url="http://thuban.intevation.org/download.html"> |
<ulink url="http://thuban.intevation.org/download.html"> |
71 |
Thuban Download site |
Thuban Download site |
72 |
</ulink>. |
</ulink>. |
73 |
</para> |
<itemizedlist> |
74 |
|
<listitem><para>Python 2.2.1 (<literal>http://www.python.org</literal>)</para></listitem> |
75 |
|
<listitem><para>wxWindows 2.4 (<literal>http://www.wxwindows.org</literal>)</para></listitem> |
76 |
|
<listitem><para>wxPython 2.4 (<literal>http://www.wxpython.org</literal>)</para></listitem> |
77 |
|
<listitem><para>proj 4.4.5 Projection Library (<literal>http://www.remotesensing.org/proj/</literal>)</para></listitem> |
78 |
|
<listitem><para>GDAL 1.1.8 (<literal>http://www.remotesensing.org/gdal/</literal>)</para></listitem> |
79 |
|
<listitem><para>SQLite 2.8.3 (<literal>http://www.hwaci.com/sw/sqlite/</literal>)</para></listitem> |
80 |
|
<listitem><para>PySQLite 0.4.3 (<literal>http://pysqlite.sourceforge.net</literal>)</para></listitem> |
81 |
|
</itemizedlist> |
82 |
|
</para> |
83 |
|
<para> |
84 |
|
Along with the source codes, the download page also offers |
85 |
|
full installation packages for Debian, Windows and RPM-based systems |
86 |
|
(Mandrake, RedHat, SuSE, etc). |
87 |
|
</para> |
88 |
</section> |
</section> |
89 |
|
|
90 |
<section><title>The Main Window</title> |
<section><title>The Main Window</title> |
91 |
<para> |
<para> |
92 |
<screenshot> |
<figure> |
93 |
<screeninfo>The Main Window</screeninfo> |
<title>The Main Window</title> |
94 |
<mediaobject> |
<mediaobject> |
95 |
<imageobject> <imagedata fileref="../images/1_2_mainwindow.png" format="PNG" scale="&imgscale;"/> </imageobject> |
<imageobject> <imagedata fileref="../images/1_2_mainwindow.png" format="PNG" scale="&imgscale;"/> </imageobject> |
96 |
<imageobject> <imagedata fileref="./images/1_2_mainwindow.ps" format="EPS" scale="&imgscale;"/> </imageobject> |
<imageobject> <imagedata fileref="./images/1_2_mainwindow.ps" format="EPS" scale="&imgscale;"/> </imageobject> |
|
<textobject><phrase>The Main Window</phrase></textobject> |
|
|
<caption><para>The Main Window</para></caption> |
|
97 |
</mediaobject> |
</mediaobject> |
98 |
</screenshot> |
</figure> |
99 |
</para> |
</para> |
100 |
|
|
101 |
<para> |
<para> |
131 |
The tool bar provides quick access to the commonly needed tools. |
The tool bar provides quick access to the commonly needed tools. |
132 |
By hovering over each button the user can see a short messages |
By hovering over each button the user can see a short messages |
133 |
describing what the tool does. The tools provided are Zoom In, Zoom |
describing what the tool does. The tools provided are Zoom In, Zoom |
134 |
Out, Pan, Full Extent, Full Layer Extent, Full Shape Extent, Indentify, |
Out, Pan, Full Extent, Full Layer Extent, Full Shape Extent, Identify, |
135 |
and Label. Each of the tools will be explained in further detail later |
and Label. Each of the tools will be explained in further detail later |
136 |
in the manual. |
in the manual. |
137 |
</para> |
</para> |
179 |
<guimenu>File</guimenu> |
<guimenu>File</guimenu> |
180 |
<guimenuitem>Save Session</guimenuitem> |
<guimenuitem>Save Session</guimenuitem> |
181 |
</menuchoice>. A dialog box will open allowing the user to browse |
</menuchoice>. A dialog box will open allowing the user to browse |
182 |
the filesystem and select a place to save the session. Thuban |
the file system and select a place to save the session. Thuban |
183 |
sessions should be saved under a name ending in |
sessions should be saved under a name ending in |
184 |
<varname>.thuban</varname>. If the file already exists the user |
<varname>.thuban</varname>. If the file already exists the user |
185 |
will be prompted to save under a different name or overwrite the |
will be prompted to save under a different name or overwrite the |
189 |
|
|
190 |
<section><title>The Session Info-Tree</title> |
<section><title>The Session Info-Tree</title> |
191 |
<para> |
<para> |
192 |
<screenshot> |
<figure> |
193 |
<screeninfo>Session Info Tree</screeninfo> |
<title>Session Info Tree</title> |
194 |
<mediaobject> |
<mediaobject> |
195 |
<imageobject><imagedata fileref="../images/2_4_session_tree.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/2_4_session_tree.png" format="PNG" scale="&imgscale;"/></imageobject> |
196 |
<imageobject><imagedata fileref="./images/2_4_session_tree.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/2_4_session_tree.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Session Info Tree</phrase></textobject> |
|
|
<caption><para>Session Info Tree</para></caption> |
|
197 |
</mediaobject> |
</mediaobject> |
198 |
</screenshot> |
</figure> |
199 |
</para> |
</para> |
200 |
<para> |
<para> |
201 |
The session info-tree is primarily intended for developers working |
The session info-tree is primarily intended for developers working |
237 |
|
|
238 |
<section><title>Adding and Removing Layers</title> |
<section><title>Adding and Removing Layers</title> |
239 |
<para> |
<para> |
240 |
There are two types of layers that can use added to a map: shape layers |
There are two types of layers that can be added to a map: Shape layers |
241 |
and image layers. Shape layers are stored in Shapefile format, a |
and image layers. Shape layers are stored in Shapefile format, a |
242 |
standard file format for storing geographic objects. These |
widely used file format for storing geographic objects. These |
243 |
files have the extension ``.shp''. Associated with |
files have the extension ``.shp''. Associated with |
244 |
the shape file is a database file which stores attributes for |
the shape file is a database file which stores attributes for |
245 |
each shape in the shape file. This file, in dBASE format, |
each shape in the Shape file. This file, in dBase format, |
246 |
has the extension ``.dbf''. Both files must have the same base name. |
has the extension ``.dbf''. Both files must have the same base name. |
247 |
For example, if there is a shape file named roads.shp there must |
For example, if there is a shape file named roads.shp there must |
248 |
also be a file roads.dbf. |
also be a file roads.dbf. |
253 |
<guimenu>Map</guimenu> |
<guimenu>Map</guimenu> |
254 |
<guimenuitem>Add Layer</guimenuitem> |
<guimenuitem>Add Layer</guimenuitem> |
255 |
</menuchoice>. |
</menuchoice>. |
256 |
Thuban will load all files with the same base name, so it doesn't |
Initially, only the ``.shp'' files are shown which is enough for the |
257 |
matter if the shape file or database file is selected. |
selection. However, if you switch to display all files and select one |
258 |
|
of the associated files (e.g. ``.dbf''), Thuban will recognize the base |
259 |
|
name and load the corresponding Shape file. |
260 |
|
</para> |
261 |
|
<para> |
262 |
|
The file dialog for Shape files allows to select multiple files. |
263 |
|
Use the shift-button together with the left mouse button to extend |
264 |
|
the selection. |
265 |
</para> |
</para> |
266 |
|
|
267 |
<para> |
<para> |
283 |
the tool bar or from the |
the tool bar or from the |
284 |
<menuchoice><guimenu>Map</guimenu></menuchoice> menu. |
<menuchoice><guimenu>Map</guimenu></menuchoice> menu. |
285 |
</para> |
</para> |
286 |
|
<itemizedlist> |
287 |
|
<listitem> |
288 |
<para> |
<para> |
289 |
The ZoomIn tool |
The ZoomIn tool |
290 |
<inlinemediaobject> |
<inlinemediaobject> |
298 |
</inlinemediaobject> |
</inlinemediaobject> |
299 |
enlarges a region of the map. Clicking once on the map |
enlarges a region of the map. Clicking once on the map |
300 |
will double the magnification and center the map on the point that |
will double the magnification and center the map on the point that |
301 |
was clicked. Clicking and dragging selects a region that will |
was clicked. Clicking and dragging selects a region that will be |
302 |
enlarged to fit the window. |
enlarged to fit the window. |
303 |
</para> |
</para> |
304 |
|
</listitem> |
305 |
|
<listitem> |
306 |
<para> |
<para> |
307 |
The ZoomOut tool |
The ZoomOut tool |
308 |
<inlinemediaobject> |
<inlinemediaobject> |
319 |
selects a box such that the current contents of the window will be |
selects a box such that the current contents of the window will be |
320 |
scaled to fit into that box. |
scaled to fit into that box. |
321 |
</para> |
</para> |
322 |
|
</listitem> |
323 |
|
<listitem> |
324 |
<para> |
<para> |
325 |
The Pan tool |
The Pan tool |
326 |
<inlinemediaobject> |
<inlinemediaobject> |
334 |
</inlinemediaobject> |
</inlinemediaobject> |
335 |
allows the user to move the map around by clicking and dragging. |
allows the user to move the map around by clicking and dragging. |
336 |
</para> |
</para> |
337 |
|
</listitem> |
338 |
|
<listitem> |
339 |
<para> |
<para> |
340 |
The Full Extent tool |
The Full Extent tool |
341 |
<inlinemediaobject> |
<inlinemediaobject> |
349 |
</inlinemediaobject> |
</inlinemediaobject> |
350 |
rescales the viewable region so that the entire map is visible. |
rescales the viewable region so that the entire map is visible. |
351 |
</para> |
</para> |
352 |
|
</listitem> |
353 |
|
<listitem> |
354 |
<para> |
<para> |
355 |
The Full Layer Extent tool |
The Full Layer Extent tool |
356 |
<inlinemediaobject> |
<inlinemediaobject> |
366 |
layer fits within the window. If no layer is selected this button |
layer fits within the window. If no layer is selected this button |
367 |
will be disabled. |
will be disabled. |
368 |
</para> |
</para> |
369 |
|
</listitem> |
370 |
|
<listitem> |
371 |
<para> |
<para> |
372 |
The Full Shape Extent tool |
The Full Shape Extent tool |
373 |
<inlinemediaobject> |
<inlinemediaobject> |
382 |
rescales the viewable region so that the currently selected |
rescales the viewable region so that the currently selected |
383 |
shape fits within the window. If the shape is a point, it is |
shape fits within the window. If the shape is a point, it is |
384 |
centered and the map is zoomed all the way in. If no shape is |
centered and the map is zoomed all the way in. If no shape is |
385 |
selected this button will be disabled. |
selected this button will be disabled. This feature is especially |
386 |
|
helpful when identifying an object related to a selected record |
387 |
|
in a tableview (see below). |
388 |
|
|
389 |
</para> |
</para> |
390 |
|
</listitem> |
391 |
|
</itemizedlist> |
392 |
</section> |
</section> |
393 |
|
|
394 |
<section><title>Object Identification</title> |
<section><title>Object Identification</title> |
405 |
</inlinemediaobject>. |
</inlinemediaobject>. |
406 |
Clicking on an object selects that object and opens a dialog which |
Clicking on an object selects that object and opens a dialog which |
407 |
shows all the table attributes for that object. Any current selection |
shows all the table attributes for that object. Any current selection |
408 |
is lost. |
is lost. Objects on the map are typically shapes and this document |
409 |
|
will often refer to objects as shapes. |
410 |
</para> |
</para> |
411 |
</section> |
</section> |
412 |
|
|
413 |
<section><title>Object Labelling</title> |
<section><title>Object Labeling</title> |
414 |
<para> |
<para> |
415 |
Objects can be labelled using the Label tool |
Objects can be labeled using the Label tool |
416 |
<inlinemediaobject> |
<inlinemediaobject> |
417 |
<imageobject> |
<imageobject> |
418 |
<imagedata fileref="../images/3_3_label.png" format="PNG" scale="&imgscale;"/> |
<imagedata fileref="../images/3_3_label.png" format="PNG" scale="&imgscale;"/> |
457 |
<menuchoice><guimenu>Map</guimenu></menuchoice>. |
<menuchoice><guimenu>Map</guimenu></menuchoice>. |
458 |
</para> |
</para> |
459 |
|
|
460 |
|
<itemizedlist> |
461 |
|
<listitem> |
462 |
<para> |
<para> |
463 |
The Move Layer to Top tool |
The Move Layer to Top tool |
464 |
<inlinemediaobject> |
<inlinemediaobject> |
471 |
<textobject> <phrase>Move Layer to Top</phrase> </textobject> |
<textobject> <phrase>Move Layer to Top</phrase> </textobject> |
472 |
</inlinemediaobject> raises the selected layer to the top of the map. |
</inlinemediaobject> raises the selected layer to the top of the map. |
473 |
</para> |
</para> |
474 |
|
</listitem> |
475 |
|
<listitem> |
476 |
|
|
477 |
<para> |
<para> |
478 |
The Move Layer Up tool |
The Move Layer Up tool |
486 |
<textobject> <phrase>Move Layer Up</phrase> </textobject> |
<textobject> <phrase>Move Layer Up</phrase> </textobject> |
487 |
</inlinemediaobject> raises the selected layer one level. |
</inlinemediaobject> raises the selected layer one level. |
488 |
</para> |
</para> |
489 |
|
</listitem> |
490 |
|
<listitem> |
491 |
|
|
492 |
<para> |
<para> |
493 |
The Move Layer Down tool |
The Move Layer Down tool |
502 |
</inlinemediaobject> lowers the selected layer one level. |
</inlinemediaobject> lowers the selected layer one level. |
503 |
</para> |
</para> |
504 |
|
|
505 |
|
</listitem> |
506 |
|
<listitem> |
507 |
<para> |
<para> |
508 |
The Move Layer to Bottom tool |
The Move Layer to Bottom tool |
509 |
<inlinemediaobject> |
<inlinemediaobject> |
517 |
</inlinemediaobject> lowers the selected layer to the bottom of the map. |
</inlinemediaobject> lowers the selected layer to the bottom of the map. |
518 |
</para> |
</para> |
519 |
|
|
520 |
|
</listitem> |
521 |
|
<listitem> |
522 |
<para> |
<para> |
523 |
The Visible tool |
The Visible tool |
524 |
<inlinemediaobject> |
<inlinemediaobject> |
533 |
hidden. |
hidden. |
534 |
</para> |
</para> |
535 |
|
|
536 |
|
</listitem> |
537 |
|
<listitem> |
538 |
<para> |
<para> |
539 |
The Invisible tool |
The Invisible tool |
540 |
<inlinemediaobject> |
<inlinemediaobject> |
548 |
</inlinemediaobject> hides the selected layer in the map. |
</inlinemediaobject> hides the selected layer in the map. |
549 |
</para> |
</para> |
550 |
|
|
551 |
|
</listitem> |
552 |
|
<listitem> |
553 |
<para> |
<para> |
554 |
The Properties tool |
The Properties tool |
555 |
<inlinemediaobject> |
<inlinemediaobject> |
564 |
Double-clicking on a layer or a group of a layer will open the |
Double-clicking on a layer or a group of a layer will open the |
565 |
properties dialog for that layer. |
properties dialog for that layer. |
566 |
</para> |
</para> |
567 |
|
</listitem> |
568 |
|
</itemizedlist> |
569 |
|
<para> |
570 |
|
Along the bottom of the legend is the scalebar. The scalebar |
571 |
|
will be available if there are any layers and the map has a |
572 |
|
projection set. |
573 |
|
</para> |
574 |
</section> |
</section> |
575 |
|
|
576 |
<section><title>Exporting</title> |
<section><title>Exporting</title> |
581 |
<menuchoice> |
<menuchoice> |
582 |
<guimenu>Map</guimenu> |
<guimenu>Map</guimenu> |
583 |
<guimenuitem>Export</guimenuitem> |
<guimenuitem>Export</guimenuitem> |
584 |
</menuchoice>. Under other platforms this option is not available. |
</menuchoice> for use in reports, presentations, or further |
585 |
Clicking this menu item open a file selection dialog that lets the |
modification. The current map view, legend, and, if available, |
586 |
user select a location to export the map. |
scalebar are exported. Under other platforms this option is not |
587 |
|
available. Clicking this menu item open a file selection dialog |
588 |
|
that lets the user select a location to export the map. |
589 |
</para> |
</para> |
590 |
</section> |
</section> |
591 |
|
|
595 |
<menuchoice> |
<menuchoice> |
596 |
<guimenu>Map</guimenu> |
<guimenu>Map</guimenu> |
597 |
<guimenuitem>Print</guimenuitem> |
<guimenuitem>Print</guimenuitem> |
598 |
</menuchoice>. A standard printing dialog will open allowing the |
</menuchoice>. The current map view, legend, and, if available, |
599 |
user to configure the printer. This dialog will differ depending |
scalebar are printed. A standard printing dialog will open allowing |
600 |
|
the user to configure the printer. This dialog will differ depending |
601 |
on which platform Thuban is running. |
on which platform Thuban is running. |
602 |
</para> |
</para> |
603 |
</section> |
</section> |
613 |
There are two types of layers supported by Thuban: shape layers and |
There are two types of layers supported by Thuban: shape layers and |
614 |
image layers. Shape layers consist of vector based shapes with |
image layers. Shape layers consist of vector based shapes with |
615 |
geo-referenced coordinates. There are three types of supported |
geo-referenced coordinates. There are three types of supported |
616 |
shapes: polygons, lines, and points. Image layers can be any image |
shapes: polygons, lines (arc), and points. Image layers can be any image |
617 |
file format supported by the Geospatial Data Abstraction Library |
file format supported by the Geo-spatial Data Abstraction Library |
618 |
(GDAL). The images must have geographic |
(GDAL). The images must have geographic |
619 |
coordinate data either embedded within the file or in a seperate |
coordinate data either embedded within the file or in a separate |
620 |
file that is in the same directory as the image file. GeoTIFF files |
file that is in the same directory as the image file. GeoTIFF files |
621 |
work very well with Thuban and were designed specifically to be image |
work very well with Thuban and were designed specifically to be image |
622 |
layers in GIS programs. |
layers in GIS programs. |
623 |
</para> |
</para> |
624 |
|
<para> |
625 |
|
All actions in the |
626 |
|
<menuchoice> |
627 |
|
<guimenu>Layer</guimenu> |
628 |
|
</menuchoice> menu act on the currently selected layer in the legend. |
629 |
|
</para> |
630 |
</section> |
</section> |
631 |
|
|
632 |
<section><title>Properties</title> |
<section><title>Properties</title> |
637 |
<guimenu>Layer</guimenu> |
<guimenu>Layer</guimenu> |
638 |
<guimenuitem>Properties</guimenuitem> |
<guimenuitem>Properties</guimenuitem> |
639 |
</menuchoice> opens a dialog that displays a layer's properties. |
</menuchoice> opens a dialog that displays a layer's properties. |
640 |
All layers have a title and it can be modified in the text field |
All layers have a title which can be modified in the text field |
641 |
provided. The type of layer is also shows. If the type is a type |
provided. The type of layer is also shows. If the type is a type |
642 |
of shape (polygon, arc, point) the classification table will be |
of shape (polygon, arc, point) the classification table will be |
643 |
shown. Image layers have no other properties other than title |
shown. Image layers have no other properties other than title |
644 |
and type. |
and type. |
645 |
</para> |
</para> |
646 |
<para> |
<para> |
647 |
<screenshot> |
<figure> |
648 |
<screeninfo>Properties Window</screeninfo> |
<title>Properties Window</title> |
649 |
<mediaobject> |
<mediaobject> |
650 |
<imageobject><imagedata fileref="../images/4_2_layer_properties.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/4_2_layer_properties.png" format="PNG" scale="&imgscale;"/></imageobject> |
651 |
<imageobject><imagedata fileref="./images/4_2_layer_properties.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/4_2_layer_properties.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Properties Window</phrase></textobject> |
|
|
<caption><para>The Properties Window for a Shape Layer</para></caption> |
|
652 |
</mediaobject> |
</mediaobject> |
653 |
</screenshot> |
</figure> |
654 |
</para> |
</para> |
655 |
<para> |
<para> |
656 |
<screenshot> |
<figure> |
657 |
<screeninfo>Properties Window</screeninfo> |
<title>Properties Window</title> |
658 |
<mediaobject> |
<mediaobject> |
659 |
<imageobject><imagedata fileref="../images/4_2_raster_layer_properties.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/4_2_raster_layer_properties.png" format="PNG" scale="&imgscale;"/></imageobject> |
660 |
<imageobject><imagedata fileref="./images/4_2_raster_layer_properties.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/4_2_raster_layer_properties.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Properties Window</phrase></textobject> |
|
|
<caption><para>The Properties Window for an Image Layer</para></caption> |
|
661 |
</mediaobject> |
</mediaobject> |
662 |
</screenshot> |
</figure> |
663 |
</para> |
</para> |
664 |
</section> |
</section> |
665 |
|
|
725 |
<para> |
<para> |
726 |
A layer always has a classification. When a new layer is added to the |
A layer always has a classification. When a new layer is added to the |
727 |
map, a default classification is created with the DEFAULT group. This |
map, a default classification is created with the DEFAULT group. This |
728 |
group cannot be removed. Every shape in the layer, regardless of its |
group cannot be removed but can be hidden (see below). Every shape in the |
729 |
attributes, will match this group if no other group matches. |
layer, regardless of its attributes, will match this group if no other |
730 |
|
group matches. |
731 |
</para> |
</para> |
732 |
|
|
733 |
<section><title>Editing Classifications</title> |
<section><title>Editing Classifications</title> |
744 |
button. |
button. |
745 |
</para> |
</para> |
746 |
<para> |
<para> |
747 |
<screenshot> |
To apply the changes to the map the user can click |
748 |
<screeninfo>Properties Window</screeninfo> |
either <guibutton>Try</guibutton> or <guibutton>OK</guibutton>. |
749 |
|
<guibutton>Try</guibutton> will not close the dialog box, allowing |
750 |
|
the user to see how the classification changes the map. |
751 |
|
<guibutton>Revert</guibutton> will undo the last classification applied |
752 |
|
to the map. <guibutton>OK</guibutton> will commit the changes and |
753 |
|
close the dialog. The user will be unable to undo the changes. |
754 |
|
<guibutton>Close</guibutton> simply closes the dialog box. If any |
755 |
|
changes have not been applied with <guibutton>Try</guibutton> the |
756 |
|
changes will not be applied to the map. |
757 |
|
</para> |
758 |
|
<para> |
759 |
|
<figure> |
760 |
|
<title>Properties Window</title> |
761 |
<mediaobject> |
<mediaobject> |
762 |
<imageobject><imagedata fileref="../images/5_classification.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/5_classification.png" format="PNG" scale="&imgscale;"/></imageobject> |
763 |
<imageobject><imagedata fileref="./images/5_classification.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/5_classification.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Properties Window</phrase></textobject> |
|
|
<caption><para>The Properties Window with Classifications</para></caption> |
|
764 |
</mediaobject> |
</mediaobject> |
765 |
</screenshot> |
</figure> |
766 |
</para> |
</para> |
767 |
<para> |
<para> |
768 |
The order of the groups in the classification is significant |
The order of the groups in the classification is significant |
777 |
</para> |
</para> |
778 |
<section><title>Visible</title> |
<section><title>Visible</title> |
779 |
<para> |
<para> |
780 |
The Visible column has checkboxes that determine whether a |
The Visible column has check-boxes that determine whether a |
781 |
classification group will be displayed in the legend. This is |
classification group will be displayed in the legend. This is |
782 |
useful if the user knows that the groups completely cover |
useful if the user knows that the groups completely cover |
783 |
the data set and don't want the DEFAULT group to be displayed |
the data set and don't want the DEFAULT group to be displayed |
809 |
If the type is Integer, then any valid integer may be entered. In |
If the type is Integer, then any valid integer may be entered. In |
810 |
addition, with special syntax, a range of values can be entered. |
addition, with special syntax, a range of values can be entered. |
811 |
A range from <varname>start</varname> to <varname>end</varname> |
A range from <varname>start</varname> to <varname>end</varname> |
812 |
inclusive is specifed like this: <literal>[start;end]</literal>. |
inclusive is specified like this: <literal>[start;end]</literal>. |
813 |
The exclusive range is specified like this: |
The exclusive range is specified like this: |
814 |
<literal>]start;end[</literal>. Ranges can include infinity like |
<literal>]start;end[</literal>. Ranges can include infinity like |
815 |
this: <literal>[-oo;oo]</literal>. Field types can also be of type |
this: <literal>[-oo;oo]</literal>. Field types can also be of type |
828 |
|
|
829 |
<section><title>Generating Classes</title> |
<section><title>Generating Classes</title> |
830 |
<para> |
<para> |
831 |
<screenshot> |
<figure> |
832 |
<screeninfo>Generate Class</screeninfo> |
<title>Generate Class</title> |
833 |
<mediaobject> |
<mediaobject> |
834 |
<imageobject><imagedata fileref="../images/5_3_genclass.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/5_3_genclass.png" format="PNG" scale="&imgscale;"/></imageobject> |
835 |
<imageobject><imagedata fileref="./images/5_3_genclass.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/5_3_genclass.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Generate Class</phrase></textobject> |
|
|
<caption><para>The Generate Classifications Dialog</para></caption> |
|
836 |
</mediaobject> |
</mediaobject> |
837 |
</screenshot> |
</figure> |
838 |
</para> |
</para> |
839 |
<para> |
<para> |
840 |
Creating a classification by hand can be tedious. |
Creating a classification by hand can be tedious. |
842 |
classification at once while still giving the user control over |
classification at once while still giving the user control over |
843 |
how it appears. Clicking <guibutton>Generate Class</guibutton> |
how it appears. Clicking <guibutton>Generate Class</guibutton> |
844 |
opens the <varname>Generate Classification</varname> dialog. |
opens the <varname>Generate Classification</varname> dialog. |
845 |
Under the <varname>Generate</varname> pulldown there are at most |
Under the <varname>Generate</varname> pull down there are at most |
846 |
three different ways to generate classifications: |
three different ways to generate classifications: |
847 |
Unique Values, Unique Distribution, and Quantiles. Some options |
Unique Values, Uniform Distribution, and Quantiles. Some options |
848 |
may not be available if the data type for the field does not |
may not be available if the data type for the field does not |
849 |
support them. For instance, <varname>Unique Distribution</varname> |
support them. For instance, <varname>Uniform Distribution</varname> |
850 |
doesn't make sense for a Text field. |
doesn't make sense for a Text field. |
851 |
</para> |
</para> |
852 |
<para> |
<para> |
853 |
For every way of generating a classification, a color scheme must |
For every way of generating a classification, a color scheme must |
854 |
be selected. Thuban provides several different color schemes that |
be selected. Thuban provides several different color schemes that |
855 |
affect how the group properties change over the classification. |
affect how the group properties change over the classification. |
856 |
|
It may be desirable that only certain properties change over the |
857 |
|
classification. If the shape type is a polygon or a point then |
858 |
|
the <guibutton>Fix Border Color</guibutton> option will be available. |
859 |
|
This allows the user to select a border color for all classification |
860 |
|
groups. |
861 |
It is also possible to create a custom color scheme. Selecting |
It is also possible to create a custom color scheme. Selecting |
862 |
this option will display two symbols: the one of the left has the |
this option will display two symbols: the one of the left has the |
863 |
properties of the first group and the one on the right has the |
properties of the first group and the one on the right has the |
864 |
properties of the last group. Thuban will interpolate between these |
properties of the last group. Thuban will interpolate between these |
865 |
two properties to generate the other groups. |
two properties to generate the other groups. |
866 |
|
<figure> |
867 |
|
<title>Custom Color Scheme</title> |
868 |
|
<mediaobject> |
869 |
|
<imageobject><imagedata fileref="../images/5_2_custom_ramp.png" format="PNG" scale="&imgscale;"/></imageobject> |
870 |
|
<imageobject><imagedata fileref="./images/5_2_custom_ramp.eps" format="EPS" scale="&imgscale;"/></imageobject> |
871 |
|
</mediaobject> |
872 |
|
</figure> |
873 |
</para> |
</para> |
874 |
<para> |
<para> |
875 |
The Unique Values option lets the user select specific values that |
The Unique Values option lets the user select specific values that |
879 |
right. Each list can be sorted or reversed for easier searching. |
right. Each list can be sorted or reversed for easier searching. |
880 |
The classification that is generated will be in the same order as |
The classification that is generated will be in the same order as |
881 |
the list on the right. |
the list on the right. |
882 |
|
<figure> |
883 |
|
<title>Unique Values</title> |
884 |
|
<mediaobject> |
885 |
|
<imageobject><imagedata fileref="../images/5_2_unique_values.png" format="PNG" scale="&imgscale;"/></imageobject> |
886 |
|
<imageobject><imagedata fileref="./images/5_2_unique_values.eps" format="EPS" scale="&imgscale;"/></imageobject> |
887 |
|
</mediaobject> |
888 |
|
</figure> |
889 |
</para> |
</para> |
890 |
<para> |
<para> |
891 |
The Unique Distribution option creates a user specified number of |
The Uniform Distribution option creates a user specified number of |
892 |
groups of ranges such that each range covers equal intervals. The |
groups of ranges such that each range covers equal intervals. The |
893 |
minimum and maximum values can automatically be retrieved from the |
minimum and maximum values can automatically be retrieved from the |
894 |
table by clicking <guibutton>Retrieve From Table</guibutton>. The |
table by clicking <guibutton>Retrieve From Table</guibutton>. The |
895 |
stepping is how large each interval is. Adjusting this value will |
stepping is how large each interval is. Adjusting this value will |
896 |
automatically recalculate how many groups is appropriate. |
automatically recalculate how many groups is appropriate. |
897 |
|
<figure> |
898 |
|
<title>Uniform Distribution</title> |
899 |
|
<mediaobject> |
900 |
|
<imageobject><imagedata fileref="../images/5_2_uniform_dist.png" format="PNG" scale="&imgscale;"/></imageobject> |
901 |
|
<imageobject><imagedata fileref="./images/5_2_uniform_dist.eps" format="EPS" scale="&imgscale;"/></imageobject> |
902 |
|
</mediaobject> |
903 |
|
</figure> |
904 |
</para> |
</para> |
905 |
<para> |
<para> |
906 |
The Quantiles option generates ranges based on the number of items |
The Quantiles option generates ranges based on the number of items |
907 |
in the input set. For example, by specifying five groups Thuban will |
in the table. For example, by specifying five groups Thuban will |
908 |
generate five groups with appropriate ranges such that 20% of the table |
generate five groups with appropriate ranges such that 20% of the table |
909 |
data is in each group. If it is impossible to generate exact |
data is in each group. If it is impossible to generate exact |
910 |
groupings, Thuban will issue a warning but allow the user to continue. |
groupings, Thuban will issue a warning but allow the user to continue. |
911 |
|
<figure> |
912 |
|
<title>Quantiles</title> |
913 |
|
<mediaobject> |
914 |
|
<imageobject><imagedata fileref="../images/5_2_quantiles.png" format="PNG" scale="&imgscale;"/></imageobject> |
915 |
|
<imageobject><imagedata fileref="./images/5_2_quantiles.eps" format="EPS" scale="&imgscale;"/></imageobject> |
916 |
|
</mediaobject> |
917 |
|
</figure> |
918 |
</para> |
</para> |
919 |
</section> |
</section> |
920 |
</chapter> |
</chapter> |
936 |
<guimenu>Layer</guimenu> |
<guimenu>Layer</guimenu> |
937 |
<guimenuitem>Projection</guimenuitem> |
<guimenuitem>Projection</guimenuitem> |
938 |
</menuchoice>. |
</menuchoice>. |
939 |
<screenshot> |
<figure> |
940 |
<screeninfo>Projection Window</screeninfo> |
<title>Projection Window</title> |
941 |
<mediaobject> |
<mediaobject> |
942 |
<imageobject><imagedata fileref="../images/6_projection.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/6_projection.png" format="PNG" scale="&imgscale;"/></imageobject> |
943 |
<imageobject><imagedata fileref="./images/6_projection.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/6_projection.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Projection Window</phrase></textobject> |
|
|
<caption><para>The Projection Window</para></caption> |
|
944 |
</mediaobject> |
</mediaobject> |
945 |
</screenshot> |
</figure> |
946 |
</para> |
</para> |
947 |
<para> |
<para> |
948 |
Thuban is distributed with a sample collection of projections. The |
Thuban is distributed with a sample collection of projections. The |
971 |
list of available projections as a new entry, and thus makes it |
list of available projections as a new entry, and thus makes it |
972 |
available to future Thuban sessions. Clicking <guibutton>New</guibutton> |
available to future Thuban sessions. Clicking <guibutton>New</guibutton> |
973 |
will create an entirely new, empty projection. The |
will create an entirely new, empty projection. The |
974 |
<guibutton>Remove</guibutton> button will permanantly remove a |
<guibutton>Remove</guibutton> button will permanently remove a |
975 |
projection from the list of available projections. |
projection from the list of available projections. |
976 |
</para> |
</para> |
977 |
|
<para> |
978 |
|
To apply the selected projection to the map the user can click |
979 |
|
either <guibutton>Try</guibutton> or <guibutton>OK</guibutton>. |
980 |
|
<guibutton>Try</guibutton> will not close the dialog box, allowing |
981 |
|
the user to see how the projeciton changes the map. |
982 |
|
<guibutton>Revert</guibutton> will undo the last projection applied |
983 |
|
to the map. <guibutton>OK</guibutton> will commit the changes and |
984 |
|
close the dialog. The user will be unable to undo the changes. |
985 |
|
<guibutton>Close</guibutton> simply closes the dialog box. If no |
986 |
|
selection has been applied with <guibutton>Try</guibutton> the |
987 |
|
selection will not be applied to the map. |
988 |
|
</para> |
989 |
</section> |
</section> |
990 |
<section><title>Importing/Exporting Projections</title> |
<section><title>Importing/Exporting Projections</title> |
991 |
<para> |
<para> |
1012 |
|
|
1013 |
<section><title>Table View</title> |
<section><title>Table View</title> |
1014 |
<para> |
<para> |
1015 |
<screenshot> |
<figure> |
1016 |
<screeninfo>Table View</screeninfo> |
<title>Table View</title> |
1017 |
<mediaobject> |
<mediaobject> |
1018 |
<imageobject><imagedata fileref="../images/7_1_table_view.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/7_1_table_view.png" format="PNG" scale="&imgscale;"/></imageobject> |
1019 |
<imageobject><imagedata fileref="./images/7_1_table_view.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/7_1_table_view.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Table View</phrase></textobject> |
|
|
<caption><para>The Table View</para></caption> |
|
1020 |
</mediaobject> |
</mediaobject> |
1021 |
</screenshot> |
</figure> |
1022 |
</para> |
</para> |
1023 |
<para> |
<para> |
1024 |
Thuban provides a standard dialog to display table contents, the |
Thuban provides a standard dialog to display table contents, the |
1025 |
Table View. The view falls has five sections: The title, selections, |
Table View. The view has five sections: The title, selections, |
1026 |
the table grid, export functions, and the status bar. |
the table grid, export functions, and the status bar. |
1027 |
</para> |
</para> |
1028 |
<para> |
<para> |
1035 |
third choice can be either a specific value (interpreted as numerical |
third choice can be either a specific value (interpreted as numerical |
1036 |
or string depending on the type of the first field) or a second field |
or string depending on the type of the first field) or a second field |
1037 |
identifier. Thus you can perform analysis like selecting all |
identifier. Thus you can perform analysis like selecting all |
1038 |
records where "population > 10000" or |
records where <literal>population > 10000</literal> or |
1039 |
"cars_per_inhabitant < bikes_per_inhabitant" (note that the field names |
<literal>cars_per_inhabitant < bikes_per_inhabitant</literal> |
1040 |
are only explanatory, the dBASE files allow only |
(note that the field names are only explanatory, the dBase files |
1041 |
11 character field names). |
allow only 11 character field names). |
1042 |
|
|
1043 |
Selections can be combined either by applying a selection only on |
Selections can be combined either by applying a selection only on |
1044 |
a previously selected set of records or by adding the results of a |
a previously selected set of records or by adding the results of a |
1046 |
earlier results. |
earlier results. |
1047 |
</para> |
</para> |
1048 |
<para> |
<para> |
1049 |
The table grid shows the contents of the table (a record per column), |
The table grid shows the contents of the table (one record per row), |
1050 |
with highlighted selection results. Columns and rows can be resized. |
with highlighted selection results. Columns and rows can be resized. |
1051 |
</para> |
</para> |
1052 |
<para> |
<para> |
1053 |
The contents of a table can be exported into a file, either dBASE |
The contents of a table can be exported into a file, either dBase |
1054 |
format (DBF) or comma seperated values (CSV). The |
format (DBF) or comma separated values (CSV). The |
1055 |
<guibutton>Export</guibutton> button |
<guibutton>Export</guibutton> button |
1056 |
raises a file dialog to specify a path and file name, the export type |
raises a file dialog to specify a path and file name, the export type |
1057 |
is determined by the file extension (either .dbf or .csv). |
is determined by the file extension (either .dbf or .csv). |
1086 |
<guimenuitem>Open</guimenuitem> |
<guimenuitem>Open</guimenuitem> |
1087 |
</menuchoice> |
</menuchoice> |
1088 |
item raises a file dialog to let you select a |
item raises a file dialog to let you select a |
1089 |
dBASE file from the file system to be loaded into Thuban read-only. |
dBase file from the file system to be loaded into Thuban read-only. |
1090 |
On <guibutton>OK</guibutton> the selected file is loaded and a |
On <guibutton>OK</guibutton> the selected file is loaded and a |
1091 |
table view is opened. |
table view is opened. |
1092 |
</para> |
</para> |
1139 |
|
|
1140 |
<section><title>Join</title> |
<section><title>Join</title> |
1141 |
<para> |
<para> |
1142 |
<screenshot> |
<figure> |
1143 |
<screeninfo>Join Tables</screeninfo> |
<title>Join Tables</title> |
1144 |
<mediaobject> |
<mediaobject> |
1145 |
<imageobject><imagedata fileref="../images/7_2_5_join.png" format="PNG" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="../images/7_2_5_join.png" format="PNG" scale="&imgscale;"/></imageobject> |
1146 |
<imageobject><imagedata fileref="./images/7_2_5_join.eps" format="EPS" scale="&imgscale;"/></imageobject> |
<imageobject><imagedata fileref="./images/7_2_5_join.eps" format="EPS" scale="&imgscale;"/></imageobject> |
|
<textobject><phrase>Join Tables</phrase></textobject> |
|
|
<caption><para>The Join Tables Dialog</para></caption> |
|
1147 |
</mediaobject> |
</mediaobject> |
1148 |
</screenshot> |
</figure> |
1149 |
</para> |
</para> |
1150 |
<para> |
<para> |
1151 |
The |
The |
1171 |
</section> |
</section> |
1172 |
<section><title>Attribute Tables</title> |
<section><title>Attribute Tables</title> |
1173 |
<para> |
<para> |
1174 |
To clearly separate between both types, Thuban provides |
To clearly separate between both types of tables (data and |
1175 |
functionality regarding the attribute tables under the Layer menu. |
attribute), Thuban provides functionality regarding the attribute |
1176 |
|
tables under the <menuchoice><guimenu>Layer</guimenu></menuchoice> menu. |
1177 |
</para> |
</para> |
1178 |
|
|
1179 |
<section><title>Show Table</title> |
<section><title>Show Table</title> |
1212 |
normal tables can be simply closed (and thereby dereferencing |
normal tables can be simply closed (and thereby dereferencing |
1213 |
the source tables), this is not possible for attribute tables. |
the source tables), this is not possible for attribute tables. |
1214 |
|
|
1215 |
Hence joins on attribute tables must be solved explicitely. This is |
Hence joins on attribute tables must be solved explicitly. This is |
1216 |
what the |
what the |
1217 |
<menuchoice> |
<menuchoice> |
1218 |
<guimenu>Layer</guimenu> |
<guimenu>Layer</guimenu> |
1225 |
</section> |
</section> |
1226 |
</chapter> |
</chapter> |
1227 |
|
|
1228 |
|
<chapter><title>Extensions</title> |
1229 |
|
<para> |
1230 |
|
Thuban is designed to be extensible. The term Extension is used as a |
1231 |
|
general term for anything that extends Thuban. |
1232 |
|
This chapter introduces into some oppportunities how to add and |
1233 |
|
handle extra functionality developed by your own or third parties. |
1234 |
|
</para> |
1235 |
|
|
1236 |
|
<section><title>Add personal extensions via thubanstart.py</title> |
1237 |
|
<para> |
1238 |
|
After Thuban has been started for the first time, a directory |
1239 |
|
.thuban is created within your home directory. |
1240 |
|
There you can add a file thubanstart.py which will be imported |
1241 |
|
by Thuban at start-up. It is recommended to add only import-statements |
1242 |
|
to this file to keep the actual code of extensions separate. |
1243 |
|
</para> |
1244 |
|
<para> |
1245 |
|
The modules to import must either be found though the environment |
1246 |
|
variable PYTHONPATH or directly be placed into the .thuban-directory. |
1247 |
|
</para> |
1248 |
|
<para> |
1249 |
|
As an example, copy the file examples/simple_extensions/hello_world.py |
1250 |
|
of the Thuban source code into the .thuban-directory of your home |
1251 |
|
directory. Now add add the statement import hello_world to the |
1252 |
|
file thubanstart.py and run Thuban. You will notice an additional |
1253 |
|
menu <menuchoice><guimenu>Extensions</guimenu></menuchoice> where |
1254 |
|
the new item for the Hello-World extension is placed - select it |
1255 |
|
to see the Hello-World message. |
1256 |
|
</para> |
1257 |
|
</section> |
1258 |
|
|
1259 |
|
<section><title>Writing simple extensions</title> |
1260 |
|
<para> |
1261 |
|
Writing an extension for Thuban basically means to |
1262 |
|
implement the extra functionality in Python with all of the |
1263 |
|
Thuban classes, methods and variables available. |
1264 |
|
</para> |
1265 |
|
<para> |
1266 |
|
All classes and their methods are documented in the source code |
1267 |
|
(see their doc-strings). Here is an example from |
1268 |
|
Thuban/Model/layer.py that describes some of the methods |
1269 |
|
of a Layer object: |
1270 |
|
</para> |
1271 |
|
<programlisting> |
1272 |
|
<![CDATA[ |
1273 |
|
class BaseLayer(TitledObject, Modifiable): |
1274 |
|
|
1275 |
|
"""Base class for the layers.""" |
1276 |
|
|
1277 |
|
def __init__(self, title, visible = True, projection = None): |
1278 |
|
"""Initialize the layer. |
1279 |
|
|
1280 |
|
title -- the title |
1281 |
|
visible -- boolean. If true the layer is visible. |
1282 |
|
""" |
1283 |
|
TitledObject.__init__(self, title) |
1284 |
|
Modifiable.__init__(self) |
1285 |
|
self.visible = visible |
1286 |
|
self.projection = projection |
1287 |
|
|
1288 |
|
def Visible(self): |
1289 |
|
"""Return true if layer is visible""" |
1290 |
|
return self.visible |
1291 |
|
|
1292 |
|
def SetVisible(self, visible): |
1293 |
|
"""Set the layer's visibility.""" |
1294 |
|
self.visible = visible |
1295 |
|
self.issue(LAYER_VISIBILITY_CHANGED, self) |
1296 |
|
|
1297 |
|
def HasClassification(self): |
1298 |
|
"""Determine if this layer support classifications.""" |
1299 |
|
... |
1300 |
|
]]> |
1301 |
|
</programlisting> |
1302 |
|
<para> |
1303 |
|
This example intends to give you an impression of the |
1304 |
|
source-code-level documentation. |
1305 |
|
You have to make yourself familiar with |
1306 |
|
the Python programming language to understand some special |
1307 |
|
code elements. |
1308 |
|
</para> |
1309 |
|
<section><title>hello_world.py</title> |
1310 |
|
<para> |
1311 |
|
Traditionally, the first example should welcome the world. |
1312 |
|
Most of the code handles the frame for integrating a menu |
1313 |
|
item into Thuban while the actual raising of a message |
1314 |
|
is done in a single line. |
1315 |
|
</para> |
1316 |
|
<programlisting> |
1317 |
|
<![CDATA[ |
1318 |
|
# Copyright (C) 2003 by Intevation GmbH |
1319 |
|
# Authors: |
1320 |
|
# Jan-Oliver Wagner <[email protected]> |
1321 |
|
# |
1322 |
|
# This program is free software under the GPL (>=v2) |
1323 |
|
# Read the file COPYING coming with Thuban for details. |
1324 |
|
|
1325 |
|
""" |
1326 |
|
Extend Thuban with a sample Hello World to demonstrate simple |
1327 |
|
extensions. |
1328 |
|
""" |
1329 |
|
|
1330 |
|
__version__ = '$Revision$' |
1331 |
|
|
1332 |
|
# use _() already now for all strings that may later be translated |
1333 |
|
from Thuban import _ |
1334 |
|
|
1335 |
|
# Thuban has named commands which can be registered in the central |
1336 |
|
# instance registry. |
1337 |
|
from Thuban.UI.command import registry, Command |
1338 |
|
|
1339 |
|
# The instance of the main menu of the Thuban application |
1340 |
|
# See Thuban/UI/menu.py for the API of the Menu class |
1341 |
|
from Thuban.UI.mainwindow import main_menu |
1342 |
|
|
1343 |
|
def hello_world_dialog(context): |
1344 |
|
"""Just raise a simple dialog to greet the world. |
1345 |
|
|
1346 |
|
context -- The Thuban context. |
1347 |
|
""" |
1348 |
|
context.mainwindow.RunMessageBox(_('Hello World'), _('Hello World!')) |
1349 |
|
|
1350 |
|
|
1351 |
|
# create a new command and register it |
1352 |
|
registry.Add(Command('hello_world', _('Hello World'), hello_world_dialog, |
1353 |
|
helptext = _('Welcome everyone on this planet'))) |
1354 |
|
|
1355 |
|
# find the extensions menu (create it anew if not found) |
1356 |
|
extensions_menu = main_menu.find_menu('extensions') |
1357 |
|
if extensions_menu is None: |
1358 |
|
extensions_menu = main_menu.InsertMenu('extensions', _('E&xtensions')) |
1359 |
|
|
1360 |
|
# finally bind the new command with an entry in the extensions menu |
1361 |
|
extensions_menu.InsertItem('hello_world') |
1362 |
|
]]> |
1363 |
|
</programlisting> |
1364 |
|
</section> |
1365 |
|
<section><title>Registering a Command</title> |
1366 |
|
<para> |
1367 |
|
Mainly, our new function has to be registered to the Thuban |
1368 |
|
framework in order to connect it to the menu. A registered |
1369 |
|
command can also be connected to e.g. a toolbar button. |
1370 |
|
</para> |
1371 |
|
<para> |
1372 |
|
The instances and classes for this are imported at the beginning. |
1373 |
|
Any code not inside a method or class is directly executed when |
1374 |
|
the source-code module is imported. Therefore, the second |
1375 |
|
part of this example consist of the plain statements to create a new |
1376 |
|
Command and to add it to the menu. |
1377 |
|
</para> |
1378 |
|
<para> |
1379 |
|
By convention, it looks for a menu registered as ``extensions'' to |
1380 |
|
insert the new command. If it does not exist yet, it gets created. |
1381 |
|
It is advisable to copy this code for any of your extensions. |
1382 |
|
</para> |
1383 |
|
</section> |
1384 |
|
<section><title>The Thuban context</title> |
1385 |
|
<para> |
1386 |
|
A registered command that is called, always receives the |
1387 |
|
Thuban context. This instance provides our method with |
1388 |
|
hook references to all important components of the Thuban |
1389 |
|
application. |
1390 |
|
</para> |
1391 |
|
<para> |
1392 |
|
In the example hello_world.py, our function uses the |
1393 |
|
mainwindow component which offers a method to raise a |
1394 |
|
message dialog. In total there are three hooks: |
1395 |
|
<itemizedlist> |
1396 |
|
<listitem> |
1397 |
|
<para>application: |
1398 |
|
This object is the instance of the Thuban Application class. |
1399 |
|
Except maybe for loading or savinf sessions, you will not |
1400 |
|
need this object for a simple extension. |
1401 |
|
See Thuban/UI/application.py for the API. |
1402 |
|
</para> |
1403 |
|
</listitem> |
1404 |
|
<listitem> |
1405 |
|
<para>session: |
1406 |
|
The instance of the current session. It manages the sessions' |
1407 |
|
map and tables. You can set and remove the map or tables. |
1408 |
|
In may also get the map object. However, you should know that |
1409 |
|
internally it is already prepared to handle many maps. |
1410 |
|
Therfore, currently you would always receive a list with exactlty |
1411 |
|
one element. In the future, if there are more than one map, |
1412 |
|
you will not know which one is the currently display one and |
1413 |
|
therefore you should use the mainwindow as hook to find |
1414 |
|
the currently displayed map. |
1415 |
|
See Thuban/Model/session.py for the API. |
1416 |
|
</para> |
1417 |
|
</listitem> |
1418 |
|
<listitem> |
1419 |
|
<para> |
1420 |
|
mainwindow: The mainwindow object is central to manage various |
1421 |
|
GUI things such as the Legend sub-window. Most notably, |
1422 |
|
you get access to the canvas which is the window part where |
1423 |
|
the map is drawn. The canvas knows, which map it currently |
1424 |
|
draws and therefore you get the current map via |
1425 |
|
context.mainwindow.canvas.Map(). |
1426 |
|
See Thuban/UI/mainwindow.py for the API. |
1427 |
|
</para> |
1428 |
|
</listitem> |
1429 |
|
</itemizedlist> |
1430 |
|
</para> |
1431 |
|
</section> |
1432 |
|
</section> |
1433 |
|
</chapter> |
1434 |
|
|
1435 |
<chapter><title>Trouble Shooting</title> |
<chapter><title>Trouble Shooting</title> |
1436 |
<para> |
<para> |
1437 |
|
Here are a few problems that users have encountered when first using Thuban. |
1438 |
</para> |
</para> |
1439 |
<variablelist> |
<para> |
1440 |
|
|
1441 |
<varlistentry> |
<itemizedlist> |
|
<term>After adding two or more layers nothing is being drawn in the |
|
|
map window. |
|
|
</term> |
|
1442 |
<listitem> |
<listitem> |
1443 |
|
<para>After adding two or more layers nothing is drawn in the map window. |
1444 |
|
</para> |
1445 |
<para> |
<para> |
1446 |
This is probably because the layers have different projections. Projections |
This is probably because the layers have different projections. Projections |
1447 |
must be set on all layers and on the map itself if the layer's projections |
must be set on all layers and on the map itself if the layers' projections |
1448 |
are different. |
are different. |
1449 |
</para> |
</para> |
1450 |
</listitem> |
</listitem> |
|
</varlistentry> |
|
1451 |
|
|
|
<varlistentry> |
|
|
<term>Thuban crashes on startup with the error |
|
|
<literal>NameError: global name 'False' is not defined</literal>. |
|
|
</term> |
|
1452 |
<listitem> |
<listitem> |
1453 |
|
<para>Thuban crashes on startup with the error |
1454 |
|
<literal>NameError: global name 'False' is not defined</literal>. |
1455 |
|
</para> |
1456 |
<para> |
<para> |
1457 |
<varname>True</varname> and <varname>False</varname> were only introduced |
<varname>True</varname> and <varname>False</varname> were only introduced |
1458 |
in Python 2.2.1. Thuban depends on at least Python 2.2.1. |
in Python 2.2.1. Thuban depends on at least Python 2.2.1. |
1459 |
</para> |
</para> |
1460 |
</listitem> |
</listitem> |
|
</varlistentry> |
|
1461 |
|
|
1462 |
<varlistentry> |
<listitem> |
1463 |
<term>After compiling Thuban, Thuban crashes with an error similar to |
<para>After compiling Thuban, Thuban crashes with an error similar to |
1464 |
<literal> |
<literal> |
1465 |
ImportError: /usr/local//lib/thuban/Thuban/../Lib/wxproj.so: undefined symbol: __gxx_personality_v0 |
ImportError: /usr/local//lib/thuban/Thuban/../Lib/wxproj.so: undefined symbol: __gxx_personality_v0 |
1466 |
</literal> |
</literal> |
1467 |
</term> |
</para> |
|
<listitem> |
|
1468 |
<para> |
<para> |
1469 |
Thuban depends on the wxWindows library. If Thuban is compiled with an |
Thuban depends on the wxWindows library. If Thuban is compiled with an |
1470 |
incompatible version of the compiler than wxWindows was compiled with |
incompatible version of the compiler than wxWindows was compiled with |
1472 |
compiler. |
compiler. |
1473 |
</para> |
</para> |
1474 |
</listitem> |
</listitem> |
1475 |
</varlistentry> |
</itemizedlist> |
1476 |
</variablelist> |
</para> |
1477 |
|
<para> |
1478 |
|
If an error occurs Thuban will display a dialog indicating the error |
1479 |
|
before closing. The text should be copied and reported to the |
1480 |
|
<ulink url="http://thuban.intevation.org/bugtracker.html"> |
1481 |
|
Intevation bugtracker |
1482 |
|
</ulink>. |
1483 |
|
More information about the system is available from |
1484 |
|
<menuchoice><guimenu>Help</guimenu><guimenuitem>About</guimenuitem></menuchoice> box. |
1485 |
|
This should also be included in the bug report. |
1486 |
|
<figure> |
1487 |
|
<title>Error Dialog</title> |
1488 |
|
<mediaobject> |
1489 |
|
<imageobject><imagedata fileref="../images/8_int_error.png" format="PNG" scale="&imgscale;"/></imageobject> |
1490 |
|
<imageobject><imagedata fileref="./images/8_int_error.eps" format="EPS" scale="&imgscale;"/></imageobject> |
1491 |
|
</mediaobject> |
1492 |
|
</figure> |
1493 |
|
</para> |
1494 |
|
|
1495 |
</chapter> |
</chapter> |
1496 |
|
|
1514 |
</varlistentry> |
</varlistentry> |
1515 |
|
|
1516 |
<varlistentry> |
<varlistentry> |
1517 |
<term>dBASE file</term> |
<term>dBase file</term> |
1518 |
<listitem> |
<listitem> |
1519 |
<para> |
<para> |
1520 |
dBASE files are used to store the attributes for each layer. This |
dBase files are used to store the attributes for each layer. This |
1521 |
is closely associated with the Shapefile format. For detailed |
is closely associated with the Shapefile format. For detailed |
1522 |
specifications on the correct format of a dBASE file used with |
specifications on the correct format of a dBase file used with |
1523 |
Thuban please see the Technical Specification for the Shapefile |
Thuban please see the Technical Specification for the Shapefile |
1524 |
format above. |
format above. |
1525 |
</para> |
</para> |
1526 |
</listitem> |
</listitem> |
1527 |
</varlistentry> |
</varlistentry> |
1528 |
|
|
1529 |
|
<varlistentry> |
1530 |
|
<term>Raster files</term> |
1531 |
|
<listitem> |
1532 |
|
<para> |
1533 |
|
Binding the GDAL library Thuban supports numerous raster file formats, |
1534 |
|
see <ulink url="http://www.remotesensing.org/gdal/formats_list.html"> |
1535 |
|
GDAL format list</ulink> for details.</para> |
1536 |
|
|
1537 |
|
<para>Most commonly used is the <emphasis>TIFF/GeoTIFF</emphasis> |
1538 |
|
format: Raster maps are provided as TIFF images, with an additional |
1539 |
|
"world file" storing the geographic reference (usually with an |
1540 |
|
extension ".tfw"). |
1541 |
|
</para> |
1542 |
|
</listitem> |
1543 |
|
</varlistentry> |
1544 |
|
|
1545 |
</variablelist> |
</variablelist> |
1546 |
</appendix> |
</appendix> |
1547 |
|
|
1550 |
The following types of projections are directly support by |
The following types of projections are directly support by |
1551 |
Thuban. The specific values for each are provided by the user |
Thuban. The specific values for each are provided by the user |
1552 |
to create custom projections. Thuban comes with predefined |
to create custom projections. Thuban comes with predefined |
1553 |
projections and are available through the Projections dialog. |
projections which are available through the Projections dialog. |
1554 |
|
</para> |
1555 |
|
<itemizedlist> |
1556 |
|
<listitem> |
1557 |
|
<para>Geographic</para> |
1558 |
|
<itemizedlist> |
1559 |
|
<listitem><para><literal>Ellipsoid</literal></para></listitem> |
1560 |
|
<listitem><para> |
1561 |
|
<literal>Source Data</literal>: either Degrees or Radians |
1562 |
|
</para></listitem> |
1563 |
|
</itemizedlist> |
1564 |
|
</listitem> |
1565 |
|
<listitem> |
1566 |
|
<para>Lambert Conic Conformal</para> |
1567 |
|
<itemizedlist> |
1568 |
|
<listitem><para><literal>Ellipsoid</literal></para></listitem> |
1569 |
|
<listitem><para><literal>Latitude of 1st standard parallel</literal></para></listitem> |
1570 |
|
<listitem><para><literal>Latitude of 2nd standard parallel</literal></para></listitem> |
1571 |
|
<listitem><para><literal>Central Meridian</literal></para></listitem> |
1572 |
|
<listitem><para><literal>Latitude of Origin</literal></para></listitem> |
1573 |
|
<listitem><para><literal>False Easting</literal> (meters)</para></listitem> |
1574 |
|
<listitem><para><literal>False Northing</literal> (meters)</para></listitem> |
1575 |
|
</itemizedlist> |
1576 |
|
</listitem> |
1577 |
|
<listitem> |
1578 |
|
<para>Transverse Mercator</para> |
1579 |
|
<itemizedlist> |
1580 |
|
<listitem><para><literal>Ellipsoid</literal></para></listitem> |
1581 |
|
<listitem><para><literal>Latitude</literal>of origin</para></listitem> |
1582 |
|
<listitem><para><literal>Longitude</literal>at central meridian</para></listitem> |
1583 |
|
<listitem><para><literal>Scale Factor</literal>at central meridian</para></listitem> |
1584 |
|
<listitem><para><literal>False Easting</literal> (meters)</para></listitem> |
1585 |
|
<listitem><para><literal>False Northing</literal> (meters)</para></listitem> |
1586 |
|
</itemizedlist> |
1587 |
|
</listitem> |
1588 |
|
<listitem> |
1589 |
|
<para>Universal Transverse Mercator</para> |
1590 |
|
<itemizedlist> |
1591 |
|
<listitem><para><literal>Ellipsoid</literal></para></listitem> |
1592 |
|
<listitem><para><literal>Zone</literal> |
1593 |
|
(can be guessed appling the Propose button)</para></listitem> |
1594 |
|
<listitem><para><literal>Southern Hemisphere</literal> flag</para></listitem> |
1595 |
|
</itemizedlist> |
1596 |
|
</listitem> |
1597 |
|
</itemizedlist> |
1598 |
|
|
1599 |
|
<para> |
1600 |
|
Thuban comes with a sample set of map projections for various |
1601 |
|
European countries. Apart from the basic projection they differ |
1602 |
|
especially in their parameterization: |
1603 |
|
</para> |
1604 |
|
<itemizedlist> |
1605 |
|
<listitem><para>Belgium Datum 1972 (Lambert Conic Conformal)</para> |
1606 |
|
</listitem> |
1607 |
|
|
1608 |
|
<listitem><para>Gauss-Boaga Zone 1 (Italy, Transverse Mercartor)</para> |
1609 |
|
</listitem> |
1610 |
|
|
1611 |
|
<listitem><para>Gauss-Krueger Zone 2 (Germany, Transverse Mercartor) |
1612 |
|
</para> |
1613 |
|
</listitem> |
1614 |
|
|
1615 |
|
<listitem><para>Reseau Geodesique Francaise |
1616 |
|
(France, Lambert Conic Conformal)</para> |
1617 |
|
</listitem> |
1618 |
|
|
1619 |
|
<listitem><para>UK National Grid (United Kingdom, Transverse Mercartor) |
1620 |
|
</para> |
1621 |
|
</listitem> |
1622 |
|
</itemizedlist> |
1623 |
|
|
1624 |
|
<para> |
1625 |
|
Thuban uses the comprehensive PROJ library for projections. PROJ provides |
1626 |
|
more than the four commonly used projections described above. If needed |
1627 |
|
Thuban can be easily extended to a new projection covered by PROJ. |
1628 |
</para> |
</para> |
|
<variablelist> |
|
|
<varlistentry> |
|
|
<term>Geographic</term> |
|
|
<listitem><para></para></listitem> |
|
|
</varlistentry> |
|
|
<varlistentry> |
|
|
<term>Lambert Conic Conformal</term> |
|
|
<listitem><para></para></listitem> |
|
|
</varlistentry> |
|
|
<varlistentry> |
|
|
<term>Transverse Mercator</term> |
|
|
<listitem><para></para></listitem> |
|
|
</varlistentry> |
|
|
<varlistentry> |
|
|
<term>Universal Transverse Mercator</term> |
|
|
<listitem><para></para></listitem> |
|
|
</varlistentry> |
|
|
</variablelist> |
|
1629 |
</appendix> |
</appendix> |
1630 |
|
|
1631 |
</book> |
</book> |
1632 |
|
|