From cvs at intevation.de Fri Oct 1 19:54:15 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 19:54:15 +0200 (CEST) Subject: joey: thuban/Extensions/wms wms.py,1.10,1.11 Message-ID: <20041001175415.95163102C2C@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms In directory doto:/tmp/cvs-serv27830/Extensions/wms Modified Files: wms.py Log Message: Extended argument for general use through properties-dialog selector Index: wms.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/wms.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- wms.py 28 Sep 2004 19:54:50 -0000 1.10 +++ wms.py 1 Oct 2004 17:54:13 -0000 1.11 @@ -28,7 +28,7 @@ from Thuban.Model.proj import Projection from Thuban.Model.extension import Extension from Thuban.UI.command import registry, Command -from Thuban.UI.mainwindow import main_menu +from Thuban.UI.mainwindow import main_menu, layer_properties_dialogs from Thuban import _ import Thuban.UI.baserenderer from Thuban.UI.extensionregistry import ExtensionDesc, ext_registry @@ -65,6 +65,8 @@ return () Thuban.UI.baserenderer.add_renderer_extension(WMSLayer, render_wms_layer) +from properties import wmsProperties +layer_properties_dialogs.add(WMSLayer, wmsProperties) class SelectWMSServer(wxDialog): From cvs at intevation.de Fri Oct 1 20:00:44 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:00:44 +0200 (CEST) Subject: joey: thuban/Thuban/UI classifier.py,1.65,1.66 Message-ID: <20041001180044.3A569102BD9@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv27939/Thuban/UI Modified Files: classifier.py Log Message: Unify arguments for general use through properties-dialog selector, the map can be retrieved through the parent and doesn't require an argument of its own. Index: classifier.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- classifier.py 7 May 2004 20:20:43 -0000 1.65 +++ classifier.py 1 Oct 2004 18:00:42 -0000 1.66 @@ -685,7 +685,7 @@ FIELDTYPE_INT: _("Integer"), FIELDTYPE_DOUBLE: _("Decimal")} - def __init__(self, parent, name, map, layer, group = None): + def __init__(self, parent, name, layer, group = None): """Create a Properties/Classification dialog for a layer. The layer is part of map. If group is not None, select that group in the classification table. @@ -697,7 +697,7 @@ self.parent.Subscribe(MAP_REPLACED, self.map_replaced) self.layer = layer - self.map = map + self.map = parent.Map() self.map.Subscribe(MAP_LAYERS_REMOVED, self.map_layers_removed) self.layer.Subscribe(LAYER_SHAPESTORE_REPLACED, From cvs at intevation.de Fri Oct 1 20:07:16 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:07:16 +0200 (CEST) Subject: joey: thuban/Thuban/UI mainwindow.py,1.132,1.133 Message-ID: <20041001180716.F3604102BD9@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv28064/Thuban/UI Modified Files: mainwindow.py Log Message: The map can be retrieved through the parent which is passed to the constructor anyway and doesn't require an argument of its own, required for the unification of arguments for general use through properties-dialog selector. Index: mainwindow.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/mainwindow.py,v retrieving revision 1.132 retrieving revision 1.133 diff -u -d -r1.132 -r1.133 --- mainwindow.py 18 Apr 2004 20:37:01 -0000 1.132 +++ mainwindow.py 1 Oct 2004 18:07:14 -0000 1.133 @@ -709,7 +709,7 @@ dialog = self.get_open_dialog(name) if dialog is None: - dialog = Classifier(self, name, self.Map(), layer, group) + dialog = Classifier(self, name, layer, group) self.add_dialog(name, dialog) dialog.Show() dialog.Raise() From cvs at intevation.de Fri Oct 1 20:18:51 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:18:51 +0200 (CEST) Subject: joey: thuban/Thuban/UI mainwindow.py,1.133,1.134 Message-ID: <20041001181851.D7C78102BDC@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv28207/Thuban/UI Modified Files: mainwindow.py Log Message: Move the logic for checking whether a dialog is already opened (and raising it to the users attention) and creating a new dialog into a function of its own Index: mainwindow.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/mainwindow.py,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- mainwindow.py 1 Oct 2004 18:07:14 -0000 1.133 +++ mainwindow.py 1 Oct 2004 18:18:49 -0000 1.134 @@ -349,6 +349,23 @@ """ self.SetStatusText(text) + def OpenOrRaiseDialog(self, name, dialog_class, *args, **kw): + """ + Open or raise a dialog. + + If a dialog with the denoted name does already exist it is + raised. Otherwise a new dialog, an instance of dialog_class, + is created, inserted into the main list and displayed. + """ + dialog = self.get_open_dialog(name) + + if dialog is None: + dialog = dialog_class(self, name, *args, **kw) + self.add_dialog(name, dialog) + dialog.Show(True) + else: + dialog.Raise() + def save_modified_session(self, can_veto = 1): """If the current session has been modified, ask the user whether to save it and do so if requested. Return the outcome of @@ -705,15 +722,16 @@ self.OpenLayerProperties(layer) def OpenLayerProperties(self, layer, group = None): - name = "layer_properties" + str(id(layer)) - dialog = self.get_open_dialog(name) - - if dialog is None: - dialog = Classifier(self, name, layer, group) - self.add_dialog(name, dialog) - dialog.Show() - dialog.Raise() + """ + Open or raise the properties dialog. + This method opens or raises the properties dialog for the + currently selected layer if one is defined for this layer + type. + """ + name = "layer_properties" + str(id(layer)) + self.OpenOrRaiseDialog(name, Classifier, layer, group = group) + def LayerJoinTable(self): layer = self.canvas.SelectedLayer() if layer is not None: From cvs at intevation.de Fri Oct 1 20:22:34 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:22:34 +0200 (CEST) Subject: joey: thuban/Thuban/UI mainwindow.py,1.134,1.135 Message-ID: <20041001182234.38C8F102BDC@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv28298/Thuban/UI Modified Files: mainwindow.py Log Message: Utilise the new ClassMapper for global registration of properties dialog classes (which are indeed layer-specific). Index: mainwindow.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/mainwindow.py,v retrieving revision 1.134 retrieving revision 1.135 diff -u -d -r1.134 -r1.135 --- mainwindow.py 1 Oct 2004 18:18:49 -0000 1.134 +++ mainwindow.py 1 Oct 2004 18:22:32 -0000 1.135 @@ -35,7 +35,6 @@ import view import tree import tableview, identifyview -from Thuban.UI.classifier import Classifier import legend from menu import Menu @@ -53,6 +52,9 @@ import projdialog +from Thuban.Lib.classmapper import ClassMapper + +layer_properties_dialogs = ClassMapper() class MainWindow(DockFrame): @@ -729,9 +731,12 @@ currently selected layer if one is defined for this layer type. """ - name = "layer_properties" + str(id(layer)) - self.OpenOrRaiseDialog(name, Classifier, layer, group = group) - + dialog_class = layer_properties_dialogs.get(layer) + + if dialog_class is not None: + name = "layer_properties" + str(id(layer)) + self.OpenOrRaiseDialog(name, dialog_class, layer, group = group) + def LayerJoinTable(self): layer = self.canvas.SelectedLayer() if layer is not None: From cvs at intevation.de Fri Oct 1 20:24:13 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:24:13 +0200 (CEST) Subject: joey: thuban/Thuban/UI classifier.py,1.66,1.67 Message-ID: <20041001182413.08098102BDC@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv28332/Thuban/UI Modified Files: classifier.py Log Message: Register properties dialog classes for both provided layer classes/types Index: classifier.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- classifier.py 1 Oct 2004 18:00:42 -0000 1.66 +++ classifier.py 1 Oct 2004 18:24:10 -0000 1.67 @@ -1510,3 +1510,7 @@ def _OnLeftDClick(self, event): self.DoEdit() + +from Thuban.UI.mainwindow import layer_properties_dialogs +layer_properties_dialogs.add(Layer, Classifier) +layer_properties_dialogs.add(RasterLayer, Classifier) From cvs at intevation.de Fri Oct 1 20:28:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:28:06 +0200 (CEST) Subject: joey: thuban/Extensions/wms properties.py,1.1,1.2 Message-ID: <20041001182806.77264102BDC@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms In directory doto:/tmp/cvs-serv28442/Extensions/wms Modified Files: properties.py Log Message: Extended argument for general use through properties-dialog selector Index: properties.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/properties.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- properties.py 15 Apr 2004 16:14:51 -0000 1.1 +++ properties.py 1 Oct 2004 18:28:04 -0000 1.2 @@ -72,7 +72,7 @@ Representation for the WMS properties dialog """ - def __init__(self, parent, name, layer): + def __init__(self, parent, name, layer, *args, **kw): """ Build the properties dialog """ From cvs at intevation.de Fri Oct 1 20:29:56 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 1 Oct 2004 20:29:56 +0200 (CEST) Subject: joey: thuban ChangeLog,1.695,1.696 Message-ID: <20041001182956.99875102BDC@lists.intevation.de> Author: joey Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv28487 Modified Files: ChangeLog Log Message: Updated the changelog file to reflect the recent work Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.695 retrieving revision 1.696 diff -u -d -r1.695 -r1.696 --- ChangeLog 28 Sep 2004 19:58:51 -0000 1.695 +++ ChangeLog 1 Oct 2004 18:29:54 -0000 1.696 @@ -1,3 +1,33 @@ +2004-10-01 Martin Schulze + + * Extensions/wms/properties.py (wmsProperties.__init__): Extended + argument for general use through properties-dialog selector + + * Thuban/UI/classifier.py: Register properties dialog classes for + both provided layer classes/types. + + * Thuban/UI/mainwindow.py (MainWindow.OpenLayerProperties): The + map can be retrieved through the parent which is passed to the + constructor anyway and doesn't require an argument of its own, + required for the unification of arguments for general use through + properties-dialog selector. + (MainWindow.OpenOrRaiseDialog): Move the logic for checking + whether a dialog is already opened (and raising it to the users + attention) and creating a new dialog into a function of its own + (MainWindow.OpenLayerProperties): Use the new OpenOrRaiseDialog() + method + (MainWindow.OpenLayerProperties): Utilise the new ClassMapper for + global registration of properties dialog classes (which are indeed + layer-specific). + + * Thuban/UI/classifier.py (Classifier.__init__): Unify arguments + for general use through properties-dialog selector, the map can be + retrieved through the parent and doesn't require an argument of + its own. + + * Extensions/wms/wms.py: Register the properties dialog class for + the provided WMS layer + 2004-09-28 Jan-Oliver Wagner New feature: Registry for Extensions. From joey at infodrom.org Fri Oct 1 20:31:35 2004 From: joey at infodrom.org (Martin Schulze) Date: Fri, 1 Oct 2004 20:31:35 +0200 Subject: [Thuban-devel] Re: RfD: Support for layer specific resources In-Reply-To: References: <20040811143417.GB3511@finlandia.infodrom.north.de> <20040824125321.GB853@finlandia.infodrom.north.de> <20040907154616.GJ6910@finlandia.infodrom.north.de> <20040929190839.GE15510@finlandia.infodrom.north.de> <20040930160640.GC15510@finlandia.infodrom.north.de> Message-ID: <20041001183134.GE15510@finlandia.infodrom.north.de> Bernhard Herzog wrote: > Martin Schulze writes: > > > Whoops, you are correct. Great. In that case, at least at the moment > > there is no problem with having the definition in mainwindow.py. New > > patch attached. > > Looks good. Great! Patch split and committed. Regards, Joey -- Life is a lot easier when you have someone to share it with. -- Sean Perry From cvs at intevation.de Sun Oct 3 21:37:39 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 21:37:39 +0200 (CEST) Subject: jan: thuban/Doc/manual thuban-manual-de.xml,1.2,1.3 Message-ID: <20041003193739.D7110102C7F@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Doc/manual In directory doto:/tmp/cvs-serv4314 Modified Files: thuban-manual-de.xml Log Message: Started translation of Map chapter. Index: thuban-manual-de.xml =================================================================== RCS file: /thubanrepository/thuban/Doc/manual/thuban-manual-de.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- thuban-manual-de.xml 1 Aug 2004 21:28:16 -0000 1.2 +++ thuban-manual-de.xml 3 Oct 2004 19:37:37 -0000 1.3 @@ -546,18 +546,19 @@ - Map Management + Karten Management - The map consists of a number of layers where each layer represents a - different type of data set. By interacting with the map the user can - visually explore the data. + Die Karte besteht aus eine Anzahl Ebenen wobei jede Ebene einen + Datensatz mit bestimtem Typ repräsentiert. Mit Interaktion auf der + Karte kann ein Benutzer die Daten visuell erforschen. - The map can have a name that will appear in the Thuban title bar. - The map name can be changed using + Die Karte kann einen Namen haben der dann in der Kopfzeile des + Thuban Fensters auftaucht. Der Kartenname kann geändert werden + über - Map - Rename + Karte + Umbennen . @@ -568,71 +569,77 @@ - Rename Map + Karte umbennen -
Adding and Removing Layers - - There are three types of layers that can be added to a map: - Shape layers, database layers - and image layers. Shape layers are stored in Shapefile format, a - widely used file format for storing geographic objects. These - files have the extension ``.shp''. Associated with - the shape file is a database file which stores attributes for - each shape in the Shape file. This file, in dBase format, - has the extension ``.dbf''. Both files must have the same base name. - For example, if there is a shape file named roads.shp there must - also be a file roads.dbf. - +
Hinzufügen und Entfernen von Ebenen + + Es gibt drei Typen von Ebenen aus denen eine Karte besteht: + Shape Ebene, Datenbank Ebene und Bildebene. + Shape Ebenen sind im Shapefile Format gespeichert welches + weit verbreitet für die Speicherung von geografischen Objekten + genutzt wird. + Die Dateien haben die Endung ``.shp''. Mit der eigentlichen Shape + Datei ist eine Datenbank Datei welche die Attribut-Daten zu dem + Shapefile enthält. Diese Datenbank Datei verwendet das dBase Format + und hat die Endung ``.dbf''. Beide Dateien müssen den selben + Basisnamen haben. So gehören zum Beispiel die Dateien + strassen.shp und strassen.dbf zusammen. + - Shape layers can be added to the map with + Shape Ebenen können zur Karte hinzugefügt werden mit - Map - Add Layer + Karte + Ebene hinzufügen . - Initially, only the ``.shp'' files are shown which is enough for the - selection. However, if you switch to display all files and select one - of the associated files (e.g. ``.dbf''), Thuban will recognize the base - name and load the corresponding Shape file. - + Zunächst werden im Dateiauswahl Dialog nur die ``.shp'' Dateien + angezeigt, was für die Auswahl vollkommen ausreicht. + Falls Sie aber auf Ansicht aller Dateien umschalten, und dann + einer der assoziierten Dateien (z.B. mit der Endung ``.dbf'') + auswählen, so verwendet Thuban den Basisnamen um die entsprechende + Shape Datei zu laden, + - The file dialog for Shape files allows to select multiple files. - Use the shift-button together with the left mouse button to extend - the selection. - + Der Dateidialog für Shape Dateien erlaubt es auch, viele + Dateien gleichzeitig auszuwählen. Verwenden Sie dafür + die Umschalt-Taste gleichzeitig mit der linken Maustaste um + die Auswahl zu erweitern. + - Database layers can be added to the map with + Datenbankebenen können zu Karte hinzugefügt werden mit - Map - Add Database Layer + Karte + Datenbankebene hinzufügen . - A dialog with two is list is opened. The left list displays all - database connections currently open for the session. You can retrieve - a list of available layers from the selected database which is - displayed on the right hand. From this list one layer can be selected, - the dialog is closed afterwards. + Es wird ein Duialog mit zwei Listen geöffnet. + Die linke Liste zeigt alle derzeit offenen Datenbankverbindungen dieser + Session an. Eine Liste der verfügbaren Ebenen aus einer Datenbankverbindung + wird steht auf der rechten Seite. Aus dieser Liste können Sie eine + beliebige Ebene zum Öffnen auswählen. Der Dialog wird dabach + automatisch beendet. - See appendix ``Working with PostGIS'' for details. + Siehe auch Anhang ``Mit PostGIS arbeiten'' für weitere Details. - Image layers can be added to the map with + Bildebenen können zur Karte hinzugefügt werden mit - Map - Add Image Layer + Karte + Bildebene hinzufügen . - It is important to select a valid image file that has geographic - data associated with it. The data can be embedded in the file itself, - or in another file. If geographic information cannot be found, Thuban - will report an error. + Es ist wichtig, dass eine korrekte Bilddatei ausgewählt für + die auch geographische Daten (Projektions) vorliegen. + Diese Daten können in die Bilddatei eingebettet sein oder + als separate Datei vorliegen. Können diese Daten nicht + gefunden werden, so wird Thuban einen Fehler melden. @@ -640,14 +647,14 @@
Navigation - The map can be explored by using the navigation tools available on - the tool bar or from the - Map menu. + Die Karte kann erforscht werden indem die Navigationswerkzeuge + aus der Werkzeugleiste oder über das Menü + Karte ausgewählt werden. - The ZoomIn tool + Das ZoomIn Werkzeug @@ -655,17 +662,17 @@ - ZoomIn Tool + ZoomIn Werkzeug - enlarges a region of the map. Clicking once on the map - will double the magnification and center the map on the point that - was clicked. Clicking and dragging selects a region that will be - enlarged to fit the window. + vergrößert einen Bereich aus der Karte. Ein einmaliges Klicken auf + die Karte vergrößert die Karte um das Doppelte und zentriert auf den + angewählten Punkt. Klicken und Ziehen selektiert einen Bereich + der dann so vergrößert wird, dass er das Fenster ausfüllt. - The ZoomOut tool + Das ZoomOut Werkzeug @@ -673,12 +680,12 @@ - ZoomOut Tool + ZoomOut Werkzeug - shrinks the map so that a larger region is visible. A single click - reduces the magnification by a factor of two. Clicking and dragging - selects a box such that the current contents of the window will be - scaled to fit into that box. + verkleinert die Karte, so dass ein größerer Bereich zu sehen ist. + Ein einzelnen Klick verkleinert die Karte um Faktor 2. + Klicken und Ziehen selektiert einen Bereich in den die gesamte sichtbare + Karte im Fenster hineinverkleinert wird. From cvs at intevation.de Sun Oct 3 21:38:16 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 21:38:16 +0200 (CEST) Subject: jan: thuban ChangeLog,1.696,1.697 Message-ID: <20041003193816.7E505102C7F@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv4342 Modified Files: ChangeLog Log Message: some further translation into german Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.696 retrieving revision 1.697 diff -u -d -r1.696 -r1.697 --- ChangeLog 1 Oct 2004 18:29:54 -0000 1.696 +++ ChangeLog 3 Oct 2004 19:38:14 -0000 1.697 @@ -1,3 +1,8 @@ +2004-10-03 Jan-Oliver Wagner + + * Doc/manual/thuban-manual-de.xml: Started translation of + Map chapter. + 2004-10-01 Martin Schulze * Extensions/wms/properties.py (wmsProperties.__init__): Extended From cvs at intevation.de Sun Oct 3 22:38:56 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 22:38:56 +0200 (CEST) Subject: jan: thuban/Resources/XML thuban-1.1.dtd,1.1,1.2 Message-ID: <20041003203856.804BB102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Resources/XML In directory doto:/tmp/cvs-serv5048 Modified Files: thuban-1.1.dtd Log Message: Added size attribute to cldata. Index: thuban-1.1.dtd =================================================================== RCS file: /thubanrepository/thuban/Resources/XML/thuban-1.1.dtd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- thuban-1.1.dtd 12 Mar 2004 12:19:15 -0000 1.1 +++ thuban-1.1.dtd 3 Oct 2004 20:38:54 -0000 1.2 @@ -3,7 +3,7 @@ Copyright (C) 2001, 2003, 2004 by Intevation GmbH Authors: - Jan-Oliver Wagner + Jan-Oliver Wagner Bernhard Herzog This program is free software under the GPL (>=v2) @@ -153,12 +153,13 @@ + From cvs at intevation.de Sun Oct 3 22:41:50 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 22:41:50 +0200 (CEST) Subject: jan: thuban/Data iceland_sample_size.thuban,NONE,1.1 Message-ID: <20041003204150.33257102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Data In directory doto:/tmp/cvs-serv5149 Added Files: iceland_sample_size.thuban Log Message: Sample for sized point objects. --- NEW FILE: iceland_sample_size.thuban --- From cvs at intevation.de Sun Oct 3 22:49:26 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 22:49:26 +0200 (CEST) Subject: jan: thuban/test test_load.py,1.38,1.39 Message-ID: <20041003204926.712DB102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv5266 Modified Files: test_load.py Log Message: (ClassificationTest.TestLayers): Added SetSize in case of a corresponding argument is given. TestSymbolSize): New. Test the size attribute of cldata. Index: test_load.py =================================================================== RCS file: /thubanrepository/thuban/test/test_load.py,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- test_load.py 12 Mar 2004 12:19:15 -0000 1.38 +++ test_load.py 3 Oct 2004 20:49:24 -0000 1.39 @@ -162,6 +162,8 @@ props.SetLineWidth(data[CLASSES][i][GROUP_PROPS][1]) props.SetFill( parse_color(data[CLASSES][i][GROUP_PROPS][2])) + if len(data[CLASSES][i][GROUP_PROPS]) > 3: + props.SetSize(data[CLASSES][i][GROUP_PROPS][3]) if data[CLASSES][i][GROUP_TYPE] == "default": g = ClassGroupDefault(props, data[CLASSES][i][GROUP_LABEL]) @@ -384,6 +386,53 @@ layer = layers[0] eq(layer.Visible(), False) + + self.check_format() + + +class TestSymbolSize(ClassificationTest): + + file_contents = '''\ + + + + + + + + + + + + + + + + + + + + +''' + + def test(self): + """Test that the size attribute for point symbols is correctly + loaded for a layer.""" + eq = self.assertEquals + session = load_session(self.filename()) + self.session = session + + map = session.Maps()[0] # only one map in the sample + + expected = [("cultural_landmark-point", 2, + [("default", (), "", + ("#000000", 1, "#000000", 3)), + ("single", "RUINS", "", + ("#000000", 1, "#ffffff", 6)), + ("single", "FARM", "", + ("#000000", 1, "#ffff00", 9))])] + + self.TestLayers(map.Layers(), expected) self.check_format() From cvs at intevation.de Sun Oct 3 23:01:33 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 23:01:33 +0200 (CEST) Subject: jan: thuban/Thuban/Model classification.py,1.38,1.39 Message-ID: <20041003210133.8368C102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv5430 Modified Files: classification.py Log Message: Removed some trailing whitespaces. (ClassGroupProperties.__init__): Set default size. (ClassGroupProperties.SetProperties): Set the size. (ClassGroupProperties.GetSize): New. Return the size. (ClassGroupProperties.SetSize): New. Set the size. (ClassGroupProperties__eq__): Compare also size. (ClassGroupProperties__repr__): Print also size. Index: classification.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/classification.py,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- classification.py 3 Nov 2003 13:55:41 -0000 1.38 +++ classification.py 3 Oct 2004 21:01:31 -0000 1.39 @@ -315,7 +315,7 @@ items.append(build_item(p, p.GetDisplayText())) return (_("Classification"), items) - + class ClassIterator: """Allows the Groups in a Classifcation to be interated over. @@ -327,11 +327,11 @@ """Constructor. default -- the default group - + points -- a list of singleton groups ranges -- a list of range groups - + maps -- a list of map groups """ @@ -350,19 +350,22 @@ d = self.data[self.data_index] self.data_index += 1 return d - + class ClassGroupProperties: """Represents the properties of a single Classification Group. - + These are used when rendering a layer.""" + # TODO: Actually, size is only relevant for point objects. + # Eventually it should be spearated, e.g. when introducing symbols. + def __init__(self, props = None): """Constructor. props -- a ClassGroupProperties object. The class is copied if prop is not None. Otherwise, a default set of properties is created such that: line color = Black, line width = 1, - and fill color = Transparent + size = 5 and fill color = Transparent """ if props is not None: @@ -370,6 +373,7 @@ else: self.SetLineColor(Black) self.SetLineWidth(1) + self.SetSize(5) self.SetFill(Transparent) def SetProperties(self, props): @@ -378,8 +382,9 @@ assert isinstance(props, ClassGroupProperties) self.SetLineColor(props.GetLineColor()) self.SetLineWidth(props.GetLineWidth()) + self.SetSize(props.GetSize()) self.SetFill(props.GetFill()) - + def GetLineColor(self): """Return the line color as a Color object.""" return self.__stroke @@ -407,10 +412,25 @@ self.__strokeWidth = lineWidth + def GetSize(self): + """Return the size.""" + return self.__size + + def SetSize(self, size): + """Set the size. + + size -- the new size. This must be > 0. + """ + assert isinstance(size, types.IntType) + if (size < 1): + raise ValueError(_("size < 1")) + + self.__size = size + def GetFill(self): """Return the fill color as a Color object.""" return self.__fill - + def SetFill(self, fill): """Set the fill color. @@ -431,7 +451,8 @@ self.__stroke == other.__stroke) \ and (self.__fill is other.__fill or \ self.__fill == other.__fill) \ - and self.__strokeWidth == other.__strokeWidth + and self.__strokeWidth == other.__strokeWidth\ + and self.__size == other.__size def __ne__(self, other): return not self.__eq__(other) @@ -443,7 +464,8 @@ return ClassGroupProperties(self) def __repr__(self): - return repr((self.__stroke, self.__strokeWidth, self.__fill)) + return repr((self.__stroke, self.__strokeWidth, self.__size, + self.__fill)) class ClassGroup: """A base class for all Groups within a Classification""" @@ -466,7 +488,7 @@ def GetLabel(self): """Return the Group's label.""" return self.label - + def SetLabel(self, label): """Set the Group's label. From cvs at intevation.de Sun Oct 3 23:05:32 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 23:05:32 +0200 (CEST) Subject: jan: thuban/Thuban/Model load.py,1.48,1.49 Message-ID: <20041003210532.9B4DF102BD8@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv5695 Modified Files: load.py Log Message: (SessionLoader.start_cldata): Also parse the size attribute. Index: load.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- load.py 12 Mar 2004 12:19:15 -0000 1.48 +++ load.py 3 Oct 2004 21:05:30 -0000 1.49 @@ -554,6 +554,7 @@ parse_color(attrs.get((None, 'stroke'), "None"))) self.cl_prop.SetLineWidth( int(attrs.get((None, 'stroke_width'), "0"))) + self.cl_prop.SetSize(int(attrs.get((None, 'size'), "5"))) self.cl_prop.SetFill(parse_color(attrs.get((None, 'fill'), "None"))) def end_cldata(self, name, qname): From cvs at intevation.de Sun Oct 3 23:23:27 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 23:23:27 +0200 (CEST) Subject: jan: thuban/Thuban/UI classifier.py,1.67,1.68 Message-ID: <20041003212327.C1819102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv6111 Modified Files: classifier.py Log Message: (ClassDataPreviewer.Draw): Added doc-string. Also, now there is a return value that indicates whether the drawing size exceeded the given rect extent and if so the new extent. Finally, point objects are drawn depending on the size. If either the width or height is exceeded, the new extent is returned. (ClassRenderer.Draw): Now when calling the previewer drawing function, evaluate the return value and, if not None, adapt the grid widget size accordingly and redraw again. Index: classifier.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- classifier.py 1 Oct 2004 18:24:10 -0000 1.67 +++ classifier.py 3 Oct 2004 21:23:25 -0000 1.68 @@ -331,7 +331,7 @@ row = -1 self.clazz = clazz - + self.__NotifyRowChanges(old_len, self.GetNumberRows()) # @@ -439,11 +439,11 @@ """ self.SetValueAsCustom(row, col, None, value) - + def GetValueAsCustom(self, row, col, typeName): """Return the object that is used to represent the given cell coordinates. This may not be a string. - + typeName -- unused, but needed to overload wxPyGridTableBase """ @@ -915,13 +915,13 @@ table.SetValueAsCustom(row, COL_SYMBOL, None, new_prop) self.Enable(True) propDlg.Destroy() - + def _SetClassification(self, clazz): """Called from the ClassGen dialog when a new classification has been created and should be set in the table. """ # FIXME: This could be implemented using a message - + self.fields.SetClientData(self.__cur_field, clazz) self.classGrid.GetTable().SetClassification(clazz) @@ -1266,10 +1266,10 @@ topBox.Add(buttonBox, 0, wxALIGN_RIGHT|wxBOTTOM|wxTOP, 10) button_ok.SetDefault() - + #EVT_BUTTON(self, wxID_OK, self._OnOK) #EVT_BUTTON(self, ID_SELPROP_CANCEL, self._OnCancel) - + self.SetAutoLayout(True) self.SetSizer(topBox) topBox.Fit(self) @@ -1296,7 +1296,7 @@ dialog.Destroy() return ret - + def _OnChangeLineColor(self, event): clr = self.__GetColor(self.prop.GetLineColor()) if clr is not None: @@ -1306,7 +1306,7 @@ def _OnChangeLineColorTrans(self, event): self.prop.SetLineColor(Transparent) self.previewWin.Refresh() # XXX: work around, see ClassDataPreviewer - + def _OnChangeFillColor(self, event): clr = self.__GetColor(self.prop.GetFill()) if clr is not None: @@ -1360,6 +1360,13 @@ """Class that actually draws a group property preview.""" def Draw(self, dc, rect, prop, shapeType): + """Draw the property. + + returns: (w, h) as adapted extend if the drawing size + exceeded the given rect. This can only be the case + for point symbols. If the symbol fits the given rect, + None is returned. + """ assert dc is not None assert isinstance(prop, ClassGroupProperties) @@ -1399,12 +1406,20 @@ elif shapeType == SHAPETYPE_POINT: - dc.DrawCircle(x + w/2, y + h/2, - (min(w, h) - prop.GetLineWidth())/2) + dc.DrawCircle(x + w/2, y + h/2, prop.GetSize()) + circle_size = prop.GetSize() * 2 + prop.GetLineWidth() * 2 + new_h = h + new_w = w + if h < circle_size: new_h = circle_size + if w < circle_size: new_w = circle_size + if new_h > h or new_w > w: + return (new_w, new_h) elif shapeType == SHAPETYPE_POLYGON: dc.DrawRectangle(x, y, w, h) + return None + class ClassRenderer(wxPyGridCellRenderer): """A wrapper class that can be used to draw group properties in a grid table. @@ -1426,7 +1441,26 @@ rect.GetWidth(), rect.GetHeight()) if not isinstance(data, ClassGroupMap): - self.previewer.Draw(dc, rect, data.GetProperties(), self.shapeType) + new_size = self.previewer.Draw(dc, rect, data.GetProperties(), + self.shapeType) + if new_size is not None: + (new_w, new_h) = new_size + grid.SetRowSize(row, new_h) + grid.SetColSize(col, new_h) + grid.ForceRefresh() + + # now that we know the height, redraw everything + rect.SetHeight(new_h) + rect.SetWidth(new_w) + dc.DestroyClippingRegion() + dc.SetClippingRegion(rect.GetX(), rect.GetY(), + rect.GetWidth(), rect.GetHeight()) + dc.SetPen(wxPen(wxLIGHT_GREY)) + dc.SetBrush(wxBrush(wxLIGHT_GREY, wxSOLID)) + dc.DrawRectangle(rect.GetX(), rect.GetY(), + rect.GetWidth(), rect.GetHeight()) + self.previewer.Draw(dc, rect, data.GetProperties(), + self.shapeType) if isSelected: dc.SetPen(wxPen(wxBLACK, 1, wxSOLID)) From cvs at intevation.de Sun Oct 3 23:45:50 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 3 Oct 2004 23:45:50 +0200 (CEST) Subject: jan: thuban/Thuban/UI baserenderer.py,1.11,1.12 Message-ID: <20041003214550.F261B102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv6406 Modified Files: baserenderer.py Log Message: (BaseRenderer.draw_shape_layer_incrementally): If the draw function is for points, call it with the size as additional parameter. BaseRenderer.draw_point_shape): Added additional, optional parameter for the size. Compute the radius using the size. Index: baserenderer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/baserenderer.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- baserenderer.py 13 Jul 2004 11:07:45 -0000 1.11 +++ baserenderer.py 3 Oct 2004 21:45:48 -0000 1.12 @@ -289,7 +289,11 @@ data = shape.RawData() else: data = shape.Points() - draw_func(draw_func_param, data, pen, brush) + if draw_func == self.draw_point_shape: + draw_func(draw_func_param, data, pen, brush, + size = group.GetProperties().GetSize()) + else: + draw_func(draw_func_param, data, pen, brush) if count % 500 == 0: yield True @@ -421,7 +425,7 @@ for part in points: self.dc.DrawLines(part) - def draw_point_shape(self, layer, points, pen, brush): + def draw_point_shape(self, layer, points, pen, brush, size = 5): """Draw a point shape from layer with the given brush and pen The shape is given by points argument which is a the return @@ -435,7 +439,7 @@ if not points: return - radius = int(round(self.resolution * 5)) + radius = int(round(self.resolution * size)) self.dc.SetBrush(brush) self.dc.SetPen(pen) for part in points: From cvs at intevation.de Mon Oct 4 00:00:37 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 00:00:37 +0200 (CEST) Subject: jan: thuban/Extensions/importAPR apr.py,1.3,1.4 Message-ID: <20041003220037.946D9102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/importAPR In directory doto:/tmp/cvs-serv6885 Modified Files: apr.py Log Message: (APR_BMkSym.GetThubanProp): Now that Thuban supports size, apply this correctly. Index: apr.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/importAPR/apr.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- apr.py 30 Oct 2003 09:14:52 -0000 1.3 +++ apr.py 3 Oct 2004 22:00:35 -0000 1.4 @@ -1,4 +1,4 @@ -# Copyright (C) 2003 by Intevation GmbH +# Copyright (C) 2003, 2004 by Intevation GmbH # Authors: # Jan-Oliver Wagner # @@ -58,9 +58,8 @@ Next, there is always a 'Font' reference. Probably this defines the font for the label. This is not interpreted for Thuban. - There is always a Size element. SinceThuban can currently not - handle different sizes of point symbols, Size is used to set - the line width. + There is always a Size element. It is not clear how 'size' + defined in ArcView. There is always a Angle element, but I don't know how this is defined. I only sighted the value of 360 so far. @@ -82,7 +81,7 @@ but we can vary the width of the line. """ prop = ClassGroupProperties() - prop.SetLineWidth(int(ceil(float(self.Get('Size'))))) + prop.SetSize(int(ceil(float(self.Get('Size'))))) prop.SetLineColor(self.Get('Color').GetThubanColor()) prop.SetFill(self.Get('BgColor').GetThubanColor()) return prop @@ -91,7 +90,7 @@ """Polygon symbol object. Always references TClr objects via 'Color', 'OutlineColor' and 'BgColor'. Always has attributes 'OutlineWidth' and 'Outline'. - + OutlineColor is interpreted to be the Thuban line color, OutlineWidth as the Thuban line width. 'Color' is interpreted to be the Thuban fill color. @@ -138,7 +137,7 @@ def GetThubanRange(self): """Return a Thuban range that corresponds to this object. - + The returned object is a - Range-Object in case of a numerical range. - String-Object in case of a text range (assuming that From cvs at intevation.de Mon Oct 4 00:02:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 00:02:59 +0200 (CEST) Subject: jan: thuban/Extensions/importAPR importAPR.py,1.5,1.6 Message-ID: <20041003220259.9BAE9102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/importAPR In directory doto:/tmp/cvs-serv6972 Modified Files: importAPR.py Log Message: Bumped version to 0.1.1. Index: importAPR.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/importAPR/importAPR.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- importAPR.py 28 Sep 2004 19:29:06 -0000 1.5 +++ importAPR.py 3 Oct 2004 22:02:57 -0000 1.6 @@ -1,4 +1,4 @@ -# Copyright (C) 2003 by Intevation GmbH +# Copyright (C) 2003, 2004 by Intevation GmbH # Authors: # Jan-Oliver Wagner # @@ -34,9 +34,9 @@ ext_registry.add(ExtensionDesc( name = 'importAPR', - version = '0.1.0', + version = '0.1.1', authors= [ 'Jan-Oliver Wagner' ], - copyright = '2003 Intevation GmbH', + copyright = '2003, 2004 Intevation GmbH', desc = _("Import a ArcView project file (.apr)\n" \ "and convert it to Thuban."))) From cvs at intevation.de Mon Oct 4 00:04:34 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 00:04:34 +0200 (CEST) Subject: jan: thuban ChangeLog,1.697,1.698 Message-ID: <20041003220434.AD11D102C7D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv7008 Modified Files: ChangeLog Log Message: First elements for sizeable point objects. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.697 retrieving revision 1.698 diff -u -d -r1.697 -r1.698 --- ChangeLog 3 Oct 2004 19:38:14 -0000 1.697 +++ ChangeLog 3 Oct 2004 22:04:32 -0000 1.698 @@ -1,5 +1,48 @@ 2004-10-03 Jan-Oliver Wagner + First elements for sizeable point objects. + + * Resources/XML/thuban-1.1.dtd: Added size attribute to cldata. + + * Data/iceland_sample_size.thuban: New. Sample for sized point objects. + + * test/test_load.py (ClassificationTest.TestLayers): Added SetSize in case + of a corresponding argument is given. + (TestSymbolSize): New. Test the size attribute of cldata. + + * Thuban/Model/classification.py: Removed some trailing whitespaces. + (ClassGroupProperties.__init__): Set default size. + (ClassGroupProperties.SetProperties): Set the size. + (ClassGroupProperties.GetSize): New. Return the size. + (ClassGroupProperties.SetSize): New. Set the size. + (ClassGroupProperties__eq__): Compare also size. + (ClassGroupProperties__repr__): Print also size. + + * Thuban/Model/load.py (SessionLoader.start_cldata): Also parse + the size attribute. + + * Thuban/UI/classifier.py (ClassDataPreviewer.Draw): Added doc-string. + Also, now there is a return value that indicates whether the drawing + size exceeded the given rect extent and if so the new extent. + Finally, point objects are drawn depending on the size. If either + the width or height is exceeded, the new extent is returned. + (ClassRenderer.Draw): Now when calling the previewer drawing function, + evaluate the return value and, if not None, adapt the grid widget size + accordingly and redraw again. + + * Thuban/UI/baserenderer.py (BaseRenderer.draw_shape_layer_incrementally): + If the draw function is for points, call it with the size as additional + parameter. + (BaseRenderer.draw_point_shape): Added additional, optional parameter for + the size. Compute the radius using the size. + + * Extensions/importAPR/apr.py (APR_BMkSym.GetThubanProp): Now + that Thuban supports size, apply this correctly. + + * Extensions/importAPR/importAPR.py: Bumped version to 0.1.1. + +2004-10-03 Jan-Oliver Wagner + * Doc/manual/thuban-manual-de.xml: Started translation of Map chapter. From jan at intevation.de Mon Oct 4 12:47:58 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 4 Oct 2004 12:47:58 +0200 Subject: Experimental patch for sizeable point symbols In-Reply-To: <20040922225735.GA16913@intevation.de> References: <20040922225735.GA16913@intevation.de> Message-ID: <20041004104758.GA19082@intevation.de> Hi, I commited the patch (+- some more docs/comments). I see the following remaining TODOs to have full size support: - Add the possibility to set the size in the symbol edit window - Have size be saved as well - Take care that the legend show the symbols of different sizes nicely (must be possibel somehow to have bigger graphics in that tree wisget!) - Consider the size in the UMN MapServer Extension - take care symbol is always show correctly in the classification dialog - handle classification to have a size gradient - make it possible to have the size applied for classification so that it either refers to area or to radius. (the original wish which is listed on the roadmap as well). - add info about the size in the manual, including new screenshots - have a screenshot on the homepage showing the size. Hope I did not forget anything. I will work on this as time permits, but any help would be really appreciated! Best Jan On Thu, Sep 23, 2004 at 12:57:35AM +0200, Jan-Oliver Wagner wrote: > attached is a patch (against current HEAD) and a sample file > that adds a size for point symbols. > > It is experimental. You have to edit the .thuban file > manually to have symbols of different size. > I am also not sure if it is the best technical approach to solve this. > But I would be glad if we could as a first step agree on > whether the dtd definition is OK and can be checked in > with the sample file. > > Note: I wrote this patch in the train from D?sseldorf > to Osnabr?ck (1h) plus some fiddling tonight with the > wxGrid to adapt to the size of the symbol. -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bh at intevation.de Mon Oct 4 12:56:06 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 04 Oct 2004 12:56:06 +0200 Subject: Experimental patch for sizeable point symbols In-Reply-To: <20041004104758.GA19082@intevation.de> (Jan-Oliver Wagner's message of "Mon, 4 Oct 2004 12:47:58 +0200") References: <20040922225735.GA16913@intevation.de> <20041004104758.GA19082@intevation.de> Message-ID: Jan-Oliver Wagner writes: > I commited the patch (+- some more docs/comments). I get a test failure: FAIL: test_load.TestSymbolSize.test ---------------------------------------------------------------------- Traceback (most recent call last): File "test_load.py", line 437, in test self.check_format() File "test_load.py", line 128, in check_format "loaded file not equivalent to the saved file") File "/usr/lib/python2.2/unittest.py", line 286, in failUnlessEqual raise self.failureException, \ AssertionError: loaded file not equivalent to the saved file Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/ From jan at intevation.de Mon Oct 4 14:33:58 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 4 Oct 2004 14:33:58 +0200 Subject: [Thuban-devel] Re: Experimental patch for sizeable point symbols In-Reply-To: References: <20040922225735.GA16913@intevation.de> <20041004104758.GA19082@intevation.de> Message-ID: <20041004123358.GB19163@intevation.de> On Mon, Oct 04, 2004 at 12:56:06PM +0200, Bernhard Herzog wrote: > Jan-Oliver Wagner writes: > > I commited the patch (+- some more docs/comments). > > I get a test failure: > > FAIL: test_load.TestSymbolSize.test > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "test_load.py", line 437, in test > self.check_format() > File "test_load.py", line 128, in check_format > "loaded file not equivalent to the saved file") > File "/usr/lib/python2.2/unittest.py", line 286, in failUnlessEqual > raise self.failureException, \ > AssertionError: loaded file not equivalent to the saved file thats due to the missing save routine. Will be the next item to implement. Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bh at intevation.de Mon Oct 4 15:01:51 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 04 Oct 2004 15:01:51 +0200 Subject: Experimental patch for sizeable point symbols In-Reply-To: <20041004104758.GA19082@intevation.de> (Jan-Oliver Wagner's message of "Mon, 4 Oct 2004 12:47:58 +0200") References: <20040922225735.GA16913@intevation.de> <20041004104758.GA19082@intevation.de> Message-ID: Jan-Oliver Wagner writes: > I see the following remaining TODOs to have full size > support: [...] - respect the size when doing hit-testing - Handle this better in the renderer. The current implementation is a horrible kludge that only works in some circumstances. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/ From bh at intevation.de Mon Oct 4 15:06:41 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 04 Oct 2004 15:06:41 +0200 Subject: jan: thuban/Thuban/UI baserenderer.py,1.11,1.12 References: <20041003214550.F261B102C7D@lists.intevation.de> Message-ID: cvs at intevation.de writes: > --- baserenderer.py 13 Jul 2004 11:07:45 -0000 1.11 > +++ baserenderer.py 3 Oct 2004 21:45:48 -0000 1.12 > @@ -289,7 +289,11 @@ > data = shape.RawData() > else: > data = shape.Points() > - draw_func(draw_func_param, data, pen, brush) > + if draw_func == self.draw_point_shape: This is not the right solution. There is no guarantee that the draw_func used for point shapes is actually self.draw_point_shape. It's not completely wrong to do it this way because it only means that the size will be ignored if it's not self.draw_point_shape. The best solution I can come with right now is to simply pass the classification group to all low-level render functions as well so that they can look up additional parameters if they need them. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/ From jan at intevation.de Mon Oct 4 15:24:50 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 4 Oct 2004 15:24:50 +0200 Subject: [Thuban-devel] Re: jan: thuban/Thuban/UI baserenderer.py, 1.11, 1.12 In-Reply-To: References: <20041003214550.F261B102C7D@lists.intevation.de> Message-ID: <20041004132450.GA19250@intevation.de> On Mon, Oct 04, 2004 at 03:06:41PM +0200, Bernhard Herzog wrote: > cvs at intevation.de writes: > > > --- baserenderer.py 13 Jul 2004 11:07:45 -0000 1.11 > > +++ baserenderer.py 3 Oct 2004 21:45:48 -0000 1.12 > > @@ -289,7 +289,11 @@ > > data = shape.RawData() > > else: > > data = shape.Points() > > - draw_func(draw_func_param, data, pen, brush) > > + if draw_func == self.draw_point_shape: > > This is not the right solution. There is no guarantee that the > draw_func used for point shapes is actually self.draw_point_shape. It's > not completely wrong to do it this way because it only means that the > size will be ignored if it's not self.draw_point_shape. > > The best solution I can come with right now is to simply pass the > classification group to all low-level render functions as well so that > they can look up additional parameters if they need them. yes, thats what I thought, but did not dare to do. Again, with introducing complex symbols, this of course should then be addressed. -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From joey at infodrom.org Mon Oct 4 18:33:42 2004 From: joey at infodrom.org (Martin Schulze) Date: Mon, 4 Oct 2004 18:33:42 +0200 Subject: Testing methods fail? Message-ID: <20041004163342.GE15510@finlandia.infodrom.north.de> Is there something as an easy way to test for a comparison to fail without the surrounding test rountine failing? Something like self.FailIfNotFail(self.MethodToFail(arg1, arg2))? Regards, Joey -- Everybody talks about it, but nobody does anything about it! -- Mark Twain From cvs at intevation.de Mon Oct 4 18:40:58 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 18:40:58 +0200 (CEST) Subject: joey: thuban/Extensions/wms/test test_parser.py,1.18,1.19 Message-ID: <20041004164058.637C310016D@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms/test In directory doto:/tmp/cvs-serv4180 Modified Files: test_parser.py Log Message: Added missing self-test Index: test_parser.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/test/test_parser.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- test_parser.py 13 Apr 2004 17:17:40 -0000 1.18 +++ test_parser.py 4 Oct 2004 16:40:56 -0000 1.19 @@ -95,6 +95,52 @@ self.grok(xml) + def test_compareLists(self): + """ + Test the internal compareLists method. + """ + + # Equality of empty lists + self.compareLists([], []) + + # Equality of equal lists + self.compareLists([1,2], [1,2]) + + # Equality of permuted lists + self.compareLists([1,2], [2,1]) + + # Equality of large permuted lists + self.compareLists([1,2,3,4,5,6,7,8], [8,3,1,2,5,7,4,6]) + + # TODO: Check if non-equality raises an exception: + # + # [a,b] != [c,b,a] + # [a,b] != [c,b] + # [] = [] + # [] != [a] + + + def test_compareDicts(self): + """ + Test the internal compareDicts method. + """ + + # Equality of empty dictionaries + self.compareDicts({}, {}) + + # Equality of equal dictionaries + # Python may represent the dictionaries differently + self.compareDicts({10:20, 11:30}, {10:20, 11:30}) + + # Equality of permuted dictionaries + # Python may represent the dictionaries similar anyway + self.compareDicts({10:20, 11:30}, {11:30, 10:20}) + + # TODO: Check if non-equality raises an exception: + # + # {a:b, b:c} != {a:b} + + def test_general(self): """ Test general attributes extracted from Capabilities XML From bh at intevation.de Mon Oct 4 18:41:06 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 04 Oct 2004 18:41:06 +0200 Subject: Testing methods fail? In-Reply-To: <20041004163342.GE15510@finlandia.infodrom.north.de> (Martin Schulze's message of "Mon, 4 Oct 2004 18:33:42 +0200") References: <20041004163342.GE15510@finlandia.infodrom.north.de> Message-ID: Martin Schulze writes: > Is there something as an easy way to test for a comparison to fail > without the surrounding test rountine failing? Something like > self.FailIfNotFail(self.MethodToFail(arg1, arg2))? I'm not sure what you mean exactly, but if you expect self.MethodToFail(arg1, arg2) to raise an exception you can test for that with assertRaises . Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Oct 4 18:44:07 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 18:44:07 +0200 (CEST) Subject: joey: thuban ChangeLog,1.698,1.699 Message-ID: <20041004164407.1401E10016D@lists.intevation.de> Author: joey Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv4271 Modified Files: ChangeLog Log Message: Added missing self-test Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.698 retrieving revision 1.699 diff -u -d -r1.698 -r1.699 --- ChangeLog 3 Oct 2004 22:04:32 -0000 1.698 +++ ChangeLog 4 Oct 2004 16:44:05 -0000 1.699 @@ -1,3 +1,11 @@ +2004-10-04 Martin Schulze + + * Extensions/wms/test/test_parser.py + (TestWMSCapabilitiesParser.test_compareLists): Added missing + self-test for compareLists() + (TestWMSCapabilitiesParser.test_compareDicts): Added missing + self-test for compareDicts() + 2004-10-03 Jan-Oliver Wagner First elements for sizeable point objects. From joey at infodrom.org Mon Oct 4 18:50:57 2004 From: joey at infodrom.org (Martin Schulze) Date: Mon, 4 Oct 2004 18:50:57 +0200 Subject: Testing methods fail? In-Reply-To: References: <20041004163342.GE15510@finlandia.infodrom.north.de> Message-ID: <20041004165057.GF15510@finlandia.infodrom.north.de> Bernhard Herzog wrote: > Martin Schulze writes: > > > Is there something as an easy way to test for a comparison to fail > > without the surrounding test rountine failing? Something like > > self.FailIfNotFail(self.MethodToFail(arg1, arg2))? > > I'm not sure what you mean exactly, but if you expect > self.MethodToFail(arg1, arg2) to raise an exception you can test for > that with assertRaises . Great! From the name it looks like what I was missing in the docs. Thanks, Joey -- Everybody talks about it, but nobody does anything about it! -- Mark Twain From cvs at intevation.de Mon Oct 4 19:01:04 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 19:01:04 +0200 (CEST) Subject: joey: thuban/Extensions/wms/test test_parser.py,1.19,1.20 Message-ID: <20041004170104.BFE3210016E@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms/test In directory doto:/tmp/cvs-serv5380 Modified Files: test_parser.py Log Message: Adding more tests to verify the test routine fails with non-equal arguments Index: test_parser.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/test/test_parser.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- test_parser.py 4 Oct 2004 16:40:56 -0000 1.19 +++ test_parser.py 4 Oct 2004 17:01:02 -0000 1.20 @@ -112,13 +112,15 @@ # Equality of large permuted lists self.compareLists([1,2,3,4,5,6,7,8], [8,3,1,2,5,7,4,6]) - # TODO: Check if non-equality raises an exception: - # - # [a,b] != [c,b,a] - # [a,b] != [c,b] - # [] = [] - # [] != [a] + # Non-Equality of different lists + self.assertRaises(AssertionError, self.compareLists, [1,2], [3,2]) + + # Non-Equality of different lists + self.assertRaises(AssertionError, self.compareLists, [1,2], [3,2,1]) + # Non-Equality of empty and non-empty list + self.assertRaises(AssertionError, self.compareLists, [], [3,2,1]) + def test_compareDicts(self): """ @@ -136,9 +138,13 @@ # Python may represent the dictionaries similar anyway self.compareDicts({10:20, 11:30}, {11:30, 10:20}) - # TODO: Check if non-equality raises an exception: - # - # {a:b, b:c} != {a:b} + # Non-equality of different dictionaries + self.assertRaises(AssertionError, self.compareDicts, {10:20, 11:30}, + {10:20, 11:30, 12:40}) + + # Non-equality of empty and non-empty dictionaries + self.assertRaises(AssertionError, self.compareDicts, {}, + {10:20, 11:30, 12:40}) def test_general(self): From cvs at intevation.de Mon Oct 4 19:03:31 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 4 Oct 2004 19:03:31 +0200 (CEST) Subject: joey: thuban ChangeLog,1.699,1.700 Message-ID: <20041004170331.CE6C410016E@lists.intevation.de> Author: joey Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv5418 Modified Files: ChangeLog Log Message: Adding more tests to verify the test routine fails with non-equal arguments Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.699 retrieving revision 1.700 diff -u -d -r1.699 -r1.700 --- ChangeLog 4 Oct 2004 16:44:05 -0000 1.699 +++ ChangeLog 4 Oct 2004 17:03:29 -0000 1.700 @@ -5,6 +5,10 @@ self-test for compareLists() (TestWMSCapabilitiesParser.test_compareDicts): Added missing self-test for compareDicts() + (TestWMSCapabilitiesParser.test_compareLists): Adding more tests + to verify the test routine fails with non-equal arguments + (TestWMSCapabilitiesParser.test_compareDicts): Adding more tests + to verify the test routine fails with non-equal arguments 2004-10-03 Jan-Oliver Wagner From jan at intevation.de Mon Oct 4 23:40:39 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 4 Oct 2004 23:40:39 +0200 Subject: [Thuban-devel] News for Mapserver Extension? In-Reply-To: <20040930103706.GK18854@intevation.de> References: <20040922113209.GA1299@intevation.de> <20040930103706.GK18854@intevation.de> Message-ID: <20041004214039.GB15736@intevation.de> On Thu, Sep 30, 2004 at 12:37:06PM +0200, Bernhard Reiter wrote: > I guess we should make this a Thuban news. > Is anybody working on that? I wrote a news now. Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From jan at intevation.de Tue Oct 5 01:00:57 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Tue, 5 Oct 2004 01:00:57 +0200 Subject: [Thuban-devel] Re: Experimental patch for sizeable point symbols In-Reply-To: <20041004104758.GA19082@intevation.de> References: <20040922225735.GA16913@intevation.de> <20041004104758.GA19082@intevation.de> Message-ID: <20041004230057.GA20127@intevation.de> On Mon, Oct 04, 2004 at 12:47:58PM +0200, Jan-Oliver Wagner wrote: > - Add the possibility to set the size in the symbol edit window > - handle classification to have a size gradient these two are addressed with the attached patch. Seems the grid widget needs some further improvement to better adjust itself to the sizes of the point symbols. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ -------------- next part -------------- ? build ? thubaninit.py ? test/temp Index: Thuban/Model/classgen.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/classgen.py,v retrieving revision 1.18 diff -u -3 -p -r1.18 classgen.py --- Thuban/Model/classgen.py 26 Sep 2003 18:36:01 -0000 1.18 +++ Thuban/Model/classgen.py 4 Oct 2004 22:56:46 -0000 @@ -345,6 +345,11 @@ class CustomRamp: + self.prop1.GetLineWidth() newProps.SetLineWidth(int(round(w))) + s = (self.prop2.GetSize() - self.prop1.GetSize()) \ + * index \ + + self.prop1.GetSize() + newProps.SetSize(int(round(s))) + return newProps def __SetProperty(self, color1, color2, index, setf): Index: Thuban/UI/classifier.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v retrieving revision 1.68 diff -u -3 -p -r1.68 classifier.py --- Thuban/UI/classifier.py 3 Oct 2004 21:23:25 -0000 1.68 +++ Thuban/UI/classifier.py 4 Oct 2004 22:56:46 -0000 @@ -1170,12 +1170,13 @@ class Classifier(NonModalNonParentDialog if win: win.Enable(enable) -ID_SELPROP_SPINCTRL = 4002 +ID_SELPROP_SPINCTRL_LINEWIDTH = 4002 ID_SELPROP_PREVIEW = 4003 ID_SELPROP_STROKECLR = 4004 ID_SELPROP_FILLCLR = 4005 ID_SELPROP_STROKECLRTRANS = 4006 ID_SELPROP_FILLCLRTRANS = 4007 +ID_SELPROP_SPINCTRL_SIZE = 4008 class SelectPropertiesDialog(wxDialog): """Dialog that allows the user to select group properties.""" @@ -1239,19 +1240,38 @@ class SelectPropertiesDialog(wxDialog): ctrlBox.Add(fillColorBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL | wxGROW, 4) + # Line width selection spinBox = wxBoxSizer(wxHORIZONTAL) spinBox.Add(wxStaticText(self, -1, _("Line Width: ")), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) - self.spinCtrl = wxSpinCtrl(self, ID_SELPROP_SPINCTRL, - min=1, max=10, - value=str(prop.GetLineWidth()), - initial=prop.GetLineWidth()) + self.spinCtrl_linewidth = wxSpinCtrl(self, + ID_SELPROP_SPINCTRL_LINEWIDTH, + min=1, max=10, + value=str(prop.GetLineWidth()), + initial=prop.GetLineWidth()) - EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL, self._OnSpin) - - spinBox.Add(self.spinCtrl, 0, wxALIGN_LEFT | wxALL, 4) + EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_LINEWIDTH, + self._OnSpinLineWidth) + spinBox.Add(self.spinCtrl_linewidth, 0, wxALIGN_LEFT | wxALL, 4) ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) + + # Size selection + if shapeType == SHAPETYPE_POINT: + spinBox = wxBoxSizer(wxHORIZONTAL) + spinBox.Add(wxStaticText(self, -1, _("Size: ")), + 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) + self.spinCtrl_size = wxSpinCtrl(self, ID_SELPROP_SPINCTRL_SIZE, + min=1, max=100, + value=str(prop.GetSize()), + initial=prop.GetSize()) + + EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_SIZE, self._OnSpinSize) + + spinBox.Add(self.spinCtrl_size, 0, wxALIGN_LEFT | wxALL, 4) + ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) + + itemBox.Add(ctrlBox, 0, wxALIGN_RIGHT | wxALL | wxGROW, 0) topBox.Add(itemBox, 1, wxALIGN_LEFT | wxALL | wxGROW, 0) @@ -1281,8 +1301,12 @@ class SelectPropertiesDialog(wxDialog): def OnCancel(self, event): self.EndModal(wxID_CANCEL) - def _OnSpin(self, event): - self.prop.SetLineWidth(self.spinCtrl.GetValue()) + def _OnSpinLineWidth(self, event): + self.prop.SetLineWidth(self.spinCtrl_linewidth.GetValue()) + self.previewWin.Refresh() + + def _OnSpinSize(self, event): + self.prop.SetSize(self.spinCtrl_size.GetValue()) self.previewWin.Refresh() def __GetColor(self, cur): From cvs at intevation.de Thu Oct 7 16:19:50 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 7 Oct 2004 16:19:50 +0200 (CEST) Subject: jan: thuban/Thuban/Model save.py,1.39,1.40 Message-ID: <20041007141950.988B4102BE5@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv14562 Modified Files: save.py Log Message: (SessionSaver.write_classification): Write attribute 'size' for cldata when the shape layer is of point type. This also now make the test_load.py tests happy. Index: save.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/save.py,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- save.py 12 Mar 2004 12:19:15 -0000 1.39 +++ save.py 7 Oct 2004 14:19:48 -0000 1.40 @@ -1,8 +1,10 @@ -# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH +# $Id$ +# Copyright (c) 2001-2004 by Intevation GmbH # Authors: -# Jan-Oliver Wagner -# Bernhard Herzog -# Jonathan Coles +# Jan-Oliver Wagner (2004) +# Bernhard Herzog (2001-2004) +# Jonathan Coles (2003) +# Frank Koormann (2003) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -23,7 +25,8 @@ ClassGroupDefault, ClassGroupSingleton, ClassGroupRange, ClassGroupMap from Thuban.Model.transientdb import AutoTransientTable, TransientJoinedTable from Thuban.Model.table import DBFTable, FIELDTYPE_STRING -from Thuban.Model.data import DerivedShapeStore, ShapefileStore +from Thuban.Model.data import DerivedShapeStore, ShapefileStore, \ + SHAPETYPE_POINT from Thuban.Model.xmlwriter import XMLWriter from postgisdb import PostGISConnection, PostGISShapeStore @@ -343,6 +346,10 @@ dict = {'stroke' : data.GetLineColor().hex(), 'stroke_width': str(data.GetLineWidth()), 'fill' : data.GetFill().hex()} + + # only for point layers write the size attribute + if layer.ShapeType() == SHAPETYPE_POINT: + dict['size'] = str(data.GetSize()) self.open_element(open_el) self.write_element("cldata", dict) From cvs at intevation.de Thu Oct 7 16:24:26 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 7 Oct 2004 16:24:26 +0200 (CEST) Subject: jan: thuban/Thuban/Model save.py,1.40,1.41 Message-ID: <20041007142426.808D2102BE5@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv14708 Modified Files: save.py Log Message: put Id and Source to the usual place Index: save.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/save.py,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- save.py 7 Oct 2004 14:19:48 -0000 1.40 +++ save.py 7 Oct 2004 14:24:24 -0000 1.41 @@ -1,4 +1,3 @@ -# $Id$ # Copyright (c) 2001-2004 by Intevation GmbH # Authors: # Jan-Oliver Wagner (2004) @@ -14,6 +13,8 @@ """ __version__ = "$Revision$" +# $Source$ +# $Id$ import os From cvs at intevation.de Thu Oct 7 16:28:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 7 Oct 2004 16:28:53 +0200 (CEST) Subject: jan: thuban/Thuban/Model classgen.py,1.18,1.19 Message-ID: <20041007142853.D5B80102BE5@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv14858 Modified Files: classgen.py Log Message: (CustomRamp.GetProperties): Added size gradient. Index: classgen.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/classgen.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- classgen.py 26 Sep 2003 18:36:01 -0000 1.18 +++ classgen.py 7 Oct 2004 14:28:51 -0000 1.19 @@ -1,6 +1,9 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003-2004 by Intevation GmbH # Authors: -# Jonathan Coles +# Jan-Oliver Wagner (2004) +# Bernhard Herzog (2003) +# Thomas Köster (2003) +# Jonathan Coles (2003) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -141,7 +144,7 @@ max = _list[q] group = ClassGroupRange(Range((start, min, max, end)), prop) - + group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), round(p*100, 2))) oldp = p @@ -156,7 +159,7 @@ def calculate_quantiles(_list, percents, _range): """Calculate quantiles for the given _list of percents from the sorted list of values that are in range. - + This may not actually generate len(percents) quantiles if many of the values that fall on quantile borders are the same. @@ -344,6 +347,11 @@ * index \ + self.prop1.GetLineWidth() newProps.SetLineWidth(int(round(w))) + + s = (self.prop2.GetSize() - self.prop1.GetSize()) \ + * index \ + + self.prop1.GetSize() + newProps.SetSize(int(round(s))) return newProps From cvs at intevation.de Thu Oct 7 16:43:47 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 7 Oct 2004 16:43:47 +0200 (CEST) Subject: jan: thuban/Thuban/UI classifier.py,1.68,1.69 Message-ID: <20041007144347.451A7102C14@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv15286 Modified Files: classifier.py Log Message: (ID_SELPROP_SPINCTRL): Renamed to ID_SELPROP_SPINCTRL_LINEWIDTH. (ID_SELPROP_SPINCTRL_LINEWIDTH): New Id replaces ID_SELPROP_SPINCTRL. (ID_SELPROP_SPINCTRL_SIZE): New Id. (SelectPropertiesDialog.__init__): Added a second spin control for the size in case the corresponding layer is of point type. (SelectPropertiesDialog._OnSpin): Renamed to _OnSpinLineWidth. (SelectPropertiesDialog._OnSpinLineWidth): New. Former _OnSpin. (SelectPropertiesDialog._OnSpinSize): New. Set size of property and refresh preview. Index: classifier.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classifier.py,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- classifier.py 3 Oct 2004 21:23:25 -0000 1.68 +++ classifier.py 7 Oct 2004 14:43:45 -0000 1.69 @@ -1,6 +1,10 @@ -# Copyright (c) 2001, 2003 by Intevation GmbH +# Copyright (c) 2003-2004 by Intevation GmbH # Authors: -# Jonathan Coles +# Jan-Oliver Wagner (2003-2004) +# Martin Schulze (2004) +# Frank Koormann (2003) +# Bernhard Herzog (2003) +# Jonathan Coles (2003) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -8,6 +12,8 @@ """Dialog for classifying how layers are displayed""" __version__ = "$Revision$" +# $Source$ +# $Id$ import copy @@ -1170,12 +1176,13 @@ if win: win.Enable(enable) -ID_SELPROP_SPINCTRL = 4002 +ID_SELPROP_SPINCTRL_LINEWIDTH = 4002 ID_SELPROP_PREVIEW = 4003 ID_SELPROP_STROKECLR = 4004 ID_SELPROP_FILLCLR = 4005 ID_SELPROP_STROKECLRTRANS = 4006 ID_SELPROP_FILLCLRTRANS = 4007 +ID_SELPROP_SPINCTRL_SIZE = 4008 class SelectPropertiesDialog(wxDialog): """Dialog that allows the user to select group properties.""" @@ -1239,19 +1246,38 @@ ctrlBox.Add(fillColorBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL | wxGROW, 4) + # Line width selection spinBox = wxBoxSizer(wxHORIZONTAL) spinBox.Add(wxStaticText(self, -1, _("Line Width: ")), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) - self.spinCtrl = wxSpinCtrl(self, ID_SELPROP_SPINCTRL, - min=1, max=10, - value=str(prop.GetLineWidth()), - initial=prop.GetLineWidth()) - - EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL, self._OnSpin) + self.spinCtrl_linewidth = wxSpinCtrl(self, + ID_SELPROP_SPINCTRL_LINEWIDTH, + min=1, max=10, + value=str(prop.GetLineWidth()), + initial=prop.GetLineWidth()) - spinBox.Add(self.spinCtrl, 0, wxALIGN_LEFT | wxALL, 4) + EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_LINEWIDTH, + self._OnSpinLineWidth) + spinBox.Add(self.spinCtrl_linewidth, 0, wxALIGN_LEFT | wxALL, 4) ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) + + # Size selection + if shapeType == SHAPETYPE_POINT: + spinBox = wxBoxSizer(wxHORIZONTAL) + spinBox.Add(wxStaticText(self, -1, _("Size: ")), + 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 4) + self.spinCtrl_size = wxSpinCtrl(self, ID_SELPROP_SPINCTRL_SIZE, + min=1, max=100, + value=str(prop.GetSize()), + initial=prop.GetSize()) + + EVT_SPINCTRL(self, ID_SELPROP_SPINCTRL_SIZE, self._OnSpinSize) + + spinBox.Add(self.spinCtrl_size, 0, wxALIGN_LEFT | wxALL, 4) + ctrlBox.Add(spinBox, 0, wxALIGN_RIGHT | wxALL, 0) + + itemBox.Add(ctrlBox, 0, wxALIGN_RIGHT | wxALL | wxGROW, 0) topBox.Add(itemBox, 1, wxALIGN_LEFT | wxALL | wxGROW, 0) @@ -1281,8 +1307,12 @@ def OnCancel(self, event): self.EndModal(wxID_CANCEL) - def _OnSpin(self, event): - self.prop.SetLineWidth(self.spinCtrl.GetValue()) + def _OnSpinLineWidth(self, event): + self.prop.SetLineWidth(self.spinCtrl_linewidth.GetValue()) + self.previewWin.Refresh() + + def _OnSpinSize(self, event): + self.prop.SetSize(self.spinCtrl_size.GetValue()) self.previewWin.Refresh() def __GetColor(self, cur): From cvs at intevation.de Thu Oct 7 16:44:49 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 7 Oct 2004 16:44:49 +0200 (CEST) Subject: jan: thuban ChangeLog,1.700,1.701 Message-ID: <20041007144449.C8983102C15@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv15367 Modified Files: ChangeLog Log Message: Further elements for sizable point objects now making this feature usable though not yet complete. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.700 retrieving revision 1.701 diff -u -d -r1.700 -r1.701 --- ChangeLog 4 Oct 2004 17:03:29 -0000 1.700 +++ ChangeLog 7 Oct 2004 14:44:47 -0000 1.701 @@ -1,3 +1,28 @@ +2004-10-07 Jan-Oliver Wagner + + Further elements for sizable point objects now + making this feature usable though not yet complete. + + * Thuban/Model/save.py (SessionSaver.write_classification): Write + attribute 'size' for cldata when the shape layer is of point type. + This also now make the test_load.py tests happy. + + * Thuban/Model/classgen.py (CustomRamp.GetProperties): Added size + gradient. + + * Thuban/UI/classifier.py (ID_SELPROP_SPINCTRL): Renamed to + ID_SELPROP_SPINCTRL_LINEWIDTH. + (ID_SELPROP_SPINCTRL_LINEWIDTH): New Id replaces ID_SELPROP_SPINCTRL. + (ID_SELPROP_SPINCTRL_SIZE): New Id. + (SelectPropertiesDialog.__init__): Added a second spin control + for the size in case the corresponding layer is of point type. + (SelectPropertiesDialog._OnSpin): Renamed to _OnSpinLineWidth. + (SelectPropertiesDialog._OnSpinLineWidth): New. Former _OnSpin. + (SelectPropertiesDialog._OnSpinSize): New. Set size of property + and refresh preview. + + + 2004-10-04 Martin Schulze * Extensions/wms/test/test_parser.py From jan at intevation.de Thu Oct 7 16:56:06 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 7 Oct 2004 16:56:06 +0200 Subject: Status of sizeable points feature Message-ID: <20041007145606.GA1104@intevation.de> Hi, I just checked on the second bunch of patches. Now, the sizeable point symbols are usable in principle. Have fun. The things that remain to be done are (any help welcome): - Take care that the legend show the symbols of different sizes nicely (must be possibel somehow to have bigger graphics in that tree widgets!) - Consider the size in the UMN MapServer Extension - Take care symbol is always shown correctly in the classification dialog. Especially when doing a classficaton, the grid widget looks confused. - Make it possible to have the size applied for classification so that it either refers to area or to radius. (the original wish which is listed on the roadmap as well). - Add info about the size in the manual, including new screenshots - Have a screenshot on the homepage showing the size. - Respect the size when doing hit-testing. - Handle this better in the renderer. The current implementation is a horrible kludge that only works in some circumstances. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bh at intevation.de Thu Oct 7 17:22:29 2004 From: bh at intevation.de (Bernhard Herzog) Date: Thu, 07 Oct 2004 17:22:29 +0200 Subject: jan: thuban/Thuban/Model classgen.py,1.18,1.19 In-Reply-To: <20041007142853.D5B80102BE5@lists.intevation.de> (cvs@intevation.de's message of "Thu, 7 Oct 2004 16:28:53 +0200 (CEST)") References: <20041007142853.D5B80102BE5@lists.intevation.de> Message-ID: cvs at intevation.de writes: > Modified Files: > classgen.py > Log Message: > (CustomRamp.GetProperties): Added size gradient. Where's the test case for this? Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/ From jan at intevation.de Thu Oct 7 17:53:04 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 7 Oct 2004 17:53:04 +0200 Subject: [Thuban-devel] Status of sizeable points feature In-Reply-To: <20041007145606.GA1104@intevation.de> References: <20041007145606.GA1104@intevation.de> Message-ID: <20041007155304.GA1451@intevation.de> On Thu, Oct 07, 2004 at 04:56:06PM +0200, Jan-Oliver Wagner wrote: > The things that remain to be done are (any help welcome): > > - Take care that the legend show the symbols of different sizes > nicely (must be possibel somehow to have bigger graphics in that > tree widgets!) > - Consider the size in the UMN MapServer Extension > - Take care symbol is always shown correctly > in the classification dialog. Especially when doing a > classficaton, the grid widget looks confused. > - Make it possible to have the size applied for classification > so that it either refers to area or to radius. > (the original wish which is listed on the roadmap as well). > - Add info about the size in the manual, including new > screenshots > - Have a screenshot on the homepage showing the size. > - Respect the size when doing hit-testing. > - Handle this better in the renderer. The current implementation is a > horrible kludge that only works in some circumstances. so I forgot: - test case for CustomRamp for size gradient -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bernhard at intevation.de Fri Oct 8 17:09:34 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Fri, 8 Oct 2004 17:09:34 +0200 Subject: Experimental patch for sizeable point symbols In-Reply-To: <20041004104758.GA19082@intevation.de> References: <20040922225735.GA16913@intevation.de> <20041004104758.GA19082@intevation.de> Message-ID: <20041008150934.GI23596@intevation.de> On Mon, Oct 04, 2004 at 12:47:58PM +0200, Jan-Oliver Wagner wrote: > I see the following remaining TODOs to have full size > support: About support for the svgexport? :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041008/c838dd50/attachment.bin From joey at infodrom.org Wed Oct 13 13:04:56 2004 From: joey at infodrom.org (Martin Schulze) Date: Wed, 13 Oct 2004 13:04:56 +0200 Subject: [frankie@debian.org: Introducing the DebianGis subproject] Message-ID: <20041013110455.GY13859@finlandia.infodrom.north.de> FYI Regards, Joey ----- Forwarded message from "Francesco P. Lovergine" ----- Date: Wed, 13 Oct 2004 10:47:51 +0200 From: "Francesco P. Lovergine" To: Debian Developers Announces Subject: Introducing the DebianGis subproject X-Folder: debian-devel-announce at lists.debian.org DebianGis is a new sub-project recently launched thanks to the efforts of a group of Debian developers and users. The goal of DebianGis is to create a Custom Debian Distribution [1] oriented to serious Geographical Information Systems (GIS) users and applications [2]. Debian already includes several GIS oriented programs and libraries, thus our first aim is to coordinate development efforts. In addition, at this stage we wish to collect as much information as possible on users' needs and suggestions. In the future we would broaden the project to include other Earth Observation software categories in order to create the first all Free Software [3] distribution dedicated to Remote Sensing, Earth Observation, and Geographical Information Systems. Of course, all people interested are invited to join us. We are currently using the pkg-grass project site on Alioth [4] to provide a mailing list [5] and wiki [6]. Stay tuned, more novelties would come as soon as possible... *References: [1] http://wiki.debian.net/index.cgi?CustomDebian [2] http://en.wikipedia.org/wiki/Gis [3] http://www.gnu.org/philosophy/free-sw.html [4] https://alioth.debian.org/projects/pkg-grass/ [5] http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-general [6] http://pkg-grass.alioth.debian.org/cgi-bin/wiki.pl -- The DebianGis Team ----- End forwarded message ----- -- In the beginning was the word, and the word was content-type: text/plain From bernhard at intevation.de Wed Oct 20 19:00:13 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Wed, 20 Oct 2004 19:00:13 +0200 Subject: [frankie@debian.org: Introducing the DebianGis subproject] In-Reply-To: <20041013110455.GY13859@finlandia.infodrom.north.de> References: <20041013110455.GY13859@finlandia.infodrom.north.de> Message-ID: <20041020170013.GN10179@intevation.de> Ooooch, they do not mention FreeGIS. On Wed, Oct 13, 2004 at 01:04:56PM +0200, Martin Schulze wrote: > FYI > ----- Forwarded message from "Francesco P. Lovergine" ----- > > Date: Wed, 13 Oct 2004 10:47:51 +0200 > From: "Francesco P. Lovergine" > To: Debian Developers Announces > Subject: Introducing the DebianGis subproject > X-Folder: debian-devel-announce at lists.debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041020/7fa6a315/attachment.bin From frank.koormann at intevation.de Wed Oct 27 12:42:58 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Wed, 27 Oct 2004 12:42:58 +0200 Subject: Analysing load_session Message-ID: <20041027104258.GA15981@intevation.de> Hi, on a trip back from Bruxelles I yesterday implemeted a (second) try for concept to handle "missing" data while loading a session. Since nearly all stuff is implemented under Thuban/Model (where direct GUI stuff must be avoided) I implemented this in parallel to the db_connection_callback: A dialog comes up and lets the user specify a new path for the shapefile. This is implemeted in the SessionLoader.start_layer() method and works fine in principle. However, somewhere between the two methods for processing a layer SessionLoader.start_layer() and SessionLoader.end_layer() something else is going on, since I get: Exception exceptions.AttributeError: "DBFFile instance has no attribute 'thisown'" in ignored Does anybody know where this comes from or has an idea how I can track down the process of parsing the .thuban session file? Best regards, Frank -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.org/) From jan at intevation.de Wed Oct 27 12:47:00 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Wed, 27 Oct 2004 12:47:00 +0200 Subject: [Thuban-devel] Analysing load_session In-Reply-To: <20041027104258.GA15981@intevation.de> References: <20041027104258.GA15981@intevation.de> Message-ID: <20041027104700.GA29663@intevation.de> Hi Frank, can you send the patch you have to this ML so we can reproduce the problem? Thanks Jan On Wed, Oct 27, 2004 at 12:42:58PM +0200, Frank Koormann wrote: > on a trip back from Bruxelles I yesterday implemeted a (second) try for > concept to handle "missing" data while loading a session. Since nearly > all stuff is implemented under Thuban/Model (where direct GUI stuff must > be avoided) I implemented this in parallel to the db_connection_callback: > A dialog comes up and lets the user specify a new path for the shapefile. > > This is implemeted in the SessionLoader.start_layer() method and works > fine in principle. However, somewhere between the two methods for > processing a layer SessionLoader.start_layer() and SessionLoader.end_layer() > something else is going on, since I get: > > Exception exceptions.AttributeError: "DBFFile instance has no attribute > 'thisown'" in ignored > > Does anybody know where this comes from or has an idea how I can track > down the process of parsing the .thuban session file? -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bh at intevation.de Wed Oct 27 12:51:10 2004 From: bh at intevation.de (Bernhard Herzog) Date: Wed, 27 Oct 2004 12:51:10 +0200 Subject: Analysing load_session In-Reply-To: <20041027104258.GA15981@intevation.de> (Frank Koormann's message of "Wed, 27 Oct 2004 12:42:58 +0200") References: <20041027104258.GA15981@intevation.de> Message-ID: Frank Koormann writes: > on a trip back from Bruxelles I yesterday implemeted a (second) try for > concept to handle "missing" data while loading a session. [...] > Exception exceptions.AttributeError: "DBFFile instance has no attribute > 'thisown'" in ignored This means that there was an error when a DBFFile was instantiated. SWIG's wrapper objects have an instance variable 'thisown' which is set a little too late in __init__ so that it can happen that it's not set in __del__. In your case this probably comes from a missing DBF file since that's what you're trying to deal with. The message is pretty harmless in most cases. If we want to fix this properly we either need to use newer versions of SWIG or not use SWIG at all. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/ From frank.koormann at intevation.de Wed Oct 27 17:47:47 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Wed, 27 Oct 2004 17:47:47 +0200 Subject: Analysing load_session In-Reply-To: References: <20041027104258.GA15981@intevation.de> Message-ID: <20041027154747.GA23431@intevation.de> * Bernhard Herzog [041027 12:51]: > Frank Koormann writes: > > > on a trip back from Bruxelles I yesterday implemeted a (second) try for > > concept to handle "missing" data while loading a session. > [...] > > Exception exceptions.AttributeError: "DBFFile instance has no attribute > > 'thisown'" in ignored > > This means that there was an error when a DBFFile was instantiated. > SWIG's wrapper objects have an instance variable 'thisown' which is set > a little too late in __init__ so that it can happen that it's not set in > __del__. In your case this probably comes from a missing DBF file since > that's what you're trying to deal with. The message is pretty harmless > in most cases. Sounds reasonable. I try to load alternatives while catching exceptions from OpenShapefile(filename). So this leads to some garbage ... > If we want to fix this properly we either need to use newer versions of > SWIG or not use SWIG at all. We should give the first alternative a try if someone find some time. Frank -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.org/) From bh at intevation.de Wed Oct 27 17:57:09 2004 From: bh at intevation.de (Bernhard Herzog) Date: Wed, 27 Oct 2004 17:57:09 +0200 Subject: Analysing load_session In-Reply-To: <20041027154747.GA23431@intevation.de> (Frank Koormann's message of "Wed, 27 Oct 2004 17:47:47 +0200") References: <20041027104258.GA15981@intevation.de> <20041027154747.GA23431@intevation.de> Message-ID: Frank Koormann writes: > * Bernhard Herzog [041027 12:51]: >> If we want to fix this properly we either need to use newer versions of >> SWIG or not use SWIG at all. > > We should give the first alternative a try if someone find some time. This came up before, back in May: http://intevation.de/pipermail/thuban-devel/2004-May/000184.html Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/