From yaoheling at yahoo.com Wed Dec 1 09:50:42 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Wed, 1 Dec 2004 00:50:42 -0800 (PST) Subject: wxpython2.5 problem Message-ID: <20041201085042.52739.qmail@web40826.mail.yahoo.com> Hi, I'm using wxpython2.5.3 on debian unstable. I got thuban from cvs today, and python setup.py build works without a problem. However, when I try to run thuban, I got the following: Traceback (most recent call last): File "/usr/local/bin/thuban", line 20, in ? import Thuban.UI.main File "/usr/local//lib/thuban/Thuban/UI/main.py", line 18, in ? from application import ThubanApplication File "/usr/local//lib/thuban/Thuban/UI/application.py",line 33, in ? import view File "/usr/local//lib/thuban/Thuban/UI/view.py",line 40, in ? from renderer import ScreenRenderer, ExportRenderer, PrinterRenderer File "/usr/local//lib/thuban/Thuban/UI/renderer.py",line 29, in ? from Thuban.UI.classifier import ClassDataPreviewer File "/usr/local//lib/thuban/Thuban/UI/classifier.py",line 1505, in ? class ClassGroupPropertiesCtrl(wxWindow,wxControl): TypeError: Cannot create a consistent method resolution order (MRO) for bases Control,Window How do I correct this problem? On a sidenote, is there any plans to use wxpython2.5 (it's entered debian unstable as well) with thuban-cvs, maybe a new branch? Thanks, Joseph H. Yao __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail From joey at infodrom.org Wed Dec 1 10:43:19 2004 From: joey at infodrom.org (Martin Schulze) Date: Wed, 1 Dec 2004 10:43:19 +0100 Subject: wxpython2.5 problem In-Reply-To: <20041201085042.52739.qmail@web40826.mail.yahoo.com> References: <20041201085042.52739.qmail@web40826.mail.yahoo.com> Message-ID: <20041201094319.GR7329@finlandia.infodrom.north.de> Yao Heling wrote: > Hi, > > I'm using wxpython2.5.3 on debian unstable. I got > thuban from cvs today, and python setup.py build works > without a problem. However, when I try to run thuban, > I got the following: You'll need to set it up first. I've just tested this in a sid chroot with wxWidgets 2.5.3 installed and have thuban running. Cd into the main Thuban directory and run python setup.py install_local there (and/or see the README file). Regards, Joey -- Life is too short to run proprietary software. -- Bdale Garbee From yaoheling at yahoo.com Fri Dec 3 11:13:36 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Fri, 3 Dec 2004 02:13:36 -0800 (PST) Subject: wxpython2.5 problem Message-ID: <20041203101336.43391.qmail@web40827.mail.yahoo.com> On Wed, Dec 01, 2004 at 10:43:19AM +0100, Martin Schulze wrote: > > You'll need to set it up first. I've just tested this in a sid > chroot with wxWidgets 2.5.3 installed and have thuban running. > > Cd into the main Thuban directory and run > python setup.py install_local > there (and/or see the README file). > > Regards, > > Joey > I followed your instructions (python setup.py install_local) and got the same error, what could be wrong since you got it running? By the way, I uninstalled wxgtk2.4 and recompiled thuban just to be sure that's not the cause of the problem. Many thanks, Joseph __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail From bernhard at intevation.de Fri Dec 3 13:27:40 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Fri, 3 Dec 2004 13:27:40 +0100 Subject: wxpython2.5 problem In-Reply-To: <20041203101336.43391.qmail@web40827.mail.yahoo.com> References: <20041203101336.43391.qmail@web40827.mail.yahoo.com> Message-ID: <20041203122740.GD2773@intevation.de> Hi Heling, On Fri, Dec 03, 2004 at 02:13:36AM -0800, Yao Heling wrote: > On Wed, Dec 01, 2004 at 10:43:19AM +0100, Martin > Schulze wrote: > I followed your instructions (python setup.py > install_local) and got the same error, what could be > wrong since you got it running? > > By the way, I uninstalled wxgtk2.4 and recompiled > thuban just to be sure that's > not the cause of the problem. Does that mean you are getting the same problem with wxgtk2.4 (and wxpython2.4)? What compiler are you using in particular? Did you clean out all binaries when retrying with 2.4? -------------- 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/20041203/d46ab916/attachment.bin From yaoheling at yahoo.com Fri Dec 3 16:32:03 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Fri, 3 Dec 2004 07:32:03 -0800 (PST) Subject: wxpython2.5 problem Message-ID: <20041203153204.59413.qmail@web40809.mail.yahoo.com> > > Does that mean you are getting the same problem > with wxgtk2.4 (and wxpython2.4)? I didn't have wxpython2.4 installed, only had wxgtk2.4. Because of my the problems I ran into trying to use thuban cvs with wxpython2.5.3, I deleted wxgtk2.4. > What compiler are you using in particular? I am using gcc version 3.3.5 (Debian 1:3.3.5-2) and python 2.3.4. > Did you clean out all binaries when retrying with 2.4? I guess you mean 2.5? I never intend to run thuban cvs with wx2.4. (I like v2.5 much better). Well, I did python setup.py clean but found there are remaining so files under Lib dir, so I did a rm -rf build. Hope that's clean ;-) As Joey suggested, I'm attaching the logfile. Thank you for your help, Joseph H. Yao > _______________________________________________ > Thuban-devel mailing list > Thuban-devel at intevation.de > https://intevation.de/mailman/listinfo/thuban-devel __________________________________ Do you Yahoo!? Dress up your holiday email, Hollywood style. Learn more. http://celebrity.mail.yahoo.com -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: logfile Url: http://www.intevation.de/pipermail/thuban-devel/attachments/20041203/90d49a2c/logfile.txt From joey at infodrom.org Fri Dec 3 16:43:00 2004 From: joey at infodrom.org (Martin Schulze) Date: Fri, 3 Dec 2004 16:43:00 +0100 Subject: wxpython2.5 problem In-Reply-To: <20041203153204.59413.qmail@web40809.mail.yahoo.com> References: <20041203153204.59413.qmail@web40809.mail.yahoo.com> Message-ID: <20041203154300.GX7329@finlandia.infodrom.north.de> Yao Heling wrote: > > Did you clean out all binaries when retrying with > 2.4? > I guess you mean 2.5? I never intend to run thuban cvs > with wx2.4. (I > like v2.5 much better). > > Well, I did python setup.py clean but found there are > remaining so files > under Lib dir, so I did a rm -rf build. Hope that's > clean ;-) > > As Joey suggested, I'm attaching the logfile. That looks just usual and doesn't contain any compiler errors. After that you should be able to start Thuban from the same directory you executed the setup program with ./thuban.py. At least that worked for me (after I had wxpython2.5.3 installed and not wx*2.4. Regards, Joey -- Everybody talks about it, but nobody does anything about it! -- Mark Twain From cvs at intevation.de Sun Dec 5 16:03:46 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 5 Dec 2004 16:03:46 +0100 (CET) Subject: joey: thuban/Thuban/UI renderer.py,1.50,1.51 Message-ID: <20041205150346.E4BA0102C13@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv17040 Modified Files: renderer.py Log Message: Added PNG, TIFF and GIF as supported bitmap image formats (helpful for the WMS extension) Index: renderer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/renderer.py,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- renderer.py 17 Nov 2004 22:02:29 -0000 1.50 +++ renderer.py 5 Dec 2004 15:03:44 -0000 1.51 @@ -21,7 +21,8 @@ from wxPython.wx import wxPoint, wxRect, wxPen, wxBrush, wxFont, \ wxTRANSPARENT_PEN, wxTRANSPARENT_BRUSH, \ wxBLACK_PEN, wxBLACK, wxSOLID, wxCROSS_HATCH, wxSWISS, wxNORMAL, \ - wxBitmapFromImage, wxImageFromStream, wxBITMAP_TYPE_BMP, wxBITMAP_TYPE_JPEG + wxBitmapFromImage, wxImageFromStream, wxBITMAP_TYPE_BMP, \ + wxBITMAP_TYPE_JPEG, wxBITMAP_TYPE_PNG, wxBITMAP_TYPE_TIF, wxBITMAP_TYPE_GIF from wxproj import draw_polygon_shape, draw_polygon_init @@ -43,6 +44,9 @@ raster_format_map = { "BMP": wxBITMAP_TYPE_BMP, "JPEG": wxBITMAP_TYPE_JPEG, + "PNG": wxBITMAP_TYPE_PNG, + "TIFF": wxBITMAP_TYPE_TIF, + "GIF": wxBITMAP_TYPE_GIF, } class MapRenderer(BaseRenderer): From cvs at intevation.de Sun Dec 5 16:05:04 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 5 Dec 2004 16:05:04 +0100 (CET) Subject: joey: thuban ChangeLog,1.715,1.716 Message-ID: <20041205150504.4B40F102C17@lists.intevation.de> Author: joey Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv17072 Modified Files: ChangeLog Log Message: Added PNG, TIFF and GIF as supported bitmap image formats (helpful for the WMS extension) Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.715 retrieving revision 1.716 diff -u -d -r1.715 -r1.716 --- ChangeLog 30 Nov 2004 16:59:01 -0000 1.715 +++ ChangeLog 5 Dec 2004 15:05:02 -0000 1.716 @@ -1,3 +1,8 @@ +2004-12-05 Martin Schulze + + * Thuban/UI/renderer.py (raster_format_map): Added PNG, TIFF and + GIF as supported bitmap image formats (helpful for the WMS extension) + 2004-11-30 Martin Schulze * Extensions/wms/test/test_ogclib.py (TestOGCLib.test_compareURLs): From joey at infodrom.org Sun Dec 5 16:05:20 2004 From: joey at infodrom.org (Martin Schulze) Date: Sun, 5 Dec 2004 16:05:20 +0100 Subject: [Thuban-devel] Re: Support for bitmap image formats In-Reply-To: <20041130214212.GC16803@intevation.de> References: <20040410172407.GD1655@finlandia.infodrom.north.de> <20041115175731.GA1401@finlandia.infodrom.north.de> <20041130214212.GC16803@intevation.de> Message-ID: <20041205150520.GW7329@finlandia.infodrom.north.de> Jan-Oliver Wagner wrote: > > Hence, it should be fine to enable PNG, TIFF and GIF since they > > are supported on both Unix and Windows. > > I think the patch is good. > I don't see a reason why not apply it. Thanks, finally applied. Regards, Joey -- This is GNU/Linux Country. On a quiet night, you can hear Windows reboot. From yaoheling at yahoo.com Mon Dec 6 06:36:03 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Sun, 5 Dec 2004 21:36:03 -0800 (PST) Subject: wxpython2.5 problem Message-ID: <20041206053603.71157.qmail@web40828.mail.yahoo.com> On Fri, Dec 03, 2004 at 04:43:00PM +0100, Martin Schulze wrote: > That looks just usual and doesn't contain any compiler errors. > > After that you should be able to start Thuban from the same > directory you executed the setup program with ./thuban.py. At > least that worked for me (after I had wxpython2.5.3 installed and > not wx*2.4. I guest I've found where the problem is. I'm using python2.3.4, and which version of python do you use with thuban? The readme says python 2.2.1 is required, and I missed that part and assumed python 2.3 should be fine, but I was wrong. By the way, I don't think inheriting from a base class (wxWindow) and a subclass of the base class (wxControl) is a good thing (especially not in python 2.3 and above, see http://www.python.org/2.3/mro.html). Couldn't it be possible to inherit wxControl alone and achieve the same functionality? and are there any plans to use python 2.3 at all? It's been out so long. Regards, Joseph __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail From joey at infodrom.org Mon Dec 6 09:20:33 2004 From: joey at infodrom.org (Martin Schulze) Date: Mon, 6 Dec 2004 09:20:33 +0100 Subject: wxpython2.5 problem In-Reply-To: <20041206053603.71157.qmail@web40828.mail.yahoo.com> References: <20041206053603.71157.qmail@web40828.mail.yahoo.com> Message-ID: <20041206082032.GD7329@finlandia.infodrom.north.de> Yao Heling wrote: > I guest I've found where the problem is. I'm using > python2.3.4, and > which version of python do you use with thuban? The > readme says python > 2.2.1 is required, and I missed that part and assumed > python 2.3 should > be fine, but I was wrong. Since I was using a Debian sid chroot: pergolesi!joey(pts/0):/tmp/joey/thuban> dpkg -l python*|grep ^ii ii python 2.3.4-5 An interactive high-level object-oriented la ii python-dev 2.3.4-5 Header files and a static library for Python ii python-sqlite 1.0-2 Python interface to SQLite ii python2.3 2.3.4-18 An interactive high-level object-oriented la ii python2.3-dev 2.3.4-18 Header files and a static library for Python ii python2.3-sqli 1.0-2 Python interface to SQLite pergolesi!joey(pts/0):/tmp/joey/thuban> On that host it works as a charm. > By the way, I don't think inheriting from a base class > (wxWindow) and a > subclass of the base class (wxControl) is a good thing > (especially not > in python 2.3 and above, see To which part of the code are you referring? > http://www.python.org/2.3/mro.html). Couldn't > it be possible to inherit wxControl alone and achieve > the same > functionality? and are there any plans to use python > 2.3 at all? It's > been out so long. Like I said, it worked for me, which makes me wonder why it doesn't for you. Also, at home I already use Python 2.3 from sid (but together with wxWidgets 2.4) to run Thuban, so it does already work with 2.3. Regards, Joey -- The MS-DOS filesystem is nice for removable media. -- H. Peter Anvin From yaoheling at yahoo.com Tue Dec 7 07:21:28 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Mon, 6 Dec 2004 22:21:28 -0800 (PST) Subject: [root: Re: wxpython2.5 problem] Message-ID: <20041207062128.54260.qmail@web40812.mail.yahoo.com> Sorry, I forgot to cc the list. Here it goes. Date: Mon, 6 Dec 2004 23:09:37 +0000 To: Martin Schulze Subject: Re: wxpython2.5 problem User-Agent: Mutt/1.5.6+20040907i On Mon, Dec 06, 2004 at 09:20:33AM +0100, Martin Schulze wrote: > Yao Heling wrote: > > I guest I've found where the problem is. I'm using > > python2.3.4, and > > which version of python do you use with thuban? The > > readme says python > > 2.2.1 is required, and I missed that part and assumed > > python 2.3 should > > be fine, but I was wrong. > > Since I was using a Debian sid chroot: > > pergolesi!joey(pts/0):/tmp/joey/thuban> dpkg -l python*|grep ^ii > ii python 2.3.4-5 An interactive high-level object-oriented la > ii python-dev 2.3.4-5 Header files and a static library for Python > ii python-sqlite 1.0-2 Python interface to SQLite > ii python2.3 2.3.4-18 An interactive high-level object-oriented la > ii python2.3-dev 2.3.4-18 Header files and a static library for Python > ii python2.3-sqli 1.0-2 Python interface to SQLite > pergolesi!joey(pts/0):/tmp/joey/thuban> > > On that host it works as a charm. > I'm glad that python 2.3 is supported. > > By the way, I don't think inheriting from a base class > > (wxWindow) and a > > subclass of the base class (wxControl) is a good thing > > (especially not > > in python 2.3 and above, see > > To which part of the code are you referring? see my original post in this thread: http://intevation.de/pipermail/thuban-devel/2004-December/000652.html i.e. class ClassGroupPropertiesCtrl(wxWindow,wxControl) in Thuban/UI/classifier.py (line 1505) That's the code causing problems. > > http://www.python.org/2.3/mro.html). Couldn't > > it be possible to inherit wxControl alone and achieve > > the same > > functionality? and are there any plans to use python > > 2.3 at all? It's > > been out so long. > > Like I said, it worked for me, which makes me wonder why it doesn't > for you. > > Also, at home I already use Python 2.3 from sid (but together with > wxWidgets 2.4) to run Thuban, so it does already work with 2.3. > From bernhard at intevation.de Tue Dec 7 12:05:22 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 7 Dec 2004 12:05:22 +0100 Subject: Python 2.3 and Thuban In-Reply-To: <20041206082032.GD7329@finlandia.infodrom.north.de> References: <20041206053603.71157.qmail@web40828.mail.yahoo.com> <20041206082032.GD7329@finlandia.infodrom.north.de> Message-ID: <20041207110522.GB5359@intevation.de> On Mon, Dec 06, 2004 at 09:20:33AM +0100, Martin Schulze wrote: > Yao Heling wrote: > > and are there any plans to use python > > 2.3 at all? It's > > been out so long. > > Like I said, it worked for me, which makes me wonder why it doesn't > for you. > > Also, at home I already use Python 2.3 from sid (but together with > wxWidgets 2.4) to run Thuban, so it does already work with 2.3. I can also confirm that Thuban (both 1.0.0 from Debian and CVS) works with Python 2.3 on the powerpc. Bernhard -------------- 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/20041207/89c2a513/attachment.bin From bernhard at intevation.de Tue Dec 7 12:13:33 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 7 Dec 2004 12:13:33 +0100 Subject: svgexport tests not run from runtests In-Reply-To: <20041124225614.GA31112@intevation.de> References: <20041124162131.GC12394@intevation.de> <20041124225614.GA31112@intevation.de> Message-ID: <20041207111333.GC5359@intevation.de> On Wed, Nov 24, 2004 at 11:56:14PM +0100, Jan-Oliver Wagner wrote: > On Wed, Nov 24, 2004 at 05:21:31PM +0100, Bernhard Reiter wrote: > > what about reverting the changes you have made until tests work > > again in CVS so we get a state we can develop at the other parts. > > just put enough pressure on me and I'll fix it right away ;-) > > Fixed and in CVS. Just found out that cd test ; python runtests.py does not run the svgexport tests anymore. Only 511 tests are run, the 16 from test_svgmapwriter.py are not run. python runtests.py -v >testlog-20041206 2>&1 grep -i svg testlog-20041206 | wc 0 0 0 The tests is found, but not run, this is how far I have inquired: cd test; python Python 2.3.4 (#2, Sep 24 2004, 08:49:23) [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import unittest >>> import runtests >>> n=runtests.find_test_modules("../Extensions/svgexport/test","Extensions.svgexport.test") >>> n ['Extensions.svgexport.test.test_svgmapwriter'] >>> suite = unittest.defaultTestLoader.loadTestsFromNames(n) >>> suite ]> So tests are not fully fixed yet. -------------- 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/20041207/608978e9/attachment.bin From cvs at intevation.de Tue Dec 7 12:19:40 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 12:19:40 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.716,1.717 Message-ID: <20041207111940.4E5D5102C05@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv16793 Modified Files: ChangeLog Log Message: svgexport 0.9.1, implemented DrawSpline: * Extensions/svgexport/test/test_svgmapwriter.py: Added test_drawbezier() to test DrawSpline(). * Extensions/svgexport/svgmapwriter.py(DrawSpline): Really implemented bezier drawing. * Extensions/svgexport/__init__.py: Bumped version of svgexport to 0.9.1 because now the legend examples lines styles will be drawing with beziers. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.716 retrieving revision 1.717 diff -u -d -r1.716 -r1.717 --- ChangeLog 5 Dec 2004 15:05:02 -0000 1.716 +++ ChangeLog 7 Dec 2004 11:19:38 -0000 1.717 @@ -1,3 +1,15 @@ +2004-12-07 Bernhard Reiter + + * Extensions/svgexport/test/test_svgmapwriter.py: + Added test_drawbezier() to test DrawSpline(). + + * Extensions/svgexport/svgmapwriter.py(DrawSpline): + Really implemented bezier drawing. + + * Extensions/svgexport/__init__.py: Bumped version of svgexport + to 0.9.1 because now the legend examples lines styles + will be drawing with beziers. + 2004-12-05 Martin Schulze * Thuban/UI/renderer.py (raster_format_map): Added PNG, TIFF and From cvs at intevation.de Tue Dec 7 12:19:40 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 12:19:40 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport __init__.py, 1.4, 1.5 svgmapwriter.py, 1.7, 1.8 Message-ID: <20041207111940.49E0A102C03@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv16793/Extensions/svgexport Modified Files: __init__.py svgmapwriter.py Log Message: svgexport 0.9.1, implemented DrawSpline: * Extensions/svgexport/test/test_svgmapwriter.py: Added test_drawbezier() to test DrawSpline(). * Extensions/svgexport/svgmapwriter.py(DrawSpline): Really implemented bezier drawing. * Extensions/svgexport/__init__.py: Bumped version of svgexport to 0.9.1 because now the legend examples lines styles will be drawing with beziers. Index: __init__.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- __init__.py 27 Nov 2004 20:22:38 -0000 1.4 +++ __init__.py 7 Dec 2004 11:19:38 -0000 1.5 @@ -24,7 +24,7 @@ ext_registry.add(ExtensionDesc( name = 'SVGexport', - version = '0.9.0', + version = '0.9.1', authors= [ 'Markus Rechtien', 'Bernhard Reiter' ], copyright = '2004 Intevation GmbH', desc = _("Export the current map and legend in Thuban-map-SVG format."))) Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- svgmapwriter.py 22 Nov 2004 11:17:47 -0000 1.7 +++ svgmapwriter.py 7 Dec 2004 11:19:38 -0000 1.8 @@ -699,19 +699,24 @@ # Put everything together and write it to the file self.file.write('%s %s d="%s"/>\n' % (self.make_id(), self.make_meta(), join(data, '') ) ) - + def DrawSpline(self, points, closed=0): """Draw a spline object. """ - self.DrawPolygon(points, 0) - print "TODO: DrawSpline(..)" - return # TODO: Implement + self.write_indent('\n' % (self.make_id(), + self.make_meta(), datastr ) ) def BeginClipPath(self, id): """Build a clipping region to draw in.""" self.write_indent('\n' % id) self.indent_level += 1 - + def EndClipPath(self): """End a clip path.""" self.indent_level -= 1 From cvs at intevation.de Tue Dec 7 12:19:40 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 12:19:40 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10 Message-ID: <20041207111940.4FE41102C06@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv16793/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: svgexport 0.9.1, implemented DrawSpline: * Extensions/svgexport/test/test_svgmapwriter.py: Added test_drawbezier() to test DrawSpline(). * Extensions/svgexport/svgmapwriter.py(DrawSpline): Really implemented bezier drawing. * Extensions/svgexport/__init__.py: Bumped version of svgexport to 0.9.1 because now the legend examples lines styles will be drawing with beziers. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- test_svgmapwriter.py 27 Nov 2004 20:22:38 -0000 1.9 +++ test_svgmapwriter.py 7 Dec 2004 11:19:38 -0000 1.10 @@ -161,6 +161,25 @@ self.assertEquals(xmlsupport.sax_eventlist(data = data), xmlsupport.sax_eventlist(data = file.getvalue())) + def test_drawbezier(self): + '''Test DrawSpline (which actually draws bezier curves).''' + data = ('') + file = StringIO.StringIO() + dc = VirtualDC(file) + dc.SetPen(self.solid_pen) + dc.SetMeta(self.meta) + dc.SetBrush(self.trans_brush) + dc.DrawSpline([ Point(10, 10), + Point(15, 12), + Point(15, 8.0), + Point(20, 10) ]) + #print file.getvalue() + self.assertEquals(xmlsupport.sax_eventlist(data = data), + xmlsupport.sax_eventlist(data = file.getvalue())) + def test_text(self): '''Set drawing properties and draw a circle''' data = (' Message-ID: A non-text attachment was scrubbed... Name: thuban-classifier.diff Type: text/x-patch Size: 967 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041207/2fb10467/thuban-classifier.diff From bernhard at intevation.de Tue Dec 7 12:27:51 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 7 Dec 2004 12:27:51 +0100 Subject: Shapefile tests: createholeexamples.py Message-ID: <20041207112751.GF5359@intevation.de> It occurred to me that we should have a set of test shapefiles with the various cases with holes for Thuban. They should only display one difficulty at a time. Probably some test shapefile compilations already exist, but I did not have the time to search for existing sets yet. (Does anybody know some?) Together with Silke I just created a small script using python ogr. It is attached, also a screenshot with Thuban showing the output. Where would be put this in Thuban's cvs? Bernhard -------------- next part -------------- """ Create example shapefiles with ogr. Thanks to Silke Reimer. """ import ogr driver = ogr.GetDriverByName("ESRI Shapefile") ds = driver.CreateDataSource('holetest') # A polygone with a hole layer = ds.CreateLayer( 'rect_in_rect' ) feature = ogr.Feature( layer.GetLayerDefn() ) geom = 'POLYGON((0 0,0 2, 2 2, 2 0, 0 0),(1 1, 0.5 1, 0.5 0.5, 1 0.5, 1 1))' geometry = ogr.CreateGeometryFromWkt(geom) feature.SetGeometry(geometry) layer.CreateFeature(feature) # A polygone with a hole and an island in the hole layer = ds.CreateLayer( 'rect_in_rect_in_rect' ) feature = ogr.Feature( layer.GetLayerDefn() ) geom = ('POLYGON((10 0,10 2, 12 2, 12 0, 10 0)' ',(11 1, 10.5 1, 10.5 0.5, 11 0.5, 11 1)' ',(10.75 0.75, 10.75 0.85, 10.85 0.85 , 10.85 0.75, 10.75 0.75) ' ')') geometry = ogr.CreateGeometryFromWkt(geom) feature.SetGeometry(geometry) layer.CreateFeature(feature) # A polygone with two holes and one island in the first hole layer = ds.CreateLayer( 'two_holes_one_with_island' ) feature = ogr.Feature( layer.GetLayerDefn() ) geom = ('POLYGON((0 10,0 12, 2 12, 2 10, 0 10)' ',(1 11, 0.5 11, 0.5 10.5, 1 10.5, 1 11)' ',(0.75 10.75, 0.75 10.85, 0.85 10.85 , 0.85 10.75, 0.75 10.75)' ',(1.25 11.25, 1.25 11.35, 1.35 11.35, 1.35 11.25, 1.25 11.25)' ' )') geometry = ogr.CreateGeometryFromWkt(geom) feature.SetGeometry(geometry) layer.CreateFeature(feature) ds.Destroy() -------------- next part -------------- A non-text attachment was scrubbed... Name: thuban-shapeholeexamples-20041207.png Type: image/png Size: 13805 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041207/587eca0e/thuban-shapeholeexamples-20041207.png -------------- 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/20041207/587eca0e/attachment.bin From bh at intevation.de Tue Dec 7 12:37:52 2004 From: bh at intevation.de (Bernhard Herzog) Date: Tue, 07 Dec 2004 12:37:52 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10 In-Reply-To: <20041207111940.4FE41102C06@lists.intevation.de> (cvs@intevation.de's message of "Tue, 7 Dec 2004 12:19:40 +0100 (CET)") References: <20041207111940.4FE41102C06@lists.intevation.de> Message-ID: cvs at intevation.de writes: > + def test_drawbezier(self): > + '''Test DrawSpline (which actually draws bezier curves).''' > + data = (' + 'meta="Object:test; Label:nothing" d="M 10 10 ' > + 'C 15 12 15 8.0 20 10"/>') > + file = StringIO.StringIO() > + dc = VirtualDC(file) > + dc.SetPen(self.solid_pen) > + dc.SetMeta(self.meta) > + dc.SetBrush(self.trans_brush) > + dc.DrawSpline([ Point(10, 10), > + Point(15, 12), > + Point(15, 8.0), > + Point(20, 10) ]) Looking at the DrawSpline code in wxWidgets, it seems that the coordinates of the spline do not translate directly to the coordinates of the control points of a cubic bezier curve as you assume here. Rather a cubic bezier curve derived in some other fashion from the parameters to DrawSpline. The docs say that the algorithm was taken from XFig, so I'd assume it's what XFig <= 3.1 calls interpolated splines. I have no time to analyse this further, though. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From bernhard at intevation.de Tue Dec 7 12:44:59 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 7 Dec 2004 12:44:59 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10 In-Reply-To: References: <20041207111940.4FE41102C06@lists.intevation.de> Message-ID: <20041207114459.GH5359@intevation.de> On Tue, Dec 07, 2004 at 12:37:52PM +0100, Bernhard Herzog wrote: > cvs at intevation.de writes: > > > + def test_drawbezier(self): > > + '''Test DrawSpline (which actually draws bezier curves).''' > > + data = (' > + 'meta="Object:test; Label:nothing" d="M 10 10 ' > > + 'C 15 12 15 8.0 20 10"/>') > > + file = StringIO.StringIO() > > + dc = VirtualDC(file) > > + dc.SetPen(self.solid_pen) > > + dc.SetMeta(self.meta) > > + dc.SetBrush(self.trans_brush) > > + dc.DrawSpline([ Point(10, 10), > > + Point(15, 12), > > + Point(15, 8.0), > > + Point(20, 10) ]) > > Looking at the DrawSpline code in wxWidgets, it seems that the > coordinates of the spline do not translate directly to the coordinates > of the control points of a cubic bezier curve as you assume here. Ah, thanks for noticing this. So it is broken until I understand this better and can fix it. > Rather a cubic bezier curve derived in some other fashion from the > parameters to DrawSpline. The docs say that the algorithm was taken > from XFig, so I'd assume it's what XFig <= 3.1 calls interpolated > splines. I have no time to analyse this further, though. Thanks for the hints. -------------- 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/20041207/33576112/attachment.bin From bernhard at intevation.de Tue Dec 7 12:49:16 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 7 Dec 2004 12:49:16 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10 In-Reply-To: <20041207114459.GH5359@intevation.de> References: <20041207111940.4FE41102C06@lists.intevation.de> <20041207114459.GH5359@intevation.de> Message-ID: <20041207114916.GI5359@intevation.de> On Tue, Dec 07, 2004 at 12:44:59PM +0100, Bernhard Reiter wrote: > On Tue, Dec 07, 2004 at 12:37:52PM +0100, Bernhard Herzog wrote: > > cvs at intevation.de writes: > > > > > + def test_drawbezier(self): > > > + '''Test DrawSpline (which actually draws bezier curves).''' > > > + data = (' > > + 'meta="Object:test; Label:nothing" d="M 10 10 ' > > > + 'C 15 12 15 8.0 20 10"/>') > > > + dc.DrawSpline([ Point(10, 10), > > > + Point(15, 12), > > > + Point(15, 8.0), > > > + Point(20, 10) ]) > > > > Looking at the DrawSpline code in wxWidgets, it seems that the > > coordinates of the spline do not translate directly to the coordinates > > of the control points of a cubic bezier curve as you assume here. > > Ah, thanks for noticing this. > So it is broken until I understand this better and can fix it. > > > Rather a cubic bezier curve derived in some other fashion from the > > parameters to DrawSpline. The docs say that the algorithm was taken > > from XFig, so I'd assume it's what XFig <= 3.1 calls interpolated > > splines. The wx docs also say that DrawSpline takes only three coordinates, but Thuban/UI/classifier.py gives four arguments. -------------- 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/20041207/7a654748/attachment.bin From bh at intevation.de Tue Dec 7 12:50:49 2004 From: bh at intevation.de (Bernhard Herzog) Date: Tue, 07 Dec 2004 12:50:49 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10 In-Reply-To: <20041207114459.GH5359@intevation.de> (Bernhard Reiter's message of "Tue, 7 Dec 2004 12:44:59 +0100") References: <20041207111940.4FE41102C06@lists.intevation.de> <20041207114459.GH5359@intevation.de> Message-ID: Bernhard Reiter writes: > On Tue, Dec 07, 2004 at 12:37:52PM +0100, Bernhard Herzog wrote: >> Looking at the DrawSpline code in wxWidgets, it seems that the >> coordinates of the spline do not translate directly to the coordinates >> of the control points of a cubic bezier curve as you assume here. > > Ah, thanks for noticing this. > So it is broken until I understand this better and can fix it. The code in wxWidgets/src/generic/dcpsg.cpp is probably a good start for further analysis since it determines the parameters for the postscript curveto operator from the DrawSpline parameters. It does that partly in C++ and partly in postscript. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From bh at intevation.de Tue Dec 7 13:00:04 2004 From: bh at intevation.de (Bernhard Herzog) Date: Tue, 07 Dec 2004 13:00:04 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10 In-Reply-To: <20041207114916.GI5359@intevation.de> (Bernhard Reiter's message of "Tue, 7 Dec 2004 12:49:16 +0100") References: <20041207111940.4FE41102C06@lists.intevation.de> <20041207114459.GH5359@intevation.de> <20041207114916.GI5359@intevation.de> Message-ID: Bernhard Reiter writes: > The wx docs also say that > DrawSpline takes only three coordinates, but > Thuban/UI/classifier.py gives four arguments. The docs are probably a bit incomplete. There are three versions of DrawSpline in dc.h: void DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord x3, wxCoord y3); void DrawSpline(int n, wxPoint points[]); void DrawSpline(wxList *points); wxPython uses the second one AFAICT. The second and the third both support any number of points >= 3 apparently. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From yaoheling at yahoo.com Tue Dec 7 13:29:40 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Tue, 7 Dec 2004 04:29:40 -0800 (PST) Subject: [root: Re: wxpython2.5 problem] Message-ID: <20041207122940.55201.qmail@web40801.mail.yahoo.com> On Tue, Dec 07, 2004 at 12:19:47PM +0100, Bernhard Herzog wrote: > > I have no idea why ClassGroupPropertiesCtrl is derived from both > wxWindow and wxControl. As you say, wxControl should suffice. > > Here's a patch that fixes it. It works fine for me, but I don't have a > 2.5 installation to test this with, so please give it a try. If it > works for you as well, I'll check it in later. > Thanks for the patch. It does get rid of the MRO error, but another error pops up: An unhandled exception occurred: wxWindow, wxSizer, wxSize, or (w,h) expected for item (please report to http://thuban.intevation.org/bugtracker.html) Traceback (most recent call last): File "./thuban.py", line 23, in ? Thuban.UI.main.main() File "/root/src/cvs/thuban/thuban/Thuban/UI/main.py", line 31, in main app = ThubanApplication(0) File "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", line 5311, in __init__ self._BootstrapApp() File "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", line 4990, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "/root/src/cvs/thuban/thuban/Thuban/UI/application.py", line 73, in OnInit self.top = self.CreateMainWindow() File "/root/src/cvs/thuban/thuban/Thuban/UI/application.py", line 161, in CreateMainWindow size = (600, 400)) File "/root/src/cvs/thuban/thuban/Thuban/UI/mainwindow.py", line 115, in __init__ self.ShowLegend() File "/root/src/cvs/thuban/thuban/Thuban/UI/mainwindow.py", line 757, in ShowLegend self.ToggleLegend() File "/root/src/cvs/thuban/thuban/Thuban/UI/mainwindow.py", line 766, in ToggleLegend legend.LegendPanel(dialog, None, self) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 128, in __init__ self.Create() File "/root/src/cvs/thuban/thuban/Thuban/UI/dock.py", line 61, in Create self.parent.SetPanel(self) File "/root/src/cvs/thuban/thuban/Thuban/UI/dock.py", line 145, in SetPanel self.__CreateBorder() File "/root/src/cvs/thuban/thuban/Thuban/UI/dock.py", line 378, in __CreateBorder headerBox.Add(1, 5, 1, wxGROW) File "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", line 9154, in Add return _core_.Sizer_Add(*args, **kwargs) TypeError: wxWindow, wxSizer, wxSize, or (w,h) expected for item As everyone seems to have thuban running, what's the problem? I'm using the stock wxpython2.5.3 on debian sid, could that be a source of error? Does the above code have bugs? Thanks very much, Joseph __________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail From cvs at intevation.de Tue Dec 7 15:00:14 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 15:00:14 +0100 (CET) Subject: jan: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.10, 1.11 Message-ID: <20041207140014.6E364102C05@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv23820 Modified Files: test_svgmapwriter.py Log Message: Reverting part of a (non-)fix to renable that the tests are always executed. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- test_svgmapwriter.py 7 Dec 2004 11:19:38 -0000 1.10 +++ test_svgmapwriter.py 7 Dec 2004 14:00:12 -0000 1.11 @@ -19,20 +19,17 @@ import StringIO import unittest -# If run directly as a script, add Thuban's test directory to the path -# as well as the extensions own directory (i.e. parent). +# If run directly as a script, add Thuban's test directory to the path. # Otherwise we assume that the importing code has already done it. if __name__ == "__main__": sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "..", "..", "..", "test")) - sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), - "..")) from mockgeo import SimpleShapeStore import support support.initthuban() # Now import needed SVG stuff -from svgmapwriter import VirtualDC, \ +from Extensions.svgexport.svgmapwriter import VirtualDC, \ Pen, Brush, SOLID, Point, Font, TRANSPARENT_PEN, TRANSPARENT_BRUSH, \ SVGRenderer, SVGMapWriterError # Color related classes from the model of thuban From bh at intevation.de Tue Dec 7 15:03:45 2004 From: bh at intevation.de (Bernhard Herzog) Date: Tue, 07 Dec 2004 15:03:45 +0100 Subject: [root: Re: wxpython2.5 problem] References: <20041207122940.55201.qmail@web40801.mail.yahoo.com> Message-ID: Yao Heling writes: > File "/root/src/cvs/thuban/thuban/Thuban/UI/dock.py", line 378, in __CreateBorder > headerBox.Add(1, 5, 1, wxGROW) This should read as follows: headerBox.Add((1, 5), 1, wxGROW) AFAICT from the wxPython sources, even in wxPython 2.4, the form currently used in Thuban is only supported for backwards compatibility. Apparently support for it was removed in 2.5. The attached patch contains the necessary change. Again, if it works for you with 2.5 I'll apply it later. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From bh at intevation.de Tue Dec 7 15:04:58 2004 From: bh at intevation.de (Bernhard Herzog) Date: Tue, 07 Dec 2004 15:04:58 +0100 Subject: [root: Re: wxpython2.5 problem] In-Reply-To: (Bernhard Herzog's message of "Tue, 07 Dec 2004 15:03:45 +0100") References: <20041207122940.55201.qmail@web40801.mail.yahoo.com> Message-ID: A non-text attachment was scrubbed... Name: thuban-dock.diff Type: text/x-patch Size: 701 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041207/bd3822ce/thuban-dock.diff From cvs at intevation.de Tue Dec 7 15:05:37 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 15:05:37 +0100 (CET) Subject: jan: thuban ChangeLog,1.717,1.718 Message-ID: <20041207140537.BF03D102C05@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv23942 Modified Files: ChangeLog Log Message: make global tests run local tests of svgexport extension again. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.717 retrieving revision 1.718 diff -u -d -r1.717 -r1.718 --- ChangeLog 7 Dec 2004 11:19:38 -0000 1.717 +++ ChangeLog 7 Dec 2004 14:05:35 -0000 1.718 @@ -1,3 +1,9 @@ +2004-12-07 Jan-Oliver Wagner + + * /Extensions/svgexport/test/test_svgmapwriter.py: Reverting + part of a (non-)fix to renable that the tests are always + executed. + 2004-12-07 Bernhard Reiter * Extensions/svgexport/test/test_svgmapwriter.py: From bernhard at intevation.de Tue Dec 7 15:24:58 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 7 Dec 2004 15:24:58 +0100 Subject: Tests work again! In-Reply-To: <20041207140537.BF03D102C05@lists.intevation.de> References: <20041207140537.BF03D102C05@lists.intevation.de> Message-ID: <20041207142458.GB11558@intevation.de> On Tue, Dec 07, 2004 at 03:05:37PM +0100, cvs at intevation.de wrote: > Author: jan > make global tests run local tests of svgexport extension again. Yes, it works again now! Thanks. -------------- 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/20041207/72b259f3/attachment.bin From yaoheling at yahoo.com Tue Dec 7 15:26:03 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Tue, 7 Dec 2004 06:26:03 -0800 (PST) Subject: [root: Re: wxpython2.5 problem] Message-ID: <20041207142603.68512.qmail@web40824.mail.yahoo.com> On Tue, Dec 07, 2004 at 03:03:45PM +0100, Bernhard Herzog wrote: > AFAICT from the wxPython sources, even in wxPython 2.4, the form > currently used in Thuban is only supported for backwards compatibility. > Apparently support for it was removed in 2.5. > > The attached patch contains the necessary change. Again, if it works > for you with 2.5 I'll apply it later. > Thanks! This change removed the orginal error, but I got another. It makes wonder how come the others can use thuban with wxpython2.3, could someone pls shed some light on this? The error msgs are: An unhandled exception occurred: TreeCtrl_GetFirstChild() takes exactly 2 arguments (3 given) (please report to http://thuban.intevation.org/bugtracker.html) Traceback (most recent call last): File "./thuban.py", line 23, in ? Thuban.UI.main.main() File "/root/src/cvs/thuban/thuban/Thuban/UI/main.py", line 31, in main app = ThubanApplication(0) File "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", line 5311, in __init__ self._BootstrapApp() File "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", line 4990, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File "/root/src/cvs/thuban/thuban/Thuban/UI/application.py", line 76, in OnInit self.maps_changed() File "/root/src/cvs/thuban/thuban/Thuban/UI/application.py", line 279, in maps_changed self.top.SetMap(self.session.Maps()[0]) File "/root/src/cvs/thuban/thuban/Thuban/UI/mainwindow.py", line 456, in SetMap dialog.GetPanel().SetMap(self.Map()) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 137, in SetMap self.tree.SetMap(map) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 325, in SetMap self.__FillTree(self.map) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 539, in __FillTree self.DeleteAllItems() File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 601, in DeleteAllItems id, cookie = self.GetFirstChild(pid, 123) File "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_controls.py", line 5215, in GetFirstChild return _controls_.TreeCtrl_GetFirstChild(*args, **kwargs) TypeError: TreeCtrl_GetFirstChild() takes exactly 2 arguments (3 given) Thanks, Joseph __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail From bh at intevation.de Tue Dec 7 16:07:02 2004 From: bh at intevation.de (Bernhard Herzog) Date: Tue, 07 Dec 2004 16:07:02 +0100 Subject: [root: Re: wxpython2.5 problem] In-Reply-To: <20041207142603.68512.qmail@web40824.mail.yahoo.com> (Yao Heling's message of "Tue, 7 Dec 2004 06:26:03 -0800 (PST)") References: <20041207142603.68512.qmail@web40824.mail.yahoo.com> Message-ID: A non-text attachment was scrubbed... Name: thuban-legend.diff Type: text/x-patch Size: 3218 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041207/b3db6e40/thuban-legend.diff From yaoheling at yahoo.com Tue Dec 7 17:14:17 2004 From: yaoheling at yahoo.com (Yao Heling) Date: Tue, 7 Dec 2004 08:14:17 -0800 (PST) Subject: [root: Re: wxpython2.5 problem] Message-ID: <20041207161417.42662.qmail@web40823.mail.yahoo.com> On Tue, Dec 07, 2004 at 04:07:02PM +0100, Bernhard Herzog wrote: > Yao Heling writes: > > > File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 601, in DeleteAllItems > > id, cookie = self.GetFirstChild(pid, 123) > > > Now it's become a bit trickier. The second argument there is not really > needed in 2.4 either, but due to a bug in the C++ code of wxPython > omitting it leads to a segfault. So we can't simply remove it. > However, it's not difficult to work around that too. See patch. Again > please try it with 2.5 as well. With this patch I can finally see the thuban window. But when I try Map -> Add Layer -> select Data/iceland/political.shp and it seg faults. Messages below: No thubanstart module available Warning: .MAP_LAYERS_ADDED: >() Traceback (most recent call last): File "/root/src/cvs/thuban/thuban/Thuban/Lib/connector.py", line 92, in Issue apply(func, args + fargs) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 500, in _OnMsgMapLayersAdded self.__AddLayer(i, l) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 619, in __AddLayer self.__FillTreeLayer(id) File "/root/src/cvs/thuban/thuban/Thuban/UI/legend.py", line 582, in __FillTreeLayer self.SetItemSelectedImage(id, i) AttributeError: 'LegendTree' object has no attribute 'SetItemSelectedImage' (thuban.py:4480): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer (thuban.py:4480): GLib-GObject-CRITICAL **: file gsignal.c: line 1968 (g_signal_handlers_disconnect_matched): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (thuban.py:4480): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `' (thuban.py:4480): GLib-GObject-CRITICAL **: file gsignal.c: line 1968 (g_signal_handlers_disconnect_matched): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (thuban.py:4480): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)' (thuban.py:4480): GLib-GObject-CRITICAL **: file gsignal.c: line 1968 (g_signal_handlers_disconnect_matched): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed segmentation fault Thanks, Joseph __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From cvs at intevation.de Tue Dec 7 17:15:21 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 17:15:21 +0100 (CET) Subject: nhueffme: thuban/Extensions/ogr - New directory Message-ID: <20041207161521.7B53F102C44@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/Extensions/ogr In directory doto:/tmp/cvs-serv25734/Extensions/ogr Log Message: Directory /thubanrepository/thuban/Extensions/ogr added to the repository From cvs at intevation.de Tue Dec 7 17:16:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 17:16:59 +0100 (CET) Subject: nhueffme: thuban/Extensions/ogr/test - New directory Message-ID: <20041207161659.1E6CB102C44@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/Extensions/ogr/test In directory doto:/tmp/cvs-serv25770/Extensions/ogr/test Log Message: Directory /thubanrepository/thuban/Extensions/ogr/test added to the repository From cvs at intevation.de Tue Dec 7 17:44:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 17:44:53 +0100 (CET) Subject: nhueffme: thuban/Extensions/ogr ogrshapes.py, NONE, 1.1 ogrstart.py, NONE, 1.1 Message-ID: <20041207164453.B79B5102C51@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/Extensions/ogr In directory doto:/tmp/cvs-serv26267/Extensions/ogr Added Files: ogrshapes.py ogrstart.py Log Message: Adding a new extension to read shapefiles with ogr. It is planned to add other vector formats. --- NEW FILE: ogrshapes.py --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ogrstart.py --- (This appears to be a binary file; contents omitted.) From cvs at intevation.de Tue Dec 7 17:44:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 17:44:53 +0100 (CET) Subject: nhueffme: thuban/Extensions/ogr/test __init__.py, NONE, 1.1 test_OGRShapestore.py, NONE, 1.1 Message-ID: <20041207164453.BD42D102C56@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/Extensions/ogr/test In directory doto:/tmp/cvs-serv26267/Extensions/ogr/test Added Files: __init__.py test_OGRShapestore.py Log Message: Adding a new extension to read shapefiles with ogr. It is planned to add other vector formats. --- NEW FILE: __init__.py --- (This appears to be a binary file; contents omitted.) --- NEW FILE: test_OGRShapestore.py --- (This appears to be a binary file; contents omitted.) From cvs at intevation.de Tue Dec 7 17:44:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 17:44:53 +0100 (CET) Subject: nhueffme: thuban/test runtests.py,1.14,1.15 Message-ID: <20041207164453.C0534102C58@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv26267/test Modified Files: runtests.py Log Message: Adding a new extension to read shapefiles with ogr. It is planned to add other vector formats. Index: runtests.py =================================================================== RCS file: /thubanrepository/thuban/test/runtests.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- runtests.py 20 Feb 2004 14:29:13 -0000 1.14 +++ runtests.py 7 Dec 2004 16:44:51 -0000 1.15 @@ -94,7 +94,8 @@ names = find_test_modules(".") names += find_test_modules("../Extensions/svgexport/test", "Extensions.svgexport.test") - + names += find_test_modules("../Extensions/ogr/test", + "Extensions.ogr.test") suite = unittest.defaultTestLoader.loadTestsFromNames(names) runner = support.ThubanTestRunner(verbosity = verbosity) result = support.execute_as_testsuite(runner.run, suite) From cvs at intevation.de Tue Dec 7 17:44:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Tue, 7 Dec 2004 17:44:53 +0100 (CET) Subject: nhueffme: thuban ChangeLog,1.718,1.719 Message-ID: <20041207164453.BEC78102C57@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv26267 Modified Files: ChangeLog Log Message: Adding a new extension to read shapefiles with ogr. It is planned to add other vector formats. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.718 retrieving revision 1.719 diff -u -d -r1.718 -r1.719 --- ChangeLog 7 Dec 2004 14:05:35 -0000 1.718 +++ ChangeLog 7 Dec 2004 16:44:51 -0000 1.719 @@ -1,3 +1,10 @@ +2004-12-07 Nina Hüffmeyer + + * /Extensions/ogr/: Adding a new extension to read shapefiles with + ogr. It is planned to add other vector formats. + + * /test/runtests.py: Adding tests from /Extensions/ogr/test/. + 2004-12-07 Jan-Oliver Wagner * /Extensions/svgexport/test/test_svgmapwriter.py: Reverting From bernhard at intevation.de Wed Dec 8 16:40:15 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Wed, 8 Dec 2004 16:40:15 +0100 Subject: Tests broken (by ogr Extension) In-Reply-To: <20041207164453.BEC78102C57@lists.intevation.de> References: <20041207164453.BEC78102C57@lists.intevation.de> Message-ID: <20041208154015.GH10972@intevation.de> On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > Author: nhueffme > Adding a new extension to read shapefiles with ogr. It is planned to add other > vector formats. Tests have been broken by this commit. python runtests.py Traceback (most recent call last): File "runtests.py", line 107, in ? main() File "runtests.py", line 99, in main suite = unittest.defaultTestLoader.loadTestsFromNames(names) File "/usr/lib/python2.3/unittest.py", line 519, in loadTestsFromNames suites.append(self.loadTestsFromName(name, module)) File "/usr/lib/python2.3/unittest.py", line 493, in loadTestsFromName obj = getattr(obj, part) AttributeError: 'module' object has no attribute 'ogr' I think it is because ogr/__init__.py was not forgotten to be commited. I will commit an empty one which will heal the global tests again. -------------- 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/20041208/e1ff24e9/attachment.bin From cvs at intevation.de Wed Dec 8 16:43:12 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 8 Dec 2004 16:43:12 +0100 (CET) Subject: bernhard: thuban/Extensions/ogr __init__.py,NONE,1.1 Message-ID: <20041208154312.3FDE0102BE5@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/ogr In directory doto:/tmp/cvs-serv23644/Extensions/ogr Added Files: __init__.py Log Message: * Extensions/ogr/__init__.py: Added empty __init__.py to heal global tests until a real one is commited. --- NEW FILE: __init__.py --- From cvs at intevation.de Wed Dec 8 16:43:12 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 8 Dec 2004 16:43:12 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.719,1.720 Message-ID: <20041208154312.415B3102BF7@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv23644 Modified Files: ChangeLog Log Message: * Extensions/ogr/__init__.py: Added empty __init__.py to heal global tests until a real one is commited. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.719 retrieving revision 1.720 diff -u -d -r1.719 -r1.720 --- ChangeLog 7 Dec 2004 16:44:51 -0000 1.719 +++ ChangeLog 8 Dec 2004 15:43:10 -0000 1.720 @@ -1,3 +1,7 @@ +2004-12-08 Bernhard Reiter + * Extensions/ogr/__init__.py: Added empty __init__.py to heal + global tests until a real one is commited. + 2004-12-07 Nina Hüffmeyer * /Extensions/ogr/: Adding a new extension to read shapefiles with From bernhard at intevation.de Wed Dec 8 18:15:18 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Wed, 8 Dec 2004 18:15:18 +0100 Subject: Fails: TestOGRShapeStore.test_shapes_in_region In-Reply-To: <20041207164453.BD42D102C56@lists.intevation.de> References: <20041207164453.BD42D102C56@lists.intevation.de> Message-ID: <20041208171518.GJ10972@intevation.de> On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > Author: nhueffme > test_OGRShapestore.py One test fails here. No further analysis done, maybe this has to do with the version of pythonogr installed? I have installed Debian's: python-gdal 1.2.1-1 That is also the freshest that Debian has. ;) ERROR: Extensions.ogr.test.test_OGRShapestore.TestOGRShapeStore.test_shapes_in_region ---------------------------------------------------------------------- Traceback (most recent call last): File "/mobilehome/bernhard/hacking/thuban/root/thuban/test/../Extensions/ogr/test/test_OGRShapestore.py", line 77, in test_shapes_in_region self.assertEquals([s.ShapeID() for s in shapes], File "/mobilehome/bernhard/hacking/thuban/root/thuban/test/../Extensions/ogr/ogrshapes.py", line 181, in ShapesInRegion bboxpolygon.CloseRings() AttributeError: Geometry instance has no attribute 'CloseRings' -------------- 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/20041208/f592e2e8/attachment.bin From cvs at intevation.de Wed Dec 8 18:37:32 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 8 Dec 2004 18:37:32 +0100 (CET) Subject: silke: thuban/Extensions/ogr ogrshapes.py,1.1,1.2 Message-ID: <20041208173732.475CA102BD5@lists.intevation.de> Author: silke Update of /thubanrepository/thuban/Extensions/ogr In directory doto:/tmp/cvs-serv27511/Extensions/ogr Modified Files: ogrshapes.py Log Message: Substituted ogr-method CloseRings because it is not available in all versions of ogr Index: ogrshapes.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/ogr/ogrshapes.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ogrshapes.py 7 Dec 2004 16:44:51 -0000 1.1 +++ ogrshapes.py 8 Dec 2004 17:37:30 -0000 1.2 @@ -176,9 +176,8 @@ left, bottom, right, top = bbox # create a geometry which can be passed to the layer as spatial filter - bboxpolygon = ogr.CreateGeometryFromWkt('Polygon((%s %s, %s %s, %s %s, %s %s))' - %(left, bottom, left, top, right, top, right, bottom)) - bboxpolygon.CloseRings() + bboxpolygon = ogr.CreateGeometryFromWkt('Polygon((%s %s, %s %s, %s %s, %s %s, %s %s))' + %(left, bottom, left, top, right, top, right, bottom, left, bottom)) if ogrlayer.GetSpatialRef(): bboxpolygon.AssignSpatialReference(ogrlayer.GetSpatialRef()) From cvs at intevation.de Wed Dec 8 18:37:32 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 8 Dec 2004 18:37:32 +0100 (CET) Subject: silke: thuban ChangeLog,1.720,1.721 Message-ID: <20041208173732.4A1A9102BFF@lists.intevation.de> Author: silke Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv27511 Modified Files: ChangeLog Log Message: Substituted ogr-method CloseRings because it is not available in all versions of ogr Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.720 retrieving revision 1.721 diff -u -d -r1.720 -r1.721 --- ChangeLog 8 Dec 2004 15:43:10 -0000 1.720 +++ ChangeLog 8 Dec 2004 17:37:30 -0000 1.721 @@ -1,3 +1,7 @@ +2004-12-08 Silke Reimer + * Extensions/ogr/ogrshapes.py: Substituted ogr-method CloseRings + because it is not available in all versions of ogr + 2004-12-08 Bernhard Reiter * Extensions/ogr/__init__.py: Added empty __init__.py to heal global tests until a real one is commited. From Silke.Reimer at intevation.de Wed Dec 8 18:40:45 2004 From: Silke.Reimer at intevation.de (Silke Reimer) Date: Wed, 8 Dec 2004 18:40:45 +0100 Subject: Fails: TestOGRShapeStore.test_shapes_in_region In-Reply-To: <20041208171518.GJ10972@intevation.de> References: <20041207164453.BD42D102C56@lists.intevation.de> <20041208171518.GJ10972@intevation.de> Message-ID: <20041208174045.GI19751@intevation.de> On Wed, Dec 08, 2004 at 06:15:18PM +0100, Bernhard Reiter wrote: > On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > > Author: nhueffme > > test_OGRShapestore.py > > One test fails here. > No further analysis done, maybe this has to do with the version > of pythonogr installed? > I have installed Debian's: python-gdal 1.2.1-1 > That is also the freshest that Debian has. ;) It seems thate CloseRings is an ogr-method which is available in version 1.2.5 of ogr but not in version 1.2.1. I changed ShapesInRegion slightly so that it does not depend on 'CloseRings' anymore. The tests work now for me. Could you please check it as well? Silke > > ERROR: Extensions.ogr.test.test_OGRShapestore.TestOGRShapeStore.test_shapes_in_region > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/mobilehome/bernhard/hacking/thuban/root/thuban/test/../Extensions/ogr/test/test_OGRShapestore.py", line 77, in test_shapes_in_region > self.assertEquals([s.ShapeID() for s in shapes], > File "/mobilehome/bernhard/hacking/thuban/root/thuban/test/../Extensions/ogr/ogrshapes.py", line 181, in ShapesInRegion > bboxpolygon.CloseRings() > AttributeError: Geometry instance has no attribute 'CloseRings' > > _______________________________________________ > Thuban-devel mailing list > Thuban-devel at intevation.de > https://intevation.de/mailman/listinfo/thuban-devel -- Intevation GmbH Georgstrasse 4 49074 Osnabr?ck, Germany http://intevation.de http://intevation.de/~silke FreeGIS.org http://freegis.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/20041208/bbe98358/attachment.bin From joey at infodrom.org Wed Dec 8 18:49:21 2004 From: joey at infodrom.org (Martin Schulze) Date: Wed, 8 Dec 2004 18:49:21 +0100 Subject: Fails: TestOGRShapeStore.test_shapes_in_region In-Reply-To: <20041208174045.GI19751@intevation.de> References: <20041207164453.BD42D102C56@lists.intevation.de> <20041208171518.GJ10972@intevation.de> <20041208174045.GI19751@intevation.de> Message-ID: <20041208174921.GU7329@finlandia.infodrom.north.de> Silke Reimer wrote: > On Wed, Dec 08, 2004 at 06:15:18PM +0100, Bernhard Reiter wrote: > > On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > > > Author: nhueffme > > > test_OGRShapestore.py > > > > One test fails here. > > No further analysis done, maybe this has to do with the version > > of pythonogr installed? > > I have installed Debian's: python-gdal 1.2.1-1 > > That is also the freshest that Debian has. ;) > > It seems thate CloseRings is an ogr-method which is available in > version 1.2.5 of ogr but not in version 1.2.1. I changed > ShapesInRegion slightly so that it does not depend on 'CloseRings' > anymore. The tests work now for me. Could you please check it as > well? Maybe the test (and also the ogr extension code) should rather check whether version 1.2.5 of ogr is available? Regards, Joey -- Open source is important from a technical angle. -- Linus Torvalds From Silke.Reimer at intevation.de Thu Dec 9 10:24:21 2004 From: Silke.Reimer at intevation.de (Silke Reimer) Date: Thu, 9 Dec 2004 10:24:21 +0100 Subject: Fails: TestOGRShapeStore.test_shapes_in_region In-Reply-To: <20041208174921.GU7329@finlandia.infodrom.north.de> References: <20041207164453.BD42D102C56@lists.intevation.de> <20041208171518.GJ10972@intevation.de> <20041208174045.GI19751@intevation.de> <20041208174921.GU7329@finlandia.infodrom.north.de> Message-ID: <20041209092421.GA27477@intevation.de> On Wed, Dec 08, 2004 at 06:49:21PM +0100, Martin Schulze wrote: > Silke Reimer wrote: > > On Wed, Dec 08, 2004 at 06:15:18PM +0100, Bernhard Reiter wrote: > > > On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > > > > Author: nhueffme > > > > test_OGRShapestore.py > > > > > > One test fails here. > > > No further analysis done, maybe this has to do with the version > > > of pythonogr installed? > > > I have installed Debian's: python-gdal 1.2.1-1 > > > That is also the freshest that Debian has. ;) > > > > It seems thate CloseRings is an ogr-method which is available in > > version 1.2.5 of ogr but not in version 1.2.1. I changed > > ShapesInRegion slightly so that it does not depend on 'CloseRings' > > anymore. The tests work now for me. Could you please check it as > > well? > > Maybe the test (and also the ogr extension code) should rather check > whether version 1.2.5 of ogr is available? In my opinion it should rather use only functions from 1.2.1 if possible. If we really need 1.2.5 at some time we should of course add this check. In the current case there hasn't been a real need to use the function 'CloseRings' (it took me just a minute to fix it.) Greetings, Silke -- Intevation GmbH Georgstrasse 4 49074 Osnabr?ck, Germany http://intevation.de http://intevation.de/~silke FreeGIS.org http://freegis.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/20041209/94086c9e/attachment.bin From bernhard at intevation.de Thu Dec 9 11:15:46 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Thu, 9 Dec 2004 11:15:46 +0100 Subject: 549 tests okay! (was: Fails: TestOGRShapeStore.test_shapes_in_region) In-Reply-To: <20041208174045.GI19751@intevation.de> References: <20041207164453.BD42D102C56@lists.intevation.de> <20041208171518.GJ10972@intevation.de> <20041208174045.GI19751@intevation.de> Message-ID: <20041209101546.GA13358@intevation.de> On Wed, Dec 08, 2004 at 06:40:45PM +0100, Silke Reimer wrote: > On Wed, Dec 08, 2004 at 06:15:18PM +0100, Bernhard Reiter wrote: > > On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > > > test_OGRShapestore.py > > > > One test fails here. > It seems thate CloseRings is an ogr-method which is available in > version 1.2.5 of ogr but not in version 1.2.1. I changed > ShapesInRegion slightly so that it does not depend on 'CloseRings' > anymore. The tests work now for me. Could you please check it as > well? Now all 549 tests run fine for me! :) -------------- 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/20041209/1cc871af/attachment.bin From bernhard at intevation.de Thu Dec 9 11:22:12 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Thu, 9 Dec 2004 11:22:12 +0100 Subject: Umlauts and Indentation In-Reply-To: <20041207164453.BD42D102C56@lists.intevation.de> References: <20041207164453.BD42D102C56@lists.intevation.de> Message-ID: <20041209102212.GB13358@intevation.de> On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: > Author: nhueffme > test_OGRShapestore.py Running the tests with python 2.3, I noticed two possible points of improvements: The encoding of the python file is not declared, the warning has the details: /mobilehome/bernhard/hacking/thuban/root/thuban/test/../Extensions/ogr/test/test_OGRShapestore.py:37: DeprecationWarning: Non-ASCII character '\xfc' in file /mobilehome/bernhard/hacking/thuban/root/thuban/test/../Extensions/ogr/ogrshapes.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details This can only be seen with newer python versions. Some files use tabs and spaces intermixed. In general this calls for trouble, this is why the Thuban coding guidelines (in Docs/technotes/ ) have the following: Source Formatting - Use only spaces for indentation. Each indentation level is four spaces. Cheers, Bernhard -------------- 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/20041209/f306d08e/attachment.bin From cvs at intevation.de Thu Dec 9 11:34:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 9 Dec 2004 11:34:06 +0100 (CET) Subject: joey: thuban/Extensions/wms layer.py,1.5,1.6 Message-ID: <20041209103406.1EE79102C5C@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms In directory doto:/tmp/cvs-serv14630 Modified Files: layer.py Log Message: Improved graphic format priority now that more formats are supported globally by the render engine. Index: layer.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/layer.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- layer.py 15 Apr 2004 17:28:04 -0000 1.5 +++ layer.py 9 Dec 2004 10:34:03 -0000 1.6 @@ -229,7 +229,7 @@ image/wbmp or WBMP which refers to WAP bitmap format and is not supported by the included render engine. """ - prio = ['jpeg', 'bmp'] + prio = ['png', 'gif', 'jpeg', 'bmp'] for p in prio: for f in formats: if f.lower().find(p) > -1: From cvs at intevation.de Thu Dec 9 11:37:46 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 9 Dec 2004 11:37:46 +0100 (CET) Subject: joey: thuban/Extensions/wms parser.py,1.10,1.11 Message-ID: <20041209103746.73EEA102C5C@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms In directory doto:/tmp/cvs-serv14883 Modified Files: parser.py Log Message: Dropped support for get_srs_discrepancies() since there are no discrepancies anymore (was a thinko) Index: parser.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/parser.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- parser.py 13 Apr 2004 19:28:05 -0000 1.10 +++ parser.py 9 Dec 2004 10:37:44 -0000 1.11 @@ -40,8 +40,6 @@ getLayerBBox(layer, srs) isQueryable(layer) - - get_srs_discrepancies() """ __version__ = "$Revision$" @@ -70,7 +68,6 @@ fees = None access = None formats = None - srs_discrepancies = None error = None @@ -506,14 +503,6 @@ return pivot['queryable'] return 0 - - def get_srs_discrepancies(self): - """ - Returns a list of layer identifications where the denoted SRS - values differ from the calculated ones through BoundingBox - elements. - """ - return self.srs_discrepancies if __name__ == "__main__": From cvs at intevation.de Thu Dec 9 11:39:45 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 9 Dec 2004 11:39:45 +0100 (CET) Subject: joey: thuban/Extensions/wms properties.py,1.2,1.3 Message-ID: <20041209103945.63C92102C63@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Extensions/wms In directory doto:/tmp/cvs-serv15114 Modified Files: properties.py Log Message: Removed unused OpenWMSProperties() defun Index: properties.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/wms/properties.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- properties.py 1 Oct 2004 18:28:04 -0000 1.2 +++ properties.py 9 Dec 2004 10:39:43 -0000 1.3 @@ -190,18 +190,3 @@ Handle the 'Cancel button pressed' event """ self.Close() - - -def OpenWMSProperties(parent, layer): - """ - Open or raise the WMS properties dialog - """ - name = "layer_properties_" + layer.url - dialog = parent.get_open_dialog(name) - - if dialog is None: - dialog = wmsProperties(parent, name, layer) - parent.add_dialog(name, dialog) - dialog.Show(True) - else: - dialog.Raise() From cvs at intevation.de Thu Dec 9 11:50:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 9 Dec 2004 11:50:36 +0100 (CET) Subject: joey: thuban/Thuban/Model classgen.py,1.19,1.20 Message-ID: <20041209105036.4B3DC102C63@lists.intevation.de> Author: joey Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv15877 Modified Files: classgen.py Log Message: Added missing character encoding so that Python doesn't barf upon evaluating this file Index: classgen.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/classgen.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- classgen.py 7 Oct 2004 14:28:51 -0000 1.19 +++ classgen.py 9 Dec 2004 10:50:34 -0000 1.20 @@ -1,3 +1,5 @@ +# -*- encoding: iso-8859-1 -*- +# # Copyright (c) 2003-2004 by Intevation GmbH # Authors: # Jan-Oliver Wagner (2004) From cvs at intevation.de Thu Dec 9 11:51:11 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 9 Dec 2004 11:51:11 +0100 (CET) Subject: joey: thuban ChangeLog,1.721,1.722 Message-ID: <20041209105111.4530A100166@lists.intevation.de> Author: joey Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv15915 Modified Files: ChangeLog Log Message: ChangeLog updated Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.721 retrieving revision 1.722 diff -u -d -r1.721 -r1.722 --- ChangeLog 8 Dec 2004 17:37:30 -0000 1.721 +++ ChangeLog 9 Dec 2004 10:51:09 -0000 1.722 @@ -1,3 +1,17 @@ +2004-12-09 Martin Schulze + + * Thuban/Model/classgen.py: Added missing character encoding + + * Extensions/wms/properties.py (OpenWMSProperties): removed + + * Extensions/wms/parser.py (WMSCapabilitiesParser.error): Dropped + support for get_srs_discrepancies() since there are no + discrepancies anymore (was a thinko) + + * Extensions/wms/layer.py (WMSLayer.GetMapImg): Improved graphic + format priority now that more formats are supported globally by + the render engine. + 2004-12-08 Silke Reimer * Extensions/ogr/ogrshapes.py: Substituted ogr-method CloseRings because it is not available in all versions of ogr From bh at intevation.de Thu Dec 9 21:46:39 2004 From: bh at intevation.de (Bernhard Herzog) Date: Thu, 09 Dec 2004 21:46:39 +0100 Subject: Umlauts and Indentation In-Reply-To: <20041209102212.GB13358@intevation.de> (Bernhard Reiter's message of "Thu, 9 Dec 2004 11:22:12 +0100") References: <20041207164453.BD42D102C56@lists.intevation.de> <20041209102212.GB13358@intevation.de> Message-ID: Bernhard Reiter writes: > On Tue, Dec 07, 2004 at 05:44:53PM +0100, cvs at intevation.de wrote: >> Author: nhueffme >> test_OGRShapestore.py [...] > The encoding of the python file is not declared, > the warning has the details: [...] > This can only be seen with newer python versions. More precisely Python >= 2.3 > Some files use tabs and spaces intermixed. > In general this calls for trouble, this is why the Thuban > coding guidelines (in Docs/technotes/ ) have the following: > > Source Formatting > - Use only spaces for indentation. Each > indentation level is four spaces. Plus (also from coding_guidelines.txt): - All lines should be at most 79 characters long Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From bh at intevation.de Fri Dec 10 22:14:19 2004 From: bh at intevation.de (Bernhard Herzog) Date: Fri, 10 Dec 2004 22:14:19 +0100 Subject: nhueffme: thuban/Extensions/ogr ogrshapes.py, NONE, 1.1 ogrstart.py, NONE, 1.1 References: <20041207164453.B79B5102C51@lists.intevation.de> Message-ID: cvs at intevation.de writes: > --- NEW FILE: ogrshapes.py --- line 29f: # Raw data in ogr format RAW_OGRSHAPES = "RAW_OGRSHAPES" What do we need that for? We don't have a low-level renderer for OGR yet, so it might be best to simply use RAW_PYTHON for now. line 170 (doc string of ShapesInRegion) The method GetFID() returns feature IDs starting from 0. In Thuban feature IDs start with 1. If "Thuban feature IDs" means e.g. the shapeids in shape files or the ids of shapes read from a postgis database then that's wrong. The only thing Thuban assumes about shape ids is that they're integers. Also, ogr's feature ids probably don't start at 0 either, I would guess. lines 290ff def RowIdToOrdinal(self, gid): """Return the row ordinal given its id""" return self.layer.GetFeature(gid).GetFID() def RowOrdinalToId(self, num): """Return the rowid for given its ordinal""" return self.layer.GetFeature(num).GetFID() At most one of these can be correct. In fact they're probably both wrong. If a table is to be shown in the table view, we need to have a way to convert from the row-number as used by the wxGrid to the row id so that we can get the corresponding data from the table. The row number is an int 0 <= N < table.NumRows(). The row id is the same as the shape-id for tables that contain the attributes for a shape store. The methods RowOrdinalToId and RowIdToOrdinal convert between these two kinds of ways to identify a row in a table. > --- NEW FILE: ogrstart.py --- line 36ff: if hasattr(canvas, "export_path"): export_path = canvas.export_path else: export_path="." Please don't use the export_path. It's a kludge which makes some sense in the svg extension, but unless there's a very good reason, it should not be used for anything else until we have a real mechanism for that kind of thing. Even then, I doubt you really would want to use it here. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Sat Dec 11 03:03:49 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:03:49 +0100 (CET) Subject: bernhard: thuban/Doc/technotes coding_guidelines.txt,1.2,1.3 Message-ID: <20041211020349.97397102C0B@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Doc/technotes In directory doto:/tmp/cvs-serv29643/Doc/technotes Modified Files: coding_guidelines.txt Log Message: * Doc/technotes/coding_guidelines.txt: easy typo fixed. * Extensions/svgexport/test/test_svgmapwriter.py: Removed test_drawbezier in favour of new test_drawspline3 and test_drawspline4 within new class TestDrawSplines(TestVirtualDC). All only to test DrawSpline. * Extensions/svgexport/svgmapwriter.py(DrawSpline): New implementation now really using the strange algorithm of xfig 3.1's approximated splines and its conversion to postscript with one twist: SVG can do quadratic beziers, so skipped translation to cubic beziers. (TestWithDC): Typo in comment fixed. Index: coding_guidelines.txt =================================================================== RCS file: /thubanrepository/thuban/Doc/technotes/coding_guidelines.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- coding_guidelines.txt 10 Aug 2004 00:23:36 -0000 1.2 +++ coding_guidelines.txt 11 Dec 2004 02:03:47 -0000 1.3 @@ -104,7 +104,7 @@ testsuite*. Yes, all of it. Even if you think your change won't break anything. - - All commits should be described in the ChangeLog file. The esiest + - All commits should be described in the ChangeLog file. The easiest way to do that is to write the ChangeLog entry first and use that as the commit message. From cvs at intevation.de Sat Dec 11 03:03:49 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:03:49 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport svgmapwriter.py,1.8,1.9 Message-ID: <20041211020349.9BE71102C0E@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv29643/Extensions/svgexport Modified Files: svgmapwriter.py Log Message: * Doc/technotes/coding_guidelines.txt: easy typo fixed. * Extensions/svgexport/test/test_svgmapwriter.py: Removed test_drawbezier in favour of new test_drawspline3 and test_drawspline4 within new class TestDrawSplines(TestVirtualDC). All only to test DrawSpline. * Extensions/svgexport/svgmapwriter.py(DrawSpline): New implementation now really using the strange algorithm of xfig 3.1's approximated splines and its conversion to postscript with one twist: SVG can do quadratic beziers, so skipped translation to cubic beziers. (TestWithDC): Typo in comment fixed. Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- svgmapwriter.py 7 Dec 2004 11:19:38 -0000 1.8 +++ svgmapwriter.py 11 Dec 2004 02:03:47 -0000 1.9 @@ -701,14 +701,50 @@ self.make_meta(), join(data, '') ) ) def DrawSpline(self, points, closed=0): - """Draw a spline object. + """Calculate square bezier points for an xfig approximated spline. + + DrawSpline() needs to do the same as the function of the Device Context + of wxWidgets. Code inspection shows it uses the "approximated + splines" of xfig <= 3.1. This can be mapped + on SVG's squared bezier curves, + by doing the same calculation like wxPostScriptDC::DoDrawSpline() in + wxWidgets src/generic/dcpsg.cpp. + Which is derived from xfig's 3.1.4 u_draw.c(draw_open_spline()). + + And then leave out the last translation to cubic beziers + done in the postscript code of DrawSplineSection. """ self.write_indent('\n' % (self.make_id(), self.make_meta(), datastr ) ) From cvs at intevation.de Sat Dec 11 03:03:49 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:03:49 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.722,1.723 Message-ID: <20041211020349.9DAFF102C10@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv29643 Modified Files: ChangeLog Log Message: * Doc/technotes/coding_guidelines.txt: easy typo fixed. * Extensions/svgexport/test/test_svgmapwriter.py: Removed test_drawbezier in favour of new test_drawspline3 and test_drawspline4 within new class TestDrawSplines(TestVirtualDC). All only to test DrawSpline. * Extensions/svgexport/svgmapwriter.py(DrawSpline): New implementation now really using the strange algorithm of xfig 3.1's approximated splines and its conversion to postscript with one twist: SVG can do quadratic beziers, so skipped translation to cubic beziers. (TestWithDC): Typo in comment fixed. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.722 retrieving revision 1.723 diff -u -d -r1.722 -r1.723 --- ChangeLog 9 Dec 2004 10:51:09 -0000 1.722 +++ ChangeLog 11 Dec 2004 02:03:47 -0000 1.723 @@ -1,3 +1,19 @@ +2004-12-11 Bernhard Reiter + + * Doc/technotes/coding_guidelines.txt: easy typo fixed. + + * Extensions/svgexport/test/test_svgmapwriter.py: + Removed test_drawbezier in favour of new test_drawspline3 and + test_drawspline4 within new class TestDrawSplines(TestVirtualDC). + All only to test DrawSpline. + + * Extensions/svgexport/svgmapwriter.py(DrawSpline): + New implementation now really using the strange algorithm of + xfig 3.1's approximated splines and its conversion to postscript + with one twist: SVG can do quadratic beziers, so skipped translation + to cubic beziers. + (TestWithDC): Typo in comment fixed. + 2004-12-09 Martin Schulze * Thuban/Model/classgen.py: Added missing character encoding From cvs at intevation.de Sat Dec 11 03:03:49 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:03:49 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.11, 1.12 Message-ID: <20041211020349.9F4C4102C2D@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv29643/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: * Doc/technotes/coding_guidelines.txt: easy typo fixed. * Extensions/svgexport/test/test_svgmapwriter.py: Removed test_drawbezier in favour of new test_drawspline3 and test_drawspline4 within new class TestDrawSplines(TestVirtualDC). All only to test DrawSpline. * Extensions/svgexport/svgmapwriter.py(DrawSpline): New implementation now really using the strange algorithm of xfig 3.1's approximated splines and its conversion to postscript with one twist: SVG can do quadratic beziers, so skipped translation to cubic beziers. (TestWithDC): Typo in comment fixed. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- test_svgmapwriter.py 7 Dec 2004 14:00:12 -0000 1.11 +++ test_svgmapwriter.py 11 Dec 2004 02:03:47 -0000 1.12 @@ -158,25 +158,6 @@ self.assertEquals(xmlsupport.sax_eventlist(data = data), xmlsupport.sax_eventlist(data = file.getvalue())) - def test_drawbezier(self): - '''Test DrawSpline (which actually draws bezier curves).''' - data = ('') - file = StringIO.StringIO() - dc = VirtualDC(file) - dc.SetPen(self.solid_pen) - dc.SetMeta(self.meta) - dc.SetBrush(self.trans_brush) - dc.DrawSpline([ Point(10, 10), - Point(15, 12), - Point(15, 8.0), - Point(20, 10) ]) - #print file.getvalue() - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - def test_text(self): '''Set drawing properties and draw a circle''' data = ('') + + self.file = StringIO.StringIO() + self.dc = VirtualDC(self.file) + self.dc.SetPen(self.solid_pen) + self.dc.SetMeta(self.meta) + self.dc.SetBrush(self.trans_brush) + + def test_drawspline3(self): + '''Test DrawSpline with three points in a row.''' + + d=('M 10 10 L 12.55 12.55 Q 15.1 15.1 17.65 17.65\nL 20.2 20.2') + data=(self.dataframe % d) + + self.dc.DrawSpline([ Point(10, 10), + Point(15.1, 15.1), + Point(20.2, 20.2) ]) + #print file.getvalue() + self.assertEquals(xmlsupport.sax_eventlist(data = data), + xmlsupport.sax_eventlist(data = self.file.getvalue())) + + def test_drawspline4(self): + '''Test DrawSpline with four points in a row.''' + + d='M 0 0 L 0 1 Q 0 2 0 3\nQ 0 4 0 5\nL 0 6' + data=(self.dataframe % d) + + self.dc.DrawSpline([ Point(0, 0), + Point(0, 2), + Point(0, 4), + Point(0, 6) ]) + #print file.getvalue() + self.assertEquals(xmlsupport.sax_eventlist(data = data), + xmlsupport.sax_eventlist(data = self.file.getvalue())) + + class TestWithDC(unittest.TestCase): """Add dc creation and self.to_destroy list to setUp() and tearDown(). - This is a baseclass for test needing a dc. + This is a baseclass for tests needing a dc. """ def setUp(self): From cvs at intevation.de Sat Dec 11 03:25:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:25:38 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.12, 1.13 Message-ID: <20041211022538.A0A36102C0B@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv29974/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: Made sure that newlines are inserted in the svg path d attributes to raise the chance that the line length will be below 255 characters, as recommended by REC SVG 1.1 in section 8.3.1. * Extensions/svgexport/svgmapwriter.py(DrawPolygon): Adding \n before L's and changed whitespace handling. * Extensions/svgexport/test/test_svgmapwriter.py: Adapted tests to new whitespace handling of DrawPolygon. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- test_svgmapwriter.py 11 Dec 2004 02:03:47 -0000 1.12 +++ test_svgmapwriter.py 11 Dec 2004 02:25:36 -0000 1.13 @@ -91,8 +91,8 @@ '''Set drawing properties and draw a polygon onto the dc.''' data = ('') + 'meta="Object:test; Label:nothing" d="M 5.6 5.5' + '\nL 95.4 5.3\nL 95.2 95.1\nL 5.0 95.0\nL 5.0 5.0"/>') file = StringIO.StringIO() dc = VirtualDC(file) dc.SetPen(self.solid_pen) @@ -106,8 +106,8 @@ '''Test dc drawing a transparent polygon.''' data = ('') + 'meta="Object:test; Label:nothing" d="M 5.6 5.5' + ' L 95.4 5.3\nL 95.2 95.1\nL 5.0 95.0\nL 5.0 5.0"/>') file = StringIO.StringIO() dc = VirtualDC(file) dc.SetPen(self.solid_pen) @@ -356,7 +356,7 @@ ' \n' + ' d="M 0.0 0.0\nL 10.0 -10.0\nL 0.0 -10.0\nL 0.0 0.0 Z"/>\n' ' \n\n') table = MemoryTable([("type", FIELDTYPE_STRING), ("value", FIELDTYPE_DOUBLE), From cvs at intevation.de Sat Dec 11 03:25:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:25:38 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.723,1.724 Message-ID: <20041211022538.A32AB102C0E@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv29974 Modified Files: ChangeLog Log Message: Made sure that newlines are inserted in the svg path d attributes to raise the chance that the line length will be below 255 characters, as recommended by REC SVG 1.1 in section 8.3.1. * Extensions/svgexport/svgmapwriter.py(DrawPolygon): Adding \n before L's and changed whitespace handling. * Extensions/svgexport/test/test_svgmapwriter.py: Adapted tests to new whitespace handling of DrawPolygon. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.723 retrieving revision 1.724 diff -u -d -r1.723 -r1.724 --- ChangeLog 11 Dec 2004 02:03:47 -0000 1.723 +++ ChangeLog 11 Dec 2004 02:25:36 -0000 1.724 @@ -1,5 +1,17 @@ 2004-12-11 Bernhard Reiter + Made sure that newlines are inserted in the svg path d attributes + to raise the chance that the line length will be below 255 characters, + as recommended by REC SVG 1.1 in section 8.3.1. + + * Extensions/svgexport/svgmapwriter.py(DrawPolygon): + Adding \n before L's and changed whitespace handling. + + * Extensions/svgexport/test/test_svgmapwriter.py: + Adapted tests to new whitespace handling of DrawPolygon. + +2004-12-11 Bernhard Reiter + * Doc/technotes/coding_guidelines.txt: easy typo fixed. * Extensions/svgexport/test/test_svgmapwriter.py: From cvs at intevation.de Sat Dec 11 03:25:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 03:25:38 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport svgmapwriter.py,1.9,1.10 Message-ID: <20041211022538.A4DE1102C10@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv29974/Extensions/svgexport Modified Files: svgmapwriter.py Log Message: Made sure that newlines are inserted in the svg path d attributes to raise the chance that the line length will be below 255 characters, as recommended by REC SVG 1.1 in section 8.3.1. * Extensions/svgexport/svgmapwriter.py(DrawPolygon): Adding \n before L's and changed whitespace handling. * Extensions/svgexport/test/test_svgmapwriter.py: Adapted tests to new whitespace handling of DrawPolygon. Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- svgmapwriter.py 11 Dec 2004 02:03:47 -0000 1.9 +++ svgmapwriter.py 11 Dec 2004 02:25:36 -0000 1.10 @@ -689,13 +689,13 @@ i = 0 for point in polygon: if i is 0: - data.append('M %s %s ' % (point.x, point.y)) + data.append('M %s %s' % (point.x, point.y)) i+=1 else: - data.append('L %s %s ' % (point.x, point.y)) - # FIXME: Determine if path is closed + # SVG 1.1 Spec 8.3.1 recommends that lines length <= 255 + data.append('\nL %s %s' % (point.x, point.y)) if closed: - data.append('Z') + data.append(' Z') # Put everything together and write it to the file self.file.write('%s %s d="%s"/>\n' % (self.make_id(), self.make_meta(), join(data, '') ) ) From cvs at intevation.de Sat Dec 11 04:24:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 04:24:38 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport __init__.py, 1.5, 1.6 svgmapwriter.py, 1.10, 1.11 Message-ID: <20041211032438.68C00102BE2@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv30649/Extensions/svgexport Modified Files: __init__.py svgmapwriter.py Log Message: svgexport 0.9.2: Point size supports for maps. * Extensions/svgexport/svgmapwriter.py: Added import of SHAPETYPE_POINT (def draw_point_shape): new parameter size defaults to 2 as before. (draw_shape_layer_incrementally): Moved draw_func log line higher. Added draw_func call with size when dealing with a point layer. * Extensions/svgexport/__init__.py: bumped version to 0.9.2. Index: __init__.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- __init__.py 7 Dec 2004 11:19:38 -0000 1.5 +++ __init__.py 11 Dec 2004 03:24:36 -0000 1.6 @@ -24,7 +24,7 @@ ext_registry.add(ExtensionDesc( name = 'SVGexport', - version = '0.9.1', + version = '0.9.2', authors= [ 'Markus Rechtien', 'Bernhard Reiter' ], copyright = '2004 Intevation GmbH', desc = _("Export the current map and legend in Thuban-map-SVG format."))) Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- svgmapwriter.py 11 Dec 2004 02:25:36 -0000 1.10 +++ svgmapwriter.py 11 Dec 2004 03:24:36 -0000 1.11 @@ -35,6 +35,7 @@ import binascii from Thuban import _ +from Thuban.Model.data import SHAPETYPE_POINT # VirtualDC extends XMLWriter from Thuban.Model.xmlwriter import XMLWriter, escape # Color related classes from the model of thuban @@ -225,7 +226,7 @@ for parts in points: self.dc.DrawPolygon(parts,closed=1) - def draw_point_shape(self, layer, points, pen, brush): + def draw_point_shape(self, layer, points, pen, brush, size=2): """Draw a point shape from layer with the given brush and pen The shape is given by points argument which is a the return @@ -239,7 +240,7 @@ if not points: return - radius = self.factor * 2.0 + radius = self.factor * size self.dc.SetBrush(brush) self.dc.SetPen(pen) for part in points: @@ -273,6 +274,8 @@ # Determine which render function to use. useraw, draw_func, draw_func_param = \ self.low_level_renderer(layer) + if verbose > 0 : log("Using draw_func %s\n"%(repr(draw_func))) + tool_cache = {} new_baseid=dc.SetBaseID(layer.title) @@ -316,8 +319,12 @@ data = shape.RawData() else: data = shape.Points() - if verbose > 0 : log("Using draw_func %s\n"%(repr(draw_func))) - draw_func(draw_func_param, data, pen, brush) + + if shapeType==SHAPETYPE_POINT: + draw_func(draw_func_param, data, pen, brush, + size = group.GetProperties().GetSize()) + else: + draw_func(draw_func_param, data, pen, brush) # compatibility if 0: yield True From cvs at intevation.de Sat Dec 11 04:24:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 11 Dec 2004 04:24:38 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.724,1.725 Message-ID: <20041211032438.6D29F102BEB@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv30649 Modified Files: ChangeLog Log Message: svgexport 0.9.2: Point size supports for maps. * Extensions/svgexport/svgmapwriter.py: Added import of SHAPETYPE_POINT (def draw_point_shape): new parameter size defaults to 2 as before. (draw_shape_layer_incrementally): Moved draw_func log line higher. Added draw_func call with size when dealing with a point layer. * Extensions/svgexport/__init__.py: bumped version to 0.9.2. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.724 retrieving revision 1.725 diff -u -d -r1.724 -r1.725 --- ChangeLog 11 Dec 2004 02:25:36 -0000 1.724 +++ ChangeLog 11 Dec 2004 03:24:36 -0000 1.725 @@ -1,5 +1,16 @@ 2004-12-11 Bernhard Reiter + svgexport 0.9.2: Point size supports for maps. + + * Extensions/svgexport/svgmapwriter.py: Added import of SHAPETYPE_POINT + (def draw_point_shape): new parameter size defaults to 2 as before. + (draw_shape_layer_incrementally): Moved draw_func log line higher. + Added draw_func call with size when dealing with a point layer. + + * Extensions/svgexport/__init__.py: bumped version to 0.9.2. + +2004-12-11 Bernhard Reiter + Made sure that newlines are inserted in the svg path d attributes to raise the chance that the line length will be below 255 characters, as recommended by REC SVG 1.1 in section 8.3.1. From bh at intevation.de Mon Dec 13 00:44:17 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 00:44:17 +0100 Subject: nhueffme: thuban/Extensions/ogr ogrshapes.py, NONE, 1.1 ogrstart.py, NONE, 1.1 References: <20041207164453.B79B5102C51@lists.intevation.de> Message-ID: Bernhard Herzog writes: [comments on ogr ogrshapes.py] Something I forgot on friday: It might make sense to merge OGRShapeStore and OGRTable into one class. See PostGISShapeStore for instance which is also its own Table. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 13 12:52:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 12:52:36 +0100 (CET) Subject: frank: thuban/test test_load.py,1.39,1.40 Message-ID: <20041213115236.7778F102C3E@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv6169/test Modified Files: test_load.py Log Message: Alternative Path feature: * test/test_load.py (TestAltPath): New, tests for alternative path feature in load_session() (Shapefile_CallBack): Helper, implements controllable callback. * Thuban/UI/application.py (ThubanApplication.OnInit): Added "alt_path" to self.path (ThubanApplication.OpenSession): Added shapefile_callback as second callback similar to db_connection_callback. (ThubanApplication.run_alt_path_dialog): New, implementaion of shapefile_callback. In addition to raising the dialog the control of self.path('alt_path') is implemented here. * Thuban/Model/load.py (SessionLoader.__init__): Added shapefile_callback. (SessionLoader.open_shapefile): Open shapefile, eventually with alternative path. This wrapps the "theSession.OpenShapefile(filename)" formerly used in start_fileshapesource()/start_layer(). (SessionLoader.start_fileshapesource): Call open_shapefile(). (SessionLoader.start_layer): Call open_shapefile(). (load_session): Added shapefile_callback. * Thuban/UI/altpathdialog.py: New, implements dialogs for alternative path feature (search / check). Index: test_load.py =================================================================== RCS file: /thubanrepository/thuban/test/test_load.py,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- test_load.py 3 Oct 2004 20:49:24 -0000 1.39 +++ test_load.py 13 Dec 2004 11:52:34 -0000 1.40 @@ -980,5 +980,120 @@ else: self.fail("Missing filetype attribute doesn't raise LoadError") +class Shapefile_CallBack: + + def __init__(self, params): + """Initialize the callback return values. + + params must be a dictionary of the potential CB modes (keys), + with lists of tuples of return values as values. + Depending on the test the callback can be called multiple, + each time a return value is poped from the list + """ + + self.params = params + + + def s_cb(self, filename, mode = None, second_try= 0): + if self.params.has_key(mode): + return self.params[mode].pop(0) + else: + raise LoadError + +class TestAltPath(LoadSessionTest): + + """Test the various cases in the alternative path feature. + + The test checks the reasonable cases: + - First recognition of a path error, fixed with user interaction. + - First recognition of a path error, load cancelled. + - Path error fixed from list, confirmed by user. + - Path error fixed from list, changed by user. + - Path error fixed from list, cancelled by user. + - Path error wrongly fixed from list, manual fix forced. + """ + + file_contents = '''\ + + + + + + + + + + + + +''' + + def test_01_single_path_error_fix(self): + """Test single file path error fix.""" + # The usual initial case + s_cb = Shapefile_CallBack({ + "search": [("../Data/iceland/roads-line.shp",0)], + "check": [(None, None)]}) + self.session = load_session(self.filename(), + shapefile_callback =s_cb.s_cb) + self.session.Destroy() + self.session = None + + def test_02_path_error_fix_from_list(self): + """Test single file path error fix.""" + # This represents the usual case for "from_list" + s_cb = Shapefile_CallBack({ + "search": [("../Data/iceland/roads-line.shp",1)], + "check": [(os.path.abspath("../Data/iceland/roads-line.shp"),1)] + }) + self.session = load_session(self.filename(), + shapefile_callback =s_cb.s_cb) + self.session.Destroy() + self.session = None + + def test_03_single_path_error_cancelled(self): + """Test alternative path cancelled.""" + s_cb = Shapefile_CallBack({ + "search": [(None,0)], + "check": [(None, None)]}) + self.assertRaises(LoadCancelled, + load_session, self.filename(), None, s_cb.s_cb) + + def test_04_path_error_fix_from_list_cancelled(self): + """Test alternative path from list cancelled.""" + s_cb = Shapefile_CallBack({ + "search": [("../Data/iceland/roads-line.shp",1)], + "check": [(None,1)] + }) + self.assertRaises(LoadCancelled, + load_session, self.filename(), None, s_cb.s_cb) + + def test_05_path_error_fix_from_list_changed(self): + """Test alternative path from list changed.""" + s_cb = Shapefile_CallBack({ + "search": [("../Data/iceland/roads-line.shp",1)], + "check": [("../Data/iceland/roads-line.shp",0)] + }) + self.session = load_session(self.filename(), + shapefile_callback =s_cb.s_cb) + self.session.Destroy() + self.session = None + + def test_06_path_error_fix_from_list_fails(self): + """Test alternative path recovery from list.""" + s_cb = Shapefile_CallBack({ + "search": [("../wrong/iceland/roads-line.shp",1), + ("../Data/iceland/roads-line.shp",0)], + "check": [(None,None)] + }) + self.session = load_session(self.filename(), + shapefile_callback =s_cb.s_cb) + self.assertRaises(IndexError, + s_cb.s_cb, None, "search") + + self.session.Destroy() + self.session = None + + if __name__ == "__main__": support.run_tests() From cvs at intevation.de Mon Dec 13 12:52:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 12:52:36 +0100 (CET) Subject: frank: thuban/Thuban/UI altpathdialog.py, NONE, 1.1 application.py, 1.37, 1.38 Message-ID: <20041213115236.7E166102C49@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv6169/Thuban/UI Modified Files: application.py Added Files: altpathdialog.py Log Message: Alternative Path feature: * test/test_load.py (TestAltPath): New, tests for alternative path feature in load_session() (Shapefile_CallBack): Helper, implements controllable callback. * Thuban/UI/application.py (ThubanApplication.OnInit): Added "alt_path" to self.path (ThubanApplication.OpenSession): Added shapefile_callback as second callback similar to db_connection_callback. (ThubanApplication.run_alt_path_dialog): New, implementaion of shapefile_callback. In addition to raising the dialog the control of self.path('alt_path') is implemented here. * Thuban/Model/load.py (SessionLoader.__init__): Added shapefile_callback. (SessionLoader.open_shapefile): Open shapefile, eventually with alternative path. This wrapps the "theSession.OpenShapefile(filename)" formerly used in start_fileshapesource()/start_layer(). (SessionLoader.start_fileshapesource): Call open_shapefile(). (SessionLoader.start_layer): Call open_shapefile(). (load_session): Added shapefile_callback. * Thuban/UI/altpathdialog.py: New, implements dialogs for alternative path feature (search / check). --- NEW FILE: altpathdialog.py --- # Copyright (c) 2004 by Intevation GmbH # Authors: # Frank Koormann # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. """Dialogs for alternative paths (path recovery). AltPathFileDialog: File dialog to specify alterative path. AltPathConfirmDialog: Confirm or cancel alternative path suggestion. """ from Thuban import _ from wxPython.wx import wxFileDialog, wxMessageDialog, wxOPEN, \ wxYES_NO, wxYES_DEFAULT, wxICON_INFORMATION, \ wxID_OK, wxID_YES import os class AltPathFileDialog(wxFileDialog): def __init__(self, filename): msg = _("Select an alternative data file for %s" % \ os.path.basename(filename)) wxFileDialog.__init__(self, None, msg, os.path.dirname(filename), os.path.basename(filename), _("Shapefiles (*.shp)") + "|*.shp;*.SHP|" + _("All Files (*.*)") + "|*.*", wxOPEN) def RunDialog(self): val = self.ShowModal() self.Destroy() if val == wxID_OK: return self.GetPaths()[0] else: return None class AltPathConfirmDialog(wxMessageDialog): def __init__(self, filename): self.filename = filename msg = _("Found the following as an alternative for %s.\n%s\n\n Please confirm with Yes or select alternative with No." % (os.path.basename(filename), filename)) wxMessageDialog.__init__(self, None, msg, _("Alternative Path"), wxYES_NO|wxYES_DEFAULT|wxICON_INFORMATION) def RunDialog(self): val = self.ShowModal() self.Destroy() if val == wxID_YES: return self.filename else: dlg = AltPathFileDialog(self.filename) fname = dlg.RunDialog() return fname Index: application.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/application.py,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- application.py 19 Feb 2004 15:19:39 -0000 1.37 +++ application.py 13 Dec 2004 11:52:34 -0000 1.38 @@ -34,6 +34,7 @@ import tree import mainwindow import dbdialog +import altpathdialog import exceptiondialog from messages import SESSION_REPLACED @@ -59,7 +60,7 @@ # from the application. # Defaults for the directories used in file dialogs - self.path={"data":".", "projection":"."} + self.path={"data":".", "projection":".", "alt_path":""} self.session = None self.top = None @@ -217,7 +218,8 @@ """ self.SetSession(create_empty_session()) - def OpenSession(self, filename, db_connection_callback = None): + def OpenSession(self, filename, db_connection_callback = None, + shapefile_callback = None): """Open the session in the file named filename""" # Make sure we deal with an absolute pathname. Otherwise we can # get problems when saving because the saving code expects an @@ -225,9 +227,12 @@ filename = os.path.abspath(filename) if db_connection_callback is None: db_connection_callback = self.run_db_param_dialog + if shapefile_callback is None: + shapefile_callback = self.run_alt_path_dialog try: session = load_session(filename, - db_connection_callback=db_connection_callback) + db_connection_callback=db_connection_callback, + shapefile_callback=shapefile_callback) except LoadCancelled: return session.SetFilename(filename) @@ -255,6 +260,54 @@ dlg = dbdialog.DBDialog(None, _("DB Connection Parameters"), parameters, message) return dlg.RunDialog() + + # run_alt_path_dialog: Raise a dialog to ask for an alternative path + # if the shapefile couldn't be found. + # TODO: + # - Store a list of already used alternative paths and return these + # iteratively (using a generator) + # - How do we interact with the user to tell him we used a different + # shapefile (location), mode "check"? The current approach with the + # file dialog is not that comfortable. + # + def run_alt_path_dialog(self, filename, mode = None, second_try = 0): + """Implemetation of the shapefile_callback while loading sessions. + + This implements two modes: + - search: Search for an alternative path. If available from a + list of alrady known paths, else interactivly by file dialog. + Currently the "second_try" is important since else the user might + be caught in a loop. + - check: Ask the user for confirmation, if a path from list has + been found successful. + + Returns: + - fname: The full path to the (shape) file. + - from_list: Flags if the path was taken from list or entered + manually. + """ + + if mode == "search": + if self.Path('alt_path') == "" or second_try: + dlg = altpathdialog.AltPathFileDialog(filename) + fname = dlg.RunDialog() + if fname is not None: + self.SetPath('alt_path', fname) + from_list = 0 + else: + fname = os.path.join(self.Path('alt_path'), + os.path.basename(filename)) + from_list = 1 + elif mode == "check": + dlg = altpathdialog.AltPathConfirmDialog(filename) + fname = dlg.RunDialog() + if fname is not None: + self.SetPath('alt_path', fname) + from_list = 0 + else: + fname = None + from_list = 0 + return fname, from_list def SaveSession(self): From cvs at intevation.de Mon Dec 13 12:52:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 12:52:36 +0100 (CET) Subject: frank: thuban/Thuban/Model load.py,1.49,1.50 Message-ID: <20041213115236.8363B102C4A@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv6169/Thuban/Model Modified Files: load.py Log Message: Alternative Path feature: * test/test_load.py (TestAltPath): New, tests for alternative path feature in load_session() (Shapefile_CallBack): Helper, implements controllable callback. * Thuban/UI/application.py (ThubanApplication.OnInit): Added "alt_path" to self.path (ThubanApplication.OpenSession): Added shapefile_callback as second callback similar to db_connection_callback. (ThubanApplication.run_alt_path_dialog): New, implementaion of shapefile_callback. In addition to raising the dialog the control of self.path('alt_path') is implemented here. * Thuban/Model/load.py (SessionLoader.__init__): Added shapefile_callback. (SessionLoader.open_shapefile): Open shapefile, eventually with alternative path. This wrapps the "theSession.OpenShapefile(filename)" formerly used in start_fileshapesource()/start_layer(). (SessionLoader.start_fileshapesource): Call open_shapefile(). (SessionLoader.start_layer): Call open_shapefile(). (load_session): Added shapefile_callback. * Thuban/UI/altpathdialog.py: New, implements dialogs for alternative path feature (search / check). Index: load.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- load.py 3 Oct 2004 21:05:30 -0000 1.49 +++ load.py 13 Dec 2004 11:52:34 -0000 1.50 @@ -3,6 +3,7 @@ # Jan-Oliver Wagner # Bernhard Herzog # Jonathan Coles +# Frank Koormann # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with GRASS for details. @@ -100,12 +101,13 @@ class SessionLoader(XMLReader): - def __init__(self, db_connection_callback = None): + def __init__(self, db_connection_callback = None, + shapefile_callback = None): """Inititialize the Sax handler.""" XMLReader.__init__(self) self.db_connection_callback = db_connection_callback - + self.shapefile_callback = shapefile_callback self.theSession = None self.aMap = None self.aLayer = None @@ -258,6 +260,41 @@ normalized[d.name] = value return normalized + def open_shapefile(self, filename): + """Open shapefile, eventually with alternative path.""" + from_list = 0 + while 1: + try: + store = self.theSession.OpenShapefile(filename) + if from_list: + # The correct? path has been guessed from a list + # Let the user confirm - or select an alternative. + filename, from_list = self.shapefile_callback( + filename, "check") + if filename is None: + # Selection cancelled + raise LoadCancelled + elif store.FileName() == filename: + # Proposed file has been accepted + break + else: + # the filename has been changed, try the new file + pass + else: + break + except IOError: + if self.shapefile_callback is not None: + filename, from_list = self.shapefile_callback( + filename, + mode = "search", + second_try = from_list) + if filename is None: + raise LoadCancelled + print filename + else: + raise + return store + def start_dbconnection(self, name, qname, attrs): attrs = self.check_attrs(name, attrs, [AttrDesc("id", True), @@ -333,7 +370,7 @@ filetype = attrs["filetype"] if filetype != "shapefile": raise LoadError("shapesource filetype %r not supported" % filetype) - self.idmap[ID] = self.theSession.OpenShapefile(filename) + self.idmap[ID] = self.open_shapefile(filename) def start_derivedshapesource(self, name, qname, attrs): attrs = self.check_attrs(name, attrs, @@ -444,7 +481,8 @@ if attrs.has_key((None, "shapestore")): store = self.idmap[attrs[(None, "shapestore")]] else: - store = self.theSession.OpenShapefile(filename) + store = self.open_shapefile(filename) + self.aLayer = layer_class(title, store, fill = fill, stroke = stroke, lineWidth = stroke_width, @@ -587,7 +625,8 @@ pass -def load_session(filename, db_connection_callback = None): +def load_session(filename, db_connection_callback = None, + shapefile_callback = None): """Load a Thuban session from the file object file The db_connection_callback, if given should be a callable object @@ -600,7 +639,7 @@ corrected and perhaps additional parameters like a password or None to indicate that the user cancelled. """ - handler = SessionLoader(db_connection_callback) + handler = SessionLoader(db_connection_callback, shapefile_callback) handler.read(filename) session = handler.theSession From cvs at intevation.de Mon Dec 13 12:53:17 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 12:53:17 +0100 (CET) Subject: frank: thuban/Doc/manual thuban-manual.xml,1.27,1.28 Message-ID: <20041213115317.91CDC102C3E@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/Doc/manual In directory doto:/tmp/cvs-serv6297/Doc/manual Modified Files: thuban-manual.xml Log Message: Added documentation of Alternative Path feature Index: thuban-manual.xml =================================================================== RCS file: /thubanrepository/thuban/Doc/manual/thuban-manual.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- thuban-manual.xml 1 Aug 2004 21:31:30 -0000 1.27 +++ thuban-manual.xml 13 Dec 2004 11:53:15 -0000 1.28 @@ -498,10 +498,22 @@ for a Thuban Session file. Thuban session files end with .thuban. Selecting a file a clicking OK will load the session into Thuban. + + If a session is already loaded and has been modified without being saved a prompt will ask if the current session should be saved. + + + + Thuban provides a path recovery feature: If a (shape) file referenced + in a Thuban session cannot be found at the specified location, the user + is prompted a file dialog. Here a new location can be selected for the + currents layer data source. Cancelling the dialog removes the layer + from the session. If a new location has been selected, Thuban checks + this again, if further layers data sources are missing. The user is + informed about this and can accept or cancel the suggestion. From cvs at intevation.de Mon Dec 13 12:53:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 12:53:53 +0100 (CET) Subject: frank: thuban ChangeLog,1.725,1.726 Message-ID: <20041213115353.65112102C4F@lists.intevation.de> Author: frank Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv6325 Modified Files: ChangeLog Log Message: Added Alternative Path feature Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.725 retrieving revision 1.726 diff -u -d -r1.725 -r1.726 --- ChangeLog 11 Dec 2004 03:24:36 -0000 1.725 +++ ChangeLog 13 Dec 2004 11:53:51 -0000 1.726 @@ -1,3 +1,35 @@ +2004-12-13 Frank Koormann + + Alternative Path feature: When loading a (moved) session where + shapefiles cannot be found, ask the user. Use the specified path + if further shapefiles are missing. However, ask the usr for confirmation + in such cases. + + * test/test_load.py (TestAltPath): New, tests for alternative path feature + in load_session() + (Shapefile_CallBack): Helper, implements controllable callback. + + * Thuban/UI/application.py (ThubanApplication.OnInit): + Added "alt_path" to self.path + (ThubanApplication.OpenSession): Added shapefile_callback as second + callback similar to db_connection_callback. + (ThubanApplication.run_alt_path_dialog): New, implementaion of + shapefile_callback. In addition to raising the dialog the control of + self.path('alt_path') is implemented here. + + * Thuban/Model/load.py (SessionLoader.__init__): Added shapefile_callback. + (SessionLoader.open_shapefile): Open shapefile, eventually with + alternative path. This wrapps the "theSession.OpenShapefile(filename)" + formerly used in start_fileshapesource()/start_layer(). + (SessionLoader.start_fileshapesource): Call open_shapefile(). + (SessionLoader.start_layer): Call open_shapefile(). + (load_session): Added shapefile_callback. + + * Thuban/UI/altpathdialog.py: New, implements dialogs for alternative path + feature (search / check). + + * Doc/manual/thuban-manual.xml: Added documentation of new feature. + 2004-12-11 Bernhard Reiter svgexport 0.9.2: Point size supports for maps. From bh at intevation.de Mon Dec 13 14:03:50 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 14:03:50 +0100 Subject: frank: thuban/Thuban/Model load.py,1.49,1.50 In-Reply-To: <20041213115236.8363B102C4A@lists.intevation.de> (cvs@intevation.de's message of "Mon, 13 Dec 2004 12:52:36 +0100 (CET)") References: <20041213115236.8363B102C4A@lists.intevation.de> Message-ID: cvs at intevation.de writes: > Index: load.py > =================================================================== > RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v > retrieving revision 1.49 > retrieving revision 1.50 > diff -u -d -r1.49 -r1.50 > --- load.py 3 Oct 2004 21:05:30 -0000 1.49 > +++ load.py 13 Dec 2004 11:52:34 -0000 1.50 > @@ -258,6 +260,41 @@ > normalized[d.name] = value > return normalized > > + def open_shapefile(self, filename): > + """Open shapefile, eventually with alternative path.""" s/eventually/possibly/ I guess English "eventually" != German "eventuell" Might be best to extend the doc-string to make clearer what is supposed to happen. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 13 14:37:42 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 14:37:42 +0100 (CET) Subject: frank: thuban/Thuban/Model load.py,1.50,1.51 Message-ID: <20041213133742.5E8DB102C53@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv8277/Thuban/Model Modified Files: load.py Log Message: Updated docstring for SessionLoader.open_shapefile Index: load.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- load.py 13 Dec 2004 11:52:34 -0000 1.50 +++ load.py 13 Dec 2004 13:37:40 -0000 1.51 @@ -261,13 +261,24 @@ return normalized def open_shapefile(self, filename): - """Open shapefile, eventually with alternative path.""" + """Open shapefile, with alternative path handling. + + If a shapefile cannot be opened and an IOError is raised, check for + an alternative. This alternative can be specified interactively by + the user or taken from a list of (potential) locations, depending on + the callback implementation. + + The alternative is rechecked. If taken from a list the user + has to confirm the alternative. + """ + + # Flag if the alternative path was specified interactively / from list. from_list = 0 while 1: try: store = self.theSession.OpenShapefile(filename) if from_list: - # The correct? path has been guessed from a list + # A valid path has been guessed from a list # Let the user confirm - or select an alternative. filename, from_list = self.shapefile_callback( filename, "check") From bh at intevation.de Mon Dec 13 15:57:53 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 15:57:53 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.11, 1.12 In-Reply-To: <20041211020349.9F4C4102C2D@lists.intevation.de> (cvs@intevation.de's message of "Sat, 11 Dec 2004 03:03:49 +0100 (CET)") References: <20041211020349.9F4C4102C2D@lists.intevation.de> Message-ID: cvs at intevation.de writes: > Index: test_svgmapwriter.py > =================================================================== > RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v > retrieving revision 1.11 > retrieving revision 1.12 > diff -u -d -r1.11 -r1.12 > --- test_svgmapwriter.py 7 Dec 2004 14:00:12 -0000 1.11 > +++ test_svgmapwriter.py 11 Dec 2004 02:03:47 -0000 1.12 > @@ -201,10 +182,55 @@ > self.assertEquals(xmlsupport.sax_eventlist(data = data), > xmlsupport.sax_eventlist(data = file.getvalue())) > > +class TestDrawSplines(TestVirtualDC): First, do you realise that you inflate the number of tests by deriving from a baseclass that defines test_* methods? All tests defined in the base class are run and counted twice! That kind of thing can be quite useful but it doesn't do any good in this case. Examples where tests defined in base classes are useful in include - Python's test/test_sets.py - Thuban's mix-in TableTests and the derived classes TestPostGISTable and TestPostGISTableExplicitGIDColumn in test/test_postgis_db.py > + """Testing DrawSpline variations. > + See comments in DrawSpline(). > + """ > + > + def setUp(self): > + super(TestDrawSplines,self).setUp() I get errors at this point when running the tests with Python 2.2.1 (the oldest python version supported by Thuban): File "../Extensions/svgexport/test/test_svgmapwriter.py", line 191, in setUp super(TestDrawSplines,self).setUp() TypeError: super() argument 1 must be type, not class The builtin super only works with new-style classes. In Python 2.3, unittest.TestCase and other classes in unittest are new-style classes, but in 2.2 they are still "old-style" classes. I'll change this line to the backwards compatible TestVirtualDC.setUp(self) Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 13 15:59:26 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 15:59:26 +0100 (CET) Subject: bh: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.13, 1.14 Message-ID: <20041213145926.DCFA2102C77@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv9875/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: (TestDrawSplines.setUp): Do not use super with the unittest classes because in Python 2.2 they're still old-style classes. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test_svgmapwriter.py 11 Dec 2004 02:25:36 -0000 1.13 +++ test_svgmapwriter.py 13 Dec 2004 14:59:24 -0000 1.14 @@ -188,7 +188,7 @@ """ def setUp(self): - super(TestDrawSplines,self).setUp() + TestVirtualDC.setUp(self) self.dataframe = ('') From cvs at intevation.de Mon Dec 13 15:59:27 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 15:59:27 +0100 (CET) Subject: bh: thuban ChangeLog,1.726,1.727 Message-ID: <20041213145927.05E05102C7B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv9875 Modified Files: ChangeLog Log Message: (TestDrawSplines.setUp): Do not use super with the unittest classes because in Python 2.2 they're still old-style classes. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.726 retrieving revision 1.727 diff -u -d -r1.726 -r1.727 --- ChangeLog 13 Dec 2004 11:53:51 -0000 1.726 +++ ChangeLog 13 Dec 2004 14:59:24 -0000 1.727 @@ -1,3 +1,9 @@ +2004-12-13 Bernhard Herzog + + * Extensions/svgexport/test/test_svgmapwriter.py + (TestDrawSplines.setUp): Do not use super with the unittest + classes because in Python 2.2 they're still old-style classes. + 2004-12-13 Frank Koormann Alternative Path feature: When loading a (moved) session where From bh at intevation.de Mon Dec 13 16:15:06 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 16:15:06 +0100 Subject: frank: thuban/test test_load.py,1.39,1.40 In-Reply-To: <20041213115236.7778F102C3E@lists.intevation.de> (cvs@intevation.de's message of "Mon, 13 Dec 2004 12:52:36 +0100 (CET)") References: <20041213115236.7778F102C3E@lists.intevation.de> Message-ID: cvs at intevation.de writes: > Index: test_load.py > =================================================================== > RCS file: /thubanrepository/thuban/test/test_load.py,v > retrieving revision 1.39 > retrieving revision 1.40 > diff -u -d -r1.39 -r1.40 > --- test_load.py 3 Oct 2004 20:49:24 -0000 1.39 > +++ test_load.py 13 Dec 2004 11:52:34 -0000 1.40 [...] > + def test_01_single_path_error_fix(self): > + """Test single file path error fix.""" > + # The usual initial case > + s_cb = Shapefile_CallBack({ > + "search": [("../Data/iceland/roads-line.shp",0)], > + "check": [(None, None)]}) > + self.session = load_session(self.filename(), > + shapefile_callback =s_cb.s_cb) > + self.session.Destroy() > + self.session = None What's this test and the other new tests that never call an assert* method actually testing? How do you know the callback was called? How do you know the return values of the callback were actually honored? Also, the self.session.Destroy() call is not necessary. That's already taken care of by tearDown. Finally, there's no need to put numbers into the method names. The order in which the tests are executed should not matter at all. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From frank.koormann at intevation.de Mon Dec 13 16:39:13 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Mon, 13 Dec 2004 16:39:13 +0100 Subject: frank: thuban/test test_load.py,1.39,1.40 In-Reply-To: References: <20041213115236.7778F102C3E@lists.intevation.de> Message-ID: <20041213153913.GA1243@intevation.de> * Bernhard Herzog [041213 16:15]: > > Index: test_load.py > > =================================================================== > > RCS file: /thubanrepository/thuban/test/test_load.py,v > > retrieving revision 1.39 > > retrieving revision 1.40 > > diff -u -d -r1.39 -r1.40 > > --- test_load.py 3 Oct 2004 20:49:24 -0000 1.39 > > +++ test_load.py 13 Dec 2004 11:52:34 -0000 1.40 > [...] > > + def test_01_single_path_error_fix(self): [...] > > What's this test and the other new tests that never call an assert* > method actually testing? How do you know the callback was called? How > do you know the return values of the callback were actually honored? > > Also, the self.session.Destroy() call is not necessary. That's already > taken care of by tearDown. The test is relatively brute force: The defined session is not correct. If load_session() and therewith SessionLoader.open_shapefile() fails, self.session will be None. This will cause an error when trying to issue self.session.Destroy(). So IMHO the test does testing. If I find the time I can smooth the test to actually check for some session attributes. Additionally I figured out that the explicit self.session.Destroy() makes the test output clearer: If not called I get a bunch of messages like |0x413f250c LAYER_VISIBILITY_CHANGED | method forward of Seems as if the sessions are not destroyed early enough. > Finally, there's no need to put numbers into the method names. The > order in which the tests are executed should not matter at all. These numbers make a difference in meaning of reporting. The GREAT-ER version of runtest.py reports the doc strings of the tests and I like these to be in a sensible order. Frank -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.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/20041213/00931e68/attachment.bin From frank.koormann at intevation.de Mon Dec 13 16:43:14 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Mon, 13 Dec 2004 16:43:14 +0100 Subject: frank: thuban/test test_load.py,1.39,1.40 In-Reply-To: <20041213153913.GA1243@intevation.de> References: <20041213115236.7778F102C3E@lists.intevation.de> <20041213153913.GA1243@intevation.de> Message-ID: <20041213154313.GB1243@intevation.de> * Frank Koormann [041213 16:39]: > Additionally I figured out that the explicit self.session.Destroy() > makes the test output clearer: If not called I get a bunch of messages > like > > |0x413f250c LAYER_VISIBILITY_CHANGED > | method forward of > > Seems as if the sessions are not destroyed early enough. Forget this, its obviously due to the explicit self.session = None . -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.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/20041213/479d3d7c/attachment.bin From bernhard at intevation.de Mon Dec 13 16:50:31 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 13 Dec 2004 16:50:31 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.11, 1.12 In-Reply-To: References: <20041211020349.9F4C4102C2D@lists.intevation.de> Message-ID: <20041213155031.GO17099@intevation.de> On Mon, Dec 13, 2004 at 03:57:53PM +0100, Bernhard Herzog wrote: > cvs at intevation.de writes: > > + def setUp(self): > > + super(TestDrawSplines,self).setUp() > > I get errors at this point when running the tests with Python 2.2.1 (the > oldest python version supported by Thuban): > > File "../Extensions/svgexport/test/test_svgmapwriter.py", line 191, in setUp > super(TestDrawSplines,self).setUp() > TypeError: super() argument 1 must be type, not class > > The builtin super only works with new-style classes. In Python 2.3, > unittest.TestCase and other classes in unittest are new-style classes, > but in 2.2 they are still "old-style" classes. > > I'll change this line to the backwards compatible > > TestVirtualDC.setUp(self) Thanks for noticing, I had checked that super was available with 2.2, but missed the old-styleness of the test classes. -------------- 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/20041213/2a6f776c/attachment.bin From bernhard at intevation.de Mon Dec 13 16:51:58 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 13 Dec 2004 16:51:58 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.11, 1.12 In-Reply-To: References: <20041211020349.9F4C4102C2D@lists.intevation.de> Message-ID: <20041213155158.GP17099@intevation.de> On Mon, Dec 13, 2004 at 03:57:53PM +0100, Bernhard Herzog wrote: > > +class TestDrawSplines(TestVirtualDC): > > First, do you realise that you inflate the number of tests by deriving > from a baseclass that defines test_* methods? Arg, no! What a stupid mistake, good that you have noticed it. > All tests defined in the > base class are run and counted twice! That kind of thing can be quite > useful but it doesn't do any good in this case. -------------- 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/20041213/dc466299/attachment.bin From bh at intevation.de Mon Dec 13 17:30:06 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 17:30:06 +0100 Subject: frank: thuban/test test_load.py,1.39,1.40 In-Reply-To: <20041213153913.GA1243@intevation.de> (Frank Koormann's message of "Mon, 13 Dec 2004 16:39:13 +0100") References: <20041213115236.7778F102C3E@lists.intevation.de> <20041213153913.GA1243@intevation.de> Message-ID: Frank Koormann writes: >> What's this test and the other new tests that never call an assert* >> method actually testing? How do you know the callback was called? How >> do you know the return values of the callback were actually honored? [...] > The test is relatively brute force: The defined session is not correct. > If load_session() and therewith SessionLoader.open_shapefile() fails, > self.session will be None. No. If loading the session fails you get an exception from load_session. > This will cause an error when trying to issue > self.session.Destroy(). It won't catch other things, though. The loader could cope with missing shapefiles by removing those shapestores and anything that depends on them from the session instead of calling the callback. That would still return a valid session object and the test would still pass. > So IMHO the test does testing. It only tests whether load_session does not raise errors. That's not enough IMO. > If I find the time I can smooth the test > to actually check for some session attributes. That would be better. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 13 18:51:13 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 18:51:13 +0100 (CET) Subject: bh: thuban/test test_load.py,1.40,1.41 Message-ID: <20041213175113.13B68102C7E@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv13016/test Modified Files: test_load.py Log Message: * test/test_load.py (TestAltPath.test_01_single_path_error_fix) (TestAltPath.test_02_path_error_fix_from_list) (TestAltPath.test_05_path_error_fix_from_list_changed) (TestAltPath.test_06_path_error_fix_from_list_fails): self.session is destroyed in tearDown, so there's no need to do it in a test case. * Thuban/Model/load.py (SessionLoader.open_shapefile): Remove a debug print Index: test_load.py =================================================================== RCS file: /thubanrepository/thuban/test/test_load.py,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- test_load.py 13 Dec 2004 11:52:34 -0000 1.40 +++ test_load.py 13 Dec 2004 17:51:11 -0000 1.41 @@ -1036,8 +1036,6 @@ "check": [(None, None)]}) self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) - self.session.Destroy() - self.session = None def test_02_path_error_fix_from_list(self): """Test single file path error fix.""" @@ -1048,8 +1046,6 @@ }) self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) - self.session.Destroy() - self.session = None def test_03_single_path_error_cancelled(self): """Test alternative path cancelled.""" @@ -1076,8 +1072,6 @@ }) self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) - self.session.Destroy() - self.session = None def test_06_path_error_fix_from_list_fails(self): """Test alternative path recovery from list.""" @@ -1091,8 +1085,6 @@ self.assertRaises(IndexError, s_cb.s_cb, None, "search") - self.session.Destroy() - self.session = None if __name__ == "__main__": From cvs at intevation.de Mon Dec 13 18:51:13 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 18:51:13 +0100 (CET) Subject: bh: thuban/Thuban/Model load.py,1.51,1.52 Message-ID: <20041213175113.1D4FC102C87@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv13016/Thuban/Model Modified Files: load.py Log Message: * test/test_load.py (TestAltPath.test_01_single_path_error_fix) (TestAltPath.test_02_path_error_fix_from_list) (TestAltPath.test_05_path_error_fix_from_list_changed) (TestAltPath.test_06_path_error_fix_from_list_fails): self.session is destroyed in tearDown, so there's no need to do it in a test case. * Thuban/Model/load.py (SessionLoader.open_shapefile): Remove a debug print Index: load.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- load.py 13 Dec 2004 13:37:40 -0000 1.51 +++ load.py 13 Dec 2004 17:51:11 -0000 1.52 @@ -301,7 +301,6 @@ second_try = from_list) if filename is None: raise LoadCancelled - print filename else: raise return store From cvs at intevation.de Mon Dec 13 18:51:13 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 18:51:13 +0100 (CET) Subject: bh: thuban ChangeLog,1.727,1.728 Message-ID: <20041213175113.2EB69102C8A@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv13016 Modified Files: ChangeLog Log Message: * test/test_load.py (TestAltPath.test_01_single_path_error_fix) (TestAltPath.test_02_path_error_fix_from_list) (TestAltPath.test_05_path_error_fix_from_list_changed) (TestAltPath.test_06_path_error_fix_from_list_fails): self.session is destroyed in tearDown, so there's no need to do it in a test case. * Thuban/Model/load.py (SessionLoader.open_shapefile): Remove a debug print Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.727 retrieving revision 1.728 diff -u -d -r1.727 -r1.728 --- ChangeLog 13 Dec 2004 14:59:24 -0000 1.727 +++ ChangeLog 13 Dec 2004 17:51:11 -0000 1.728 @@ -1,5 +1,17 @@ 2004-12-13 Bernhard Herzog + * test/test_load.py (TestAltPath.test_01_single_path_error_fix) + (TestAltPath.test_02_path_error_fix_from_list) + (TestAltPath.test_05_path_error_fix_from_list_changed) + (TestAltPath.test_06_path_error_fix_from_list_fails): self.session + is destroyed in tearDown, so there's no need to do it in a test + case. + + * Thuban/Model/load.py (SessionLoader.open_shapefile): Remove a + debug print + +2004-12-13 Bernhard Herzog + * Extensions/svgexport/test/test_svgmapwriter.py (TestDrawSplines.setUp): Do not use super with the unittest classes because in Python 2.2 they're still old-style classes. From cvs at intevation.de Mon Dec 13 18:54:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 18:54:38 +0100 (CET) Subject: bh: thuban/libraries/pyprojection Projection.py, 1.1, 1.2 Projection.i, 1.2, 1.3 Message-ID: <20041213175438.84A9F102C83@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/libraries/pyprojection In directory doto:/tmp/cvs-serv13221/libraries/pyprojection Modified Files: Projection.py Projection.i Log Message: * libraries/pyprojection/Projection.i: Work around a bug in the generated python code which leads to exception in the __del__ method when the constructor fails. See the comments in the code for more details. * libraries/pyprojection/Projection.py: Updated from Projection.i with SWIG. Index: Projection.py =================================================================== RCS file: /thubanrepository/thuban/libraries/pyprojection/Projection.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Projection.py 19 Aug 2003 21:19:59 -0000 1.1 +++ Projection.py 13 Dec 2004 17:54:36 -0000 1.2 @@ -36,6 +36,11 @@ raise AttributeError,name def __repr__(self): return "" % (self.this,) + + def __del__(self,Projectionc=Projectionc): + if getattr(self, 'thisown', 0): + Projectionc.delete_Projection(self) + class ProjectionPtr(Projection): def __init__(self,this): self.this = this Index: Projection.i =================================================================== RCS file: /thubanrepository/thuban/libraries/pyprojection/Projection.i,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Projection.i 29 Aug 2003 09:49:09 -0000 1.2 +++ Projection.i 13 Dec 2004 17:54:36 -0000 1.3 @@ -155,6 +155,20 @@ return PyCObject_FromVoidPtr(self->proj, NULL); } + + /* The __del__ method generated by the old SWIG version we're + * tries to access self.thisown which may not be set at all when + * there was an exception during construction. Therefore we + * override it with our own version. + * FIXME: It would be better to upgrade to a newer SWIG version + * or to get rid of SWIG entirely. + */ + %pragma(python) addtoclass = " + def __del__(self,Projectionc=Projectionc): + if getattr(self, 'thisown', 0): + Projectionc.delete_Projection(self) + " + } } Projection; From cvs at intevation.de Mon Dec 13 18:54:38 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 18:54:38 +0100 (CET) Subject: bh: thuban ChangeLog,1.728,1.729 Message-ID: <20041213175438.87E8F102C87@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv13221 Modified Files: ChangeLog Log Message: * libraries/pyprojection/Projection.i: Work around a bug in the generated python code which leads to exception in the __del__ method when the constructor fails. See the comments in the code for more details. * libraries/pyprojection/Projection.py: Updated from Projection.i with SWIG. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.728 retrieving revision 1.729 diff -u -d -r1.728 -r1.729 --- ChangeLog 13 Dec 2004 17:51:11 -0000 1.728 +++ ChangeLog 13 Dec 2004 17:54:36 -0000 1.729 @@ -1,5 +1,15 @@ 2004-12-13 Bernhard Herzog + * libraries/pyprojection/Projection.i: Work around a bug in the + generated python code which leads to exception in the __del__ + method when the constructor fails. See the comments in the code + for more details. + + * libraries/pyprojection/Projection.py: Updated from Projection.i + with SWIG. + +2004-12-13 Bernhard Herzog + * test/test_load.py (TestAltPath.test_01_single_path_error_fix) (TestAltPath.test_02_path_error_fix_from_list) (TestAltPath.test_05_path_error_fix_from_list_changed) From cvs at intevation.de Mon Dec 13 18:57:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 18:57:06 +0100 (CET) Subject: bh: thuban/libraries/pyshapelib dbflib.py, 1.3, 1.4 dbflib.i, 1.4, 1.5 ChangeLog, 1.6, 1.7 Message-ID: <20041213175706.2B50F102C83@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/libraries/pyshapelib In directory doto:/tmp/cvs-serv13305/libraries/pyshapelib Modified Files: dbflib.py dbflib.i ChangeLog Log Message: * dbflib.py: Updated from difflib.i with SWIG. * dbflib.i: Work around a bug in the generated python code which leads to exception in the __del__ method when the constructor fails. See the comments in the code for more details. Index: dbflib.py =================================================================== RCS file: /thubanrepository/thuban/libraries/pyshapelib/dbflib.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dbflib.py 17 May 2004 15:47:57 -0000 1.3 +++ dbflib.py 13 Dec 2004 17:57:04 -0000 1.4 @@ -38,6 +38,11 @@ def __repr__(self): return "" % (self.this,) if not dbflibc._have_commit: del commit + + def __del__(self,dbflibc=dbflibc): + if getattr(self, 'thisown', 0): + dbflibc.delete_DBFFile(self) + class DBFFilePtr(DBFFile): def __init__(self,this): self.this = this Index: dbflib.i =================================================================== RCS file: /thubanrepository/thuban/libraries/pyshapelib/dbflib.i,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dbflib.i 17 May 2004 15:47:57 -0000 1.4 +++ dbflib.i 13 Dec 2004 17:57:04 -0000 1.5 @@ -529,6 +529,20 @@ */ %pragma(python) addtomethod="__class__:if not dbflibc._have_commit: del commit" + /* The __del__ method generated by the old SWIG version we're + * tries to access self.thisown which may not be set at all when + * there was an exception during construction. Therefore we + * override it with our own version. + * FIXME: It would be better to upgrade to a newer SWIG version + * or to get rid of SWIG entirely. + */ + %pragma(python) addtoclass = " + def __del__(self,dbflibc=dbflibc): + if getattr(self, 'thisown', 0): + dbflibc.delete_DBFFile(self) + " + + } } DBFFile; Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/libraries/pyshapelib/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ChangeLog 28 May 2004 19:07:27 -0000 1.6 +++ ChangeLog 13 Dec 2004 17:57:04 -0000 1.7 @@ -1,3 +1,11 @@ +2004-12-13 Bernhard Herzog + + * dbflib.py: Updated from difflib.i with SWIG. + + * dbflib.i: Work around a bug in the generated python code which + leads to exception in the __del__ method when the constructor + fails. See the comments in the code for more details. + 2004-05-28 Bernhard Herzog * README: Flesh out the some more. Correct the shapelib From cvs at intevation.de Mon Dec 13 19:26:14 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 19:26:14 +0100 (CET) Subject: bh: thuban/Thuban/UI view.py,1.62,1.63 renderer.py,1.51,1.52 Message-ID: <20041213182614.08688102BFC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv13708/Thuban/UI Modified Files: view.py renderer.py Log Message: * Thuban/UI/view.py (MapPrintout.draw_on_dc): The region for the renderer has to be at the same position as the mapregion * Thuban/UI/renderer.py (ExportRenderer.RenderMap): self.region has to be moved by (self.shiftx, self.shifty) too. Index: view.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/view.py,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- view.py 17 Feb 2004 13:14:49 -0000 1.62 +++ view.py 13 Dec 2004 18:26:11 -0000 1.63 @@ -94,7 +94,7 @@ canvas_scale = self.canvas.scale x, y, width, height = self.region renderer = PrinterRenderer(dc, self.map, scale, offset, - region = (0, 0, + region = (mapregion[0], mapregion[1], (width/canvas_scale)*scale, (height/canvas_scale)*scale), resolution = resy, Index: renderer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/renderer.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- renderer.py 5 Dec 2004 15:03:44 -0000 1.51 +++ renderer.py 13 Dec 2004 18:26:11 -0000 1.52 @@ -268,6 +268,7 @@ self.shifty = (mmaxy - mminy)*0.5 - (ury - lly)*0.5 self.offset = (offx+self.shiftx, offy+self.shifty) + self.region = (llx + self.shiftx, lly + self.shifty, urx, ury) # Draw the map self.dc.BeginDrawing() From cvs at intevation.de Mon Dec 13 19:26:14 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 19:26:14 +0100 (CET) Subject: bh: thuban ChangeLog,1.729,1.730 Message-ID: <20041213182614.1357C102C8A@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv13708 Modified Files: ChangeLog Log Message: * Thuban/UI/view.py (MapPrintout.draw_on_dc): The region for the renderer has to be at the same position as the mapregion * Thuban/UI/renderer.py (ExportRenderer.RenderMap): self.region has to be moved by (self.shiftx, self.shifty) too. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.729 retrieving revision 1.730 diff -u -d -r1.729 -r1.730 --- ChangeLog 13 Dec 2004 17:54:36 -0000 1.729 +++ ChangeLog 13 Dec 2004 18:26:11 -0000 1.730 @@ -1,5 +1,18 @@ 2004-12-13 Bernhard Herzog + Make sure the region used to determine which shapes are visible + actually matches the region on the printed page. If this isn't + done properly some shapes might not be printed. + Fixes RT #2692 + + * Thuban/UI/view.py (MapPrintout.draw_on_dc): The region for the + renderer has to be at the same position as the mapregion + + * Thuban/UI/renderer.py (ExportRenderer.RenderMap): self.region + has to be moved by (self.shiftx, self.shifty) too. + +2004-12-13 Bernhard Herzog + * libraries/pyprojection/Projection.i: Work around a bug in the generated python code which leads to exception in the __del__ method when the constructor fails. See the comments in the code From bernhard at intevation.de Mon Dec 13 19:30:16 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 13 Dec 2004 19:30:16 +0100 Subject: bh: thuban/libraries/pyprojection Projection.py, 1.1, 1.2 Projection.i, 1.2, 1.3 In-Reply-To: <20041213175438.84A9F102C83@lists.intevation.de> References: <20041213175438.84A9F102C83@lists.intevation.de> Message-ID: <20041213183016.GA12086@intevation.de> On Mon, Dec 13, 2004 at 06:54:38PM +0100, cvs at intevation.de wrote: > Author: bh > + /* The __del__ method generated by the old SWIG version we're Is there a "using" missing at the end of the line? > + * tries to access self.thisown which may not be set at all when > + * there was an exception during construction. Therefore we > + * override it with our own version. > + * FIXME: It would be better to upgrade to a newer SWIG version > + * or to get rid of SWIG entirely. -------------- 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/20041213/f98802fc/attachment.bin From bh at intevation.de Mon Dec 13 19:31:26 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 19:31:26 +0100 Subject: bh: thuban/libraries/pyprojection Projection.py, 1.1, 1.2 Projection.i, 1.2, 1.3 In-Reply-To: <20041213183016.GA12086@intevation.de> (Bernhard Reiter's message of "Mon, 13 Dec 2004 19:30:16 +0100") References: <20041213175438.84A9F102C83@lists.intevation.de> <20041213183016.GA12086@intevation.de> Message-ID: Bernhard Reiter writes: > On Mon, Dec 13, 2004 at 06:54:38PM +0100, cvs at intevation.de wrote: >> Author: bh > >> + /* The __del__ method generated by the old SWIG version we're > > Is there a "using" missing at the end of the line? Yes. Any other typo? Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 13 20:02:08 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 20:02:08 +0100 (CET) Subject: bh: thuban/Thuban/UI view.py, 1.62, 1.62.2.1 renderer.py, 1.49, 1.49.2.1 Message-ID: <20041213190208.45679102C16@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv14102/Thuban/UI Modified Files: Tag: thuban-1-0-branch view.py renderer.py Log Message: Backport from HEAD: Make sure the region used to determine which shapes are visible actually matches the region on the printed page. If this isn't done properly some shapes might not be printed. Fixes RT #2692 * Thuban/UI/view.py (MapPrintout.draw_on_dc): The region for the renderer has to be at the same position as the mapregion * Thuban/UI/renderer.py (ExportRenderer.RenderMap): self.region has to be moved by (self.shiftx, self.shifty) too. Index: view.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/view.py,v retrieving revision 1.62 retrieving revision 1.62.2.1 diff -u -d -r1.62 -r1.62.2.1 --- view.py 17 Feb 2004 13:14:49 -0000 1.62 +++ view.py 13 Dec 2004 19:02:06 -0000 1.62.2.1 @@ -94,7 +94,7 @@ canvas_scale = self.canvas.scale x, y, width, height = self.region renderer = PrinterRenderer(dc, self.map, scale, offset, - region = (0, 0, + region = (mapregion[0], mapregion[1], (width/canvas_scale)*scale, (height/canvas_scale)*scale), resolution = resy, Index: renderer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/renderer.py,v retrieving revision 1.49 retrieving revision 1.49.2.1 diff -u -d -r1.49 -r1.49.2.1 --- renderer.py 11 Nov 2003 18:16:42 -0000 1.49 +++ renderer.py 13 Dec 2004 19:02:06 -0000 1.49.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2001, 2002, 2003 by Intevation GmbH +# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH # Authors: # Bernhard Herzog # Jonathan Coles @@ -235,6 +235,7 @@ self.shifty = (mmaxy - mminy)*0.5 - (ury - lly)*0.5 self.offset = (offx+self.shiftx, offy+self.shifty) + self.region = (llx + self.shiftx, lly + self.shifty, urx, ury) # Draw the map self.dc.BeginDrawing() From cvs at intevation.de Mon Dec 13 20:02:08 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 13 Dec 2004 20:02:08 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.11,1.624.2.12 Message-ID: <20041213190208.5FC22102C35@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv14102 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: Backport from HEAD: Make sure the region used to determine which shapes are visible actually matches the region on the printed page. If this isn't done properly some shapes might not be printed. Fixes RT #2692 * Thuban/UI/view.py (MapPrintout.draw_on_dc): The region for the renderer has to be at the same position as the mapregion * Thuban/UI/renderer.py (ExportRenderer.RenderMap): self.region has to be moved by (self.shiftx, self.shifty) too. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.11 retrieving revision 1.624.2.12 diff -u -d -r1.624.2.11 -r1.624.2.12 --- ChangeLog 27 Nov 2004 21:31:07 -0000 1.624.2.11 +++ ChangeLog 13 Dec 2004 19:02:06 -0000 1.624.2.12 @@ -1,3 +1,17 @@ +2004-12-13 Bernhard Herzog + + Backport from HEAD: Make sure the region used to determine which + shapes are visible actually matches the region on the printed + page. If this isn't done properly some shapes might not be + printed. + Fixes RT #2692 + + * Thuban/UI/view.py (MapPrintout.draw_on_dc): The region for the + renderer has to be at the same position as the mapregion + + * Thuban/UI/renderer.py (ExportRenderer.RenderMap): self.region + has to be moved by (self.shiftx, self.shifty) too. + 2004-11-27 Jan-Oliver Wagner New translation and backport of encoding unicode/locale. From bh at intevation.de Mon Dec 13 20:39:17 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 13 Dec 2004 20:39:17 +0100 Subject: nhueffme: thuban/Extensions/ogr/test __init__.py, NONE, 1.1 test_OGRShapestore.py, NONE, 1.1 In-Reply-To: <20041207164453.BD42D102C56@lists.intevation.de> (cvs@intevation.de's message of "Tue, 7 Dec 2004 17:44:53 +0100 (CET)") References: <20041207164453.BD42D102C56@lists.intevation.de> Message-ID: cvs at intevation.de writes: > --- NEW FILE: test_OGRShapestore.py --- One more thing: If ogr is not installed, i.e. when import ogr raises an ImportError, the tests fail with Traceback (most recent call last): File "../Extensions/ogr/test/test_OGRShapestore.py", line 49, in setUp self.store = OGRShapeStore(self.session, self.filename, "roads-line") File "../Extensions/ogr/ogrshapes.py", line 113, in __init__ self.ogrdatasource = ogr.Open(self.filename) AttributeError: 'NoneType' object has no attribute 'Open' The tests should raise SkipTest when ogr is not available. It's best to do that in the setUp method, so that you don't have to put it into each and every test_* method. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From thuban-bugs at intevation.de Tue Dec 14 05:27:44 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Tue, 14 Dec 2004 05:27:44 +0100 (CET) Subject: [bug #2843] (thuban) scroll wheel Message-ID: <20041214042744.BC8B4102C00@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2843 ------------------------------------------------------------------------- Subject: scroll wheel Operating System: GNU/Linux, FC2 Thuban version: other, 1.0.0 wxPython version: other, 2.4.2 Python version: other, 2.3.3 It would be nice if the scroll wheel was supported. I would like the scroll wheel to scroll in and out. -------------------------------------------- Managed by Request Tracker From thuban-bugs at intevation.de Tue Dec 14 07:30:56 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Tue, 14 Dec 2004 07:30:56 +0100 (CET) Subject: [bug #2844] (thuban) Raster in UTM, data in Lat/Lon Message-ID: <20041214063056.7071C102C01@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2844 ------------------------------------------------------------------------- Subject: Raster in UTM, data in Lat/Lon Thuban version: HEAD GDAL version: other, gdal-1.2.3-0.fdr.2 proj version: other, proj-4.4.8-0.fdr.1 When I load a jpeg raster with a .jgw world file, the coordinates reported at the bottom left as I mouse around are correct UTM coordinates. When I load a shapefile, the coordinates are correct Lat/Lon coordinates. If I try to load both files at the same time, the raster and shapefile are drawn as if they're in the same coordinate system. The raster (at N 45 W 75) is in the correct position for its coordinates, and the shapefile (at the same place) is drawn in the correct position for its coordinates. Somebody isn't converting one to the other. -------------------------------------------- Managed by Request Tracker From nelson at crynwr.com Tue Dec 14 17:30:40 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 14 Dec 2004 11:30:40 -0500 Subject: Middle button pans Message-ID: <16831.5424.130392.525341@desk.crynwr.com> This patch causes the middle button to pan. Press middle, and the tool switches to Pan from whatever it was. Release middle, and the tool switches back. *Extremely useful*. The next thing that I want is for the scroll wheel (button4 and button 5) to zoom in and out. After that, I want the line/polygon underneath the cursor to be automagically identified. After that, I want a table click to cause an automatic re-pan and zoom so the entire feature is visible. I have Plans. Index: Thuban/UI/view.py =================================================================== RCS file: /home/thuban/jail/thubanrepository/thuban/Thuban/UI/view.py,v retrieving revision 1.63 diff -u -r1.63 view.py --- Thuban/UI/view.py 13 Dec 2004 18:26:11 -0000 1.63 +++ Thuban/UI/view.py 14 Dec 2004 16:04:00 -0000 @@ -24,6 +24,7 @@ wxPaintDC, wxColour, wxClientDC, wxINVERT, wxTRANSPARENT_BRUSH, wxFont,\ EVT_PAINT, EVT_LEFT_DOWN, EVT_LEFT_UP, EVT_MOTION, EVT_LEAVE_WINDOW, \ wxPlatform, wxBeginBusyCursor, wxEndBusyCursor, wxFileDialog, wxSAVE, \ + EVT_MIDDLE_DOWN, EVT_MIDDLE_UP, \ wxOVERWRITE_PROMPT, wxID_OK # Export related stuff @@ -128,6 +129,8 @@ EVT_PAINT(self, self.OnPaint) EVT_LEFT_DOWN(self, self.OnLeftDown) EVT_LEFT_UP(self, self.OnLeftUp) + EVT_MIDDLE_DOWN(self, self.OnMiddleDown) + EVT_MIDDLE_UP(self, self.OnMiddleUp) EVT_MOTION(self, self.OnMotion) EVT_LEAVE_WINDOW(self, self.OnLeaveWindow) wx.EVT_SIZE(self, self.OnSize) @@ -352,6 +355,15 @@ def GetPortSizeTuple(self): return self.GetSizeTuple() + + def OnMiddleDown(self, event): + self.remembertool = self.tool + self.PanTool() + self.OnLeftDown(event) + + def OnMiddleUp(self, event): + self.OnLeftUp(event) + self.SelectTool(self.remembertool) def OnLeftDown(self, event): self.MouseLeftDown(event) From thuban-bugs at intevation.de Tue Dec 14 18:23:23 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Tue, 14 Dec 2004 18:23:23 +0100 (CET) Subject: [bug #2845] (thuban) Fix Layer.ClipBoundingBox Message-ID: <20041214172323.AD94B102C39@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2845 ------------------------------------------------------------------------- Subject: Fix Layer.ClipBoundingBox The method ClipBoundingBox of the class Layer doesn't make much sense as it stands now. If it is supposed to do clipping it shouldn't return the parameter unchanged when it lies completely outside of the bounding box. It would be better to return None and return an empty list in ShapesInRegion in that case. Furthermore, it's only called in one place in Layer. I don't think the method should be public (especially as it is implemented now). Therefore, it shouldn't be called directly in the test cases. Instead a test case should be written that would fail if ShapesInRegion did call ClipBoundingBox. Of course the test should be written so that it would trigger the bug that was fixed by introducing ClipBoundingBox (IIRC the bug had something todo with projections and bounding boxes containing NaN or INF when the parameter to ShapesInRegion covered the entire earth or something similarly large). -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Wed Dec 15 10:44:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 10:44:36 +0100 (CET) Subject: frank: thuban/test test_load.py,1.41,1.42 Message-ID: <20041215094436.52A8E102BCC@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv21373/test Modified Files: test_load.py Log Message: (TestAltPath.checkSession): New, extended checks if session has been loaded successfully. The check is called by the relevant tests after executing load_session(). Index: test_load.py =================================================================== RCS file: /thubanrepository/thuban/test/test_load.py,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- test_load.py 13 Dec 2004 17:51:11 -0000 1.41 +++ test_load.py 15 Dec 2004 09:44:34 -0000 1.42 @@ -1016,7 +1016,7 @@ file_contents = '''\ - + @@ -1028,15 +1028,34 @@ ''' + def checkSession(self, session): + """Check if session has been loaded successfully.""" + + eq = self.assertEquals + + map = session.Maps()[0] + layers = map.Layers() + + eq("AltPath Test session", session.Title()) + eq("not the iceland map", map.Title()) + eq(3,len(layers)) + eq("political",layers[0].Title()) + eq("roads-line",layers[1].Title()) + eq("something else",layers[2].Title()) + def test_01_single_path_error_fix(self): """Test single file path error fix.""" + + eq = self.assertEquals + # The usual initial case s_cb = Shapefile_CallBack({ "search": [("../Data/iceland/roads-line.shp",0)], "check": [(None, None)]}) self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) - + self.checkSession(self.session) + def test_02_path_error_fix_from_list(self): """Test single file path error fix.""" # This represents the usual case for "from_list" @@ -1046,6 +1065,7 @@ }) self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) + self.checkSession(self.session) def test_03_single_path_error_cancelled(self): """Test alternative path cancelled.""" @@ -1072,6 +1092,7 @@ }) self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) + self.checkSession(self.session) def test_06_path_error_fix_from_list_fails(self): """Test alternative path recovery from list.""" From cvs at intevation.de Wed Dec 15 10:45:00 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 10:45:00 +0100 (CET) Subject: frank: thuban ChangeLog,1.730,1.731 Message-ID: <20041215094500.ABA55102BCC@lists.intevation.de> Author: frank Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv21404 Modified Files: ChangeLog Log Message: Extended load tests Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.730 retrieving revision 1.731 diff -u -d -r1.730 -r1.731 --- ChangeLog 13 Dec 2004 18:26:11 -0000 1.730 +++ ChangeLog 15 Dec 2004 09:44:58 -0000 1.731 @@ -1,3 +1,9 @@ +2004-12-15 Frank Koormann + + * test/test_load.py (TestAltPath.checkSession): New, extended checks if + session has been loaded successfully. The check is called by the relevant + tests after executing load_session(). + 2004-12-13 Bernhard Herzog Make sure the region used to determine which shapes are visible From cvs at intevation.de Wed Dec 15 10:58:32 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 10:58:32 +0100 (CET) Subject: frank: thuban/test test_load.py,1.42,1.43 Message-ID: <20041215095832.DD77F102BCC@lists.intevation.de> Author: frank Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv21584/test Modified Files: test_load.py Log Message: (TestAltPath.test_01_single_path_error_fix): Code cleanup. Index: test_load.py =================================================================== RCS file: /thubanrepository/thuban/test/test_load.py,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- test_load.py 15 Dec 2004 09:44:34 -0000 1.42 +++ test_load.py 15 Dec 2004 09:58:30 -0000 1.43 @@ -1045,9 +1045,6 @@ def test_01_single_path_error_fix(self): """Test single file path error fix.""" - - eq = self.assertEquals - # The usual initial case s_cb = Shapefile_CallBack({ "search": [("../Data/iceland/roads-line.shp",0)], From cvs at intevation.de Wed Dec 15 12:12:13 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 12:12:13 +0100 (CET) Subject: bh: thuban/test postgissupport.py,1.9,1.10 Message-ID: <20041215111213.AD946102C0D@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv23799/test Modified Files: postgissupport.py Log Message: (PostgreSQLServer.is_running): Fix typo in the doc string and rephrase it a little. Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- postgissupport.py 12 Mar 2004 12:59:33 -0000 1.9 +++ postgissupport.py 15 Dec 2004 11:12:11 -0000 1.10 @@ -184,12 +184,16 @@ raise RuntimeError("postmaster didn't start") def is_running(self): - """Return true a postmaster process is running on self.dbdir + """Return whether a postmaster process is running on self.dbdir - This method runs pg_ctl status on the dbdir so even if the - object has just been created it is possible that this method - returns true if there's still a postmaster process running for - self.dbdir. + This method runs pg_ctl status on the dbdir and returns True if + that command succeeds and False otherwise. + + Note that it is possible that this method returns true even if + the PostgreSQLServer instance has just been created and + createdb() has not been called yet. This can happen, for + instance, if the server has been started manually for debugging + purposes after a test suite run. """ return run_boolean_command(["pg_ctl", "-D", self.dbdir, "status"]) From cvs at intevation.de Wed Dec 15 12:12:13 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 12:12:13 +0100 (CET) Subject: bh: thuban ChangeLog,1.731,1.732 Message-ID: <20041215111213.B6B83102C14@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv23799 Modified Files: ChangeLog Log Message: (PostgreSQLServer.is_running): Fix typo in the doc string and rephrase it a little. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.731 retrieving revision 1.732 diff -u -d -r1.731 -r1.732 --- ChangeLog 15 Dec 2004 09:44:58 -0000 1.731 +++ ChangeLog 15 Dec 2004 11:12:11 -0000 1.732 @@ -1,3 +1,8 @@ +2004-12-15 Bernhard Herzog + + * test/postgissupport.py (PostgreSQLServer.is_running): Fix typo + in the doc string and rephrase it a little. + 2004-12-15 Frank Koormann * test/test_load.py (TestAltPath.checkSession): New, extended checks if From cvs at intevation.de Wed Dec 15 15:01:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 15:01:06 +0100 (CET) Subject: bh: thuban/test postgissupport.py,1.10,1.11 Message-ID: <20041215140106.532A5102BF7@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv25951/test Modified Files: postgissupport.py Log Message: (PostgreSQLServer.execute_sql): Extend to so that it returns a result for select statements. (PostgreSQLServer.server_version): New. Return the version of the server software. (PostgreSQLServer.require_authentication): The format of pg_hba.conf has changed between PostgrSQL 7.2 and 7.3. Check the server version and generate the file in the correct format Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- postgissupport.py 15 Dec 2004 11:12:11 -0000 1.10 +++ postgissupport.py 15 Dec 2004 14:01:04 -0000 1.11 @@ -17,6 +17,7 @@ import popen2 import shutil import traceback +import re import support @@ -303,17 +304,39 @@ return " ".join(params) def execute_sql(self, dbname, user, sql): - """Execute the sql statament + """Execute the sql statament and return a result for SELECT statements The user parameter us used as in connection_params. The dbname - parameter must be the name of a database in the cluster. + parameter must be the name of a database in the cluster. The + sql parameter is the SQL statement to execute as a string. If + the string starts with 'select' (matched case insensitively) the + first row of the result will be returned. Otherwise the return + value is None. """ conn = psycopg.connect("dbname=%s " % dbname + self.connection_string(user)) cursor = conn.cursor() cursor.execute(sql) + if sql.lower().startswith("select"): + row = cursor.fetchone() + else: + row = None conn.commit() conn.close() + return row + + def server_version(self): + """Return the server version as a tuple (major, minor, patch) + + Each item in the tuple is an int. + """ + result = self.execute_sql("template1", "admin", "SELECT version();")[0] + match = re.match(r"PostgreSQL (\d+\.\d+\.\d+)", result) + if match: + return tuple(map(int, match.group(1).split("."))) + else: + raise RutimeError("Cannot determine PostgreSQL server version" + " from %r" % result) def require_authentication(self, required): """Switch authentication requirements on or off @@ -325,10 +348,17 @@ corresponding call to switch it off again in the test case' tearDown method or in a finally: block. """ + # Starting with PostgreSQL 7.3 the pg_hba.conf file has an + # additional column with a username. Query the server version + # and generate a file in the correct format. + if self.server_version() >= (7, 3): + user = "all" + else: + user = "" if required: - contents = "local all password\n" + contents = "local all %s password\n" % user else: - contents = "local all trust\n" + contents = "local all %s trust\n" % user f = open(os.path.join(self.dbdir, "pg_hba.conf"), "w") f.write(contents) f.close() From cvs at intevation.de Wed Dec 15 15:01:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 15:01:06 +0100 (CET) Subject: bh: thuban ChangeLog,1.732,1.733 Message-ID: <20041215140106.61834102C01@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv25951 Modified Files: ChangeLog Log Message: (PostgreSQLServer.execute_sql): Extend to so that it returns a result for select statements. (PostgreSQLServer.server_version): New. Return the version of the server software. (PostgreSQLServer.require_authentication): The format of pg_hba.conf has changed between PostgrSQL 7.2 and 7.3. Check the server version and generate the file in the correct format Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.732 retrieving revision 1.733 diff -u -d -r1.732 -r1.733 --- ChangeLog 15 Dec 2004 11:12:11 -0000 1.732 +++ ChangeLog 15 Dec 2004 14:01:04 -0000 1.733 @@ -1,5 +1,15 @@ 2004-12-15 Bernhard Herzog + * test/postgissupport.py (PostgreSQLServer.execute_sql): Extend to + so that it returns a result for select statements. + (PostgreSQLServer.server_version): New. Return the version of the + server software. + (PostgreSQLServer.require_authentication): The format of + pg_hba.conf has changed between PostgrSQL 7.2 and 7.3. Check the + server version and generate the file in the correct format + +2004-12-15 Bernhard Herzog + * test/postgissupport.py (PostgreSQLServer.is_running): Fix typo in the doc string and rephrase it a little. From cvs at intevation.de Wed Dec 15 15:49:57 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 15:49:57 +0100 (CET) Subject: bh: thuban/test test_viewport.py,1.9,1.9.2.1 Message-ID: <20041215144957.2F305100160@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv30160/test Modified Files: Tag: thuban-1-0-branch test_viewport.py Log Message: Backports from HEAD * Thuban/UI/about.py (About.__init__): Add the thuban at intevation.de address and rephrase the email address section as in HEAD * Thuban/UI/exceptiondialog.py (ExceptionDialog.dialog_layout): Improved button string to stronger clearify that Thuban will be closed when hitting the button. * Thuban/UI/multiplechoicedialog.py: Add missing import of wxPython.wx itself (as opposed to the contents of wxPython.wx). For some reason wxPython.wx is available as wxPython.wx.wx in at least some 2.4 releases. Fixes RT#2482 wrt. wxPython 2.4. * Thuban/UI/viewport.py (ViewPort.map_projection_changed): Only try to keep the same region visible when the map actually contains something * test/test_viewport.py (ViewPortTest.test_changing_map_projection): Check that changing the projection of an empty map shown in a viewport doesn't lead to exceptions in the viewport's handler for the MAP_PROJECTION_CHANGED messages Index: test_viewport.py =================================================================== RCS file: /thubanrepository/thuban/test/test_viewport.py,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- test_viewport.py 6 Oct 2003 17:31:44 -0000 1.9 +++ test_viewport.py 15 Dec 2004 14:49:55 -0000 1.9.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: # Jonathan Coles # @@ -154,6 +154,45 @@ self.port.SetMap(self.map) self.check_messages([(90.582425142660739, SCALE_CHANGED), (MAP_REPLACED,)]) + + def test_changing_map_projection(self): + """Test ViewPort behavior when changing the map's projection + + The viewport subscribes to the map's MAP_PROJECTION_CHANGED + messages and tries to adjust the viewport when the projection + changes to make sure the map is still visible in the window. + There was a bug at one point where the viewport couldn't cope + with the map not having a meaningful bounding box in this + situation. + """ + # Create a projection and an empty map. We can't use self.map + # here because we do need an empty one. + themap = Map("title", Projection(["proj=latlong", + "to_meter=.017453292519943", + "ellps=clrk66"])) + # Add the map to self.session so that it's properly destroyed in + # tearDown() + self.session.AddMap(themap) + + # Add the map to the view port and clear the messages. Then + # we're set for the actual test. + self.port.SetMap(themap) + self.clear_messages() + + # The test: set another projection. The viewport tries to + # adjust the view so that the currently visible region stays + # visible. The viewport has to take into account that the map + # is empty, which it didn't in Thuban/UI/viewport.py rev <= 1.16. + # This part of the test is OK when the SetProjection call does + # not lead to an exception. + themap.SetProjection(Projection(["proj=latlong", + "to_meter=.017453292519943", + "ellps=clrk66"])) + + # If the map weren't empty the viewport might send SCALE_CHANGED + # messages, but it must no do so in this case because the scale + # doesn't change. + self.check_messages([]) def testFitRectToWindow(self): rect = self.port.win_to_proj(9, 990) + self.port.win_to_proj(990, 9) From cvs at intevation.de Wed Dec 15 15:49:57 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 15:49:57 +0100 (CET) Subject: bh: thuban/Thuban/UI viewport.py, 1.16, 1.16.2.1 multiplechoicedialog.py, 1.1, 1.1.2.1 exceptiondialog.py, 1.1, 1.1.2.1 about.py, 1.11.2.1, 1.11.2.2 Message-ID: <20041215144957.4217610016A@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv30160/Thuban/UI Modified Files: Tag: thuban-1-0-branch viewport.py multiplechoicedialog.py exceptiondialog.py about.py Log Message: Backports from HEAD * Thuban/UI/about.py (About.__init__): Add the thuban at intevation.de address and rephrase the email address section as in HEAD * Thuban/UI/exceptiondialog.py (ExceptionDialog.dialog_layout): Improved button string to stronger clearify that Thuban will be closed when hitting the button. * Thuban/UI/multiplechoicedialog.py: Add missing import of wxPython.wx itself (as opposed to the contents of wxPython.wx). For some reason wxPython.wx is available as wxPython.wx.wx in at least some 2.4 releases. Fixes RT#2482 wrt. wxPython 2.4. * Thuban/UI/viewport.py (ViewPort.map_projection_changed): Only try to keep the same region visible when the map actually contains something * test/test_viewport.py (ViewPortTest.test_changing_map_projection): Check that changing the projection of an empty map shown in a viewport doesn't lead to exceptions in the viewport's handler for the MAP_PROJECTION_CHANGED messages Index: viewport.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/viewport.py,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- viewport.py 27 Nov 2003 16:04:42 -0000 1.16 +++ viewport.py 15 Dec 2004 14:49:55 -0000 1.16.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2001, 2002, 2003 by Intevation GmbH +# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH # Authors: # Bernhard Herzog # Frank Koormann @@ -327,12 +327,17 @@ return self.map def map_projection_changed(self, map, old_proj): - """Subscribed to the map's MAP_PROJECTION_CHANGED message""" + """Subscribed to the map's MAP_PROJECTION_CHANGED message + + If the projection changes, the region shown is probably not + meaningful anymore in the new projection. Therefore this method + tries to keep the same region visible as before. + """ proj = self.map.GetProjection() bbox = None - if old_proj is not None and proj is not None: + if old_proj is not None and proj is not None and self.map.HasLayers(): width, height = self.GetPortSizeTuple() llx, lly = self.win_to_proj(0, height) urx, ury = self.win_to_proj(width, 0) Index: multiplechoicedialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/multiplechoicedialog.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- multiplechoicedialog.py 12 Jun 2003 12:14:19 -0000 1.1 +++ multiplechoicedialog.py 15 Dec 2004 14:49:55 -0000 1.1.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: # Jan-Oliver Wagner # @@ -17,6 +17,7 @@ __version__ = "$Revision$" from wxPython.wx import * +from wxPython import wx from wxPython.lib.layoutf import Layoutf class wxMultipleChoiceDialog(wx.wxDialog): Index: exceptiondialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/exceptiondialog.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- exceptiondialog.py 3 Sep 2003 06:58:47 -0000 1.1 +++ exceptiondialog.py 15 Dec 2004 14:49:55 -0000 1.1.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: # Jan-Oliver Wagnber # @@ -41,7 +41,7 @@ box = wxBoxSizer(wxHORIZONTAL) box.Add(wxButton(self, wxID_OK, _("Proceed")), 0, wxALL, 4) - box.Add(wxButton(self, wxID_CANCEL, _("Exit")), 0, wxALL, 4) + box.Add(wxButton(self, wxID_CANCEL, _("Exit Thuban now")), 0, wxALL, 4) top_box.Add(box, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10) EVT_BUTTON(self, wxID_OK, self.OnOK) Index: about.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/about.py,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -u -d -r1.11.2.1 -r1.11.2.2 --- about.py 27 Nov 2004 21:30:38 -0000 1.11.2.1 +++ about.py 15 Dec 2004 14:49:55 -0000 1.11.2.2 @@ -93,8 +93,9 @@ text += \ _("Questions and comments can be sent to the following addresses:\n" - "\tThuban developers:\n\t\t\n" - "\tThuban mailing list:\n\t\t") + "\tGeneral list (public):\n\t\t\n" + "\tDevelopers list (public):\n\t\t\n" + "\tThuban team at Intevation:\n\t\t\n") self.text = text From cvs at intevation.de Wed Dec 15 15:49:57 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 15:49:57 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.12,1.624.2.13 Message-ID: <20041215144957.6A627102BCC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv30160 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: Backports from HEAD * Thuban/UI/about.py (About.__init__): Add the thuban at intevation.de address and rephrase the email address section as in HEAD * Thuban/UI/exceptiondialog.py (ExceptionDialog.dialog_layout): Improved button string to stronger clearify that Thuban will be closed when hitting the button. * Thuban/UI/multiplechoicedialog.py: Add missing import of wxPython.wx itself (as opposed to the contents of wxPython.wx). For some reason wxPython.wx is available as wxPython.wx.wx in at least some 2.4 releases. Fixes RT#2482 wrt. wxPython 2.4. * Thuban/UI/viewport.py (ViewPort.map_projection_changed): Only try to keep the same region visible when the map actually contains something * test/test_viewport.py (ViewPortTest.test_changing_map_projection): Check that changing the projection of an empty map shown in a viewport doesn't lead to exceptions in the viewport's handler for the MAP_PROJECTION_CHANGED messages Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.12 retrieving revision 1.624.2.13 diff -u -d -r1.624.2.12 -r1.624.2.13 --- ChangeLog 13 Dec 2004 19:02:06 -0000 1.624.2.12 +++ ChangeLog 15 Dec 2004 14:49:55 -0000 1.624.2.13 @@ -1,3 +1,30 @@ +2004-12-15 Bernhard Herzog + + Backports from HEAD + + * Thuban/UI/about.py (About.__init__): Add the + thuban at intevation.de address and rephrase the email address + section as in HEAD + + * Thuban/UI/exceptiondialog.py (ExceptionDialog.dialog_layout): + Improved button string to stronger clearify that Thuban will be + closed when hitting the button. + + * Thuban/UI/multiplechoicedialog.py: Add missing import of + wxPython.wx itself (as opposed to the contents of wxPython.wx). + For some reason wxPython.wx is available as wxPython.wx.wx in at + least some 2.4 releases. Fixes RT#2482 wrt. wxPython 2.4. + + * Thuban/UI/viewport.py (ViewPort.map_projection_changed): Only + try to keep the same region visible when the map actually contains + something + + * test/test_viewport.py + (ViewPortTest.test_changing_map_projection): Check that changing + the projection of an empty map shown in a viewport doesn't lead to + exceptions in the viewport's handler for the + MAP_PROJECTION_CHANGED messages + 2004-12-13 Bernhard Herzog Backport from HEAD: Make sure the region used to determine which From cvs at intevation.de Wed Dec 15 17:42:58 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 17:42:58 +0100 (CET) Subject: bh: thuban/Thuban/UI classgen.py,1.33,1.34 Message-ID: <20041215164258.7721A102BD0@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv31584/Thuban/UI Modified Files: classgen.py Log Message: (GenQuantilesPanel.__init__): Set the minimum number of classes to 2. The calculate_quantiles needs at least two and raises an exception otherwise. Fixes RT#2549 Index: classgen.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classgen.py,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- classgen.py 22 Apr 2004 15:45:01 -0000 1.33 +++ classgen.py 15 Dec 2004 16:42:56 -0000 1.34 @@ -832,8 +832,8 @@ _("Retrieve from Table")) self.spin_numClasses = wxSpinCtrl(self, -1, style=wxTE_RIGHT) - self.spin_numClasses.SetRange(1, sys.maxint) - self.spin_numClasses.SetValue(1) + self.spin_numClasses.SetRange(2, sys.maxint) + self.spin_numClasses.SetValue(2) sizer = wxBoxSizer(wxHORIZONTAL) From cvs at intevation.de Wed Dec 15 17:42:58 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 17:42:58 +0100 (CET) Subject: bh: thuban ChangeLog,1.733,1.734 Message-ID: <20041215164258.7E017102BD8@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv31584 Modified Files: ChangeLog Log Message: (GenQuantilesPanel.__init__): Set the minimum number of classes to 2. The calculate_quantiles needs at least two and raises an exception otherwise. Fixes RT#2549 Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.733 retrieving revision 1.734 diff -u -d -r1.733 -r1.734 --- ChangeLog 15 Dec 2004 14:01:04 -0000 1.733 +++ ChangeLog 15 Dec 2004 16:42:56 -0000 1.734 @@ -1,5 +1,12 @@ 2004-12-15 Bernhard Herzog + * Thuban/UI/classgen.py (GenQuantilesPanel.__init__): Set the + minimum number of classes to 2. The calculate_quantiles needs at + least two and raises an exception otherwise. + Fixes RT#2549 + +2004-12-15 Bernhard Herzog + * test/postgissupport.py (PostgreSQLServer.execute_sql): Extend to so that it returns a result for select statements. (PostgreSQLServer.server_version): New. Return the version of the From cvs at intevation.de Wed Dec 15 17:45:32 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 17:45:32 +0100 (CET) Subject: bh: thuban/Thuban/UI classgen.py,1.30.2.3,1.30.2.4 Message-ID: <20041215164532.7F470102BD0@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv31670/Thuban/UI Modified Files: Tag: thuban-1-0-branch classgen.py Log Message: (GenQuantilesPanel.__init__): Set the minimum number of classes to 2. The calculate_quantiles needs at least two and raises an exception otherwise. Fixes RT#2549 Index: classgen.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/classgen.py,v retrieving revision 1.30.2.3 retrieving revision 1.30.2.4 diff -u -d -r1.30.2.3 -r1.30.2.4 --- classgen.py 28 Sep 2004 20:21:34 -0000 1.30.2.3 +++ classgen.py 15 Dec 2004 16:45:30 -0000 1.30.2.4 @@ -832,8 +832,8 @@ _("Retrieve from Table")) self.spin_numClasses = wxSpinCtrl(self, -1, style=wxTE_RIGHT) - self.spin_numClasses.SetRange(1, sys.maxint) - self.spin_numClasses.SetValue(1) + self.spin_numClasses.SetRange(2, sys.maxint) + self.spin_numClasses.SetValue(2) sizer = wxBoxSizer(wxHORIZONTAL) From cvs at intevation.de Wed Dec 15 17:45:32 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Wed, 15 Dec 2004 17:45:32 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.13,1.624.2.14 Message-ID: <20041215164532.9458E102BD8@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv31670 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: (GenQuantilesPanel.__init__): Set the minimum number of classes to 2. The calculate_quantiles needs at least two and raises an exception otherwise. Fixes RT#2549 Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.13 retrieving revision 1.624.2.14 diff -u -d -r1.624.2.13 -r1.624.2.14 --- ChangeLog 15 Dec 2004 14:49:55 -0000 1.624.2.13 +++ ChangeLog 15 Dec 2004 16:45:30 -0000 1.624.2.14 @@ -1,5 +1,12 @@ 2004-12-15 Bernhard Herzog + * Thuban/UI/classgen.py (GenQuantilesPanel.__init__): Set the + minimum number of classes to 2. The calculate_quantiles needs at + least two and raises an exception otherwise. + Fixes RT#2549 + +2004-12-15 Bernhard Herzog + Backports from HEAD * Thuban/UI/about.py (About.__init__): Add the From jan at intevation.de Wed Dec 15 22:39:37 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Wed, 15 Dec 2004 22:39:37 +0100 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 Message-ID: <20041215213937.GA29934@intevation.de> Dear Thuban translators, soon thuban-1-0-branch is string-freezed for release of 1.0.1. Can those of you who are ready to update the po files quickly give me a short ping and let me know whether you can work on CVS directly (in that case we do not need to prepare a special tar-ball) and what your reaction time will be in the next couple of days. Thanks and all the best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From cvs at intevation.de Thu Dec 16 01:57:10 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 01:57:10 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp/test __init__.py,NONE,1.1.2.1 Message-ID: <20041216005710.18970102BD0@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp/test In directory doto:/tmp/cvs-serv5443 Added Files: Tag: thuban-1-0-branch __init__.py Log Message: Make this directory a package. --- NEW FILE: __init__.py --- # Copyright (c) 2004 by Intevation GmbH # Authors: # Jan-Oliver Wagner # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. From cvs at intevation.de Thu Dec 16 01:59:03 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 01:59:03 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp/test test_gns2shp.py,1.1,1.1.2.1 Message-ID: <20041216005903.47C59102BD0@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp/test In directory doto:/tmp/cvs-serv5479 Modified Files: Tag: thuban-1-0-branch test_gns2shp.py Log Message: Add some import paths dynamically. Index: test_gns2shp.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/gns2shp/test/test_gns2shp.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- test_gns2shp.py 4 Sep 2003 15:35:51 -0000 1.1 +++ test_gns2shp.py 16 Dec 2004 00:59:01 -0000 1.1.2.1 @@ -1,6 +1,6 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: -# Jan-Oliver Wagner +# Jan-Oliver Wagner (2003, 2004) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -15,6 +15,18 @@ import unittest import os +import sys + +# If run directly as a script, add Thuban's test directory, the Lib +# directory and the Thuban directory itself to the path. +# Otherwise we assume that the importing code as already done it +if __name__ == "__main__": + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), + "..", "..", "..", "test")) + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), + "..", "..", "..", "Lib")) + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), + "..", "..", "..")) import support import shapelib From cvs at intevation.de Thu Dec 16 02:00:22 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 02:00:22 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp/test README,1.1,1.1.2.1 Message-ID: <20041216010022.B5E35102BD0@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp/test In directory doto:/tmp/cvs-serv5516 Modified Files: Tag: thuban-1-0-branch README Log Message: Simplified description how to test. Index: README =================================================================== RCS file: /thubanrepository/thuban/Extensions/gns2shp/test/README,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- README 4 Sep 2003 15:28:38 -0000 1.1 +++ README 16 Dec 2004 01:00:20 -0000 1.1.2.1 @@ -6,7 +6,5 @@ retrieved from: http://www.nima.mil/gns/html/cntry_files.html -Howto run test (assume thuban source is under ~/project): - -export PYTHONPATH=~/project/thuban:~/project/thuban/Lib:~/project/thuban/test +Run test with: python test_gns2shp.py From cvs at intevation.de Thu Dec 16 02:06:35 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 02:06:35 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp gns2shp.py,1.1.2.1,1.1.2.2 Message-ID: <20041216010635.A1ACF102BD0@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp In directory doto:/tmp/cvs-serv5650 Modified Files: Tag: thuban-1-0-branch gns2shp.py Log Message: (gns2shp): Fixed doc-string, fixed some dimensions of fields according to the GNS documentation which seems to change undocumented. Now killing trailing \n and/or \r from MODIFY_DATE. This fixes RT#2453. Index: gns2shp.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/gns2shp/gns2shp.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- gns2shp.py 18 May 2004 21:22:25 -0000 1.1.2.1 +++ gns2shp.py 16 Dec 2004 01:06:33 -0000 1.1.2.2 @@ -1,6 +1,6 @@ -# Copyright (C) 2003 by Intevation GmbH +# Copyright (C) 2003, 2004 by Intevation GmbH # Authors: -# Jan-Oliver Wagner +# Jan-Oliver Wagner (2003, 2004) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -18,15 +18,17 @@ """ __version__ = '$Revision$' +# $Source$ +# $Id$ import os, sys -# only import GUI when not called as command line tool +# only import GUI and register when not called as command line tool if __name__ != '__main__': from wxPython.wx import * from Thuban.UI.command import registry, Command - import Thuban.UI.mainwindow + from Thuban.UI.mainwindow import main_menu from Thuban import _ from Thuban.Model.layer import Layer @@ -37,7 +39,7 @@ """Convert a file from gns textformat into a Shapefile. The GNS text format is described on - http://www.nima.mil/gns/html/cntyfile/gis.html + http://www.nima.mil/gns/html/gis.html src_fname -- Filename of the GNS standard textfile (including suffix '.txt) dest_fname -- Filename where to write the Shapefile components (name @@ -62,19 +64,19 @@ dbf.add_field('JOG', dbflib.FTString, 7, 0) dbf.add_field('FC', dbflib.FTString, 1, 0) dbf.add_field('DSG', dbflib.FTString, 5, 0) - dbf.add_field('PC', dbflib.FTInteger, 10, 0) + dbf.add_field('PC', dbflib.FTInteger, 1, 0) dbf.add_field('CC1', dbflib.FTString, 2, 0) dbf.add_field('ADM1', dbflib.FTString, 2, 0) - dbf.add_field('ADM2', dbflib.FTString, 2, 0) + dbf.add_field('ADM2', dbflib.FTString, 200, 0) dbf.add_field('DIM', dbflib.FTInteger, 10, 0) dbf.add_field('CC2', dbflib.FTString, 2, 0) dbf.add_field('NT', dbflib.FTString, 1, 0) dbf.add_field('LC', dbflib.FTString, 2, 0) - dbf.add_field('SHORT_FORM', dbflib.FTString, 40, 0) - dbf.add_field('GENERIC', dbflib.FTString, 40, 0) - dbf.add_field('SORT_NAME', dbflib.FTString, 40, 0) - dbf.add_field('FULL_NAME', dbflib.FTString, 40, 0) - dbf.add_field('FULL_ND', dbflib.FTString, 40, 0) + dbf.add_field('SHORT_FORM', dbflib.FTString, 128, 0) + dbf.add_field('GENERIC', dbflib.FTString, 128, 0) + dbf.add_field('SORT_NAME', dbflib.FTString, 200, 0) + dbf.add_field('FULL_NAME', dbflib.FTString, 200, 0) + dbf.add_field('FULL_ND', dbflib.FTString, 200, 0) # FULL_NAME_ND dbf.add_field('MODIFY_DATE', dbflib.FTString, 11, 0) del dbf dbf = dbflib.open(dbf_filename, 'r+b') @@ -97,6 +99,7 @@ except: PC = None try: DIM = int(DIM) except: DIM = None + MODIFY_DATE = MODIFY_DATE[0:10] # kill trailing "\n" or "\r\n" obj = shapelib.SHPObject(shapelib.SHPT_POINT, i, [[(DD_LONG, DD_LAT)]]) shp.write_object(-1, obj) dbf.write_record(i, { 'RC': RC, 'UFI': UFI, 'UNI': UNI, 'UTM': UTM, @@ -176,7 +179,6 @@ helptext = _('Convert GNS-file into a shapefile'))) # find the extensions menu (create it anew if not found) -main_menu = Thuban.UI.mainwindow.main_menu extensions_menu = main_menu.find_menu('extensions') if extensions_menu is None: extensions_menu = main_menu.InsertMenu('extensions', _('E&xtensions')) From cvs at intevation.de Thu Dec 16 02:07:18 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 02:07:18 +0100 (CET) Subject: jan: thuban ChangeLog,1.624.2.14,1.624.2.15 Message-ID: <20041216010718.9FCDB102BD0@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv5682 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: Some fixes of gns2shp extension. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.14 retrieving revision 1.624.2.15 diff -u -d -r1.624.2.14 -r1.624.2.15 --- ChangeLog 15 Dec 2004 16:45:30 -0000 1.624.2.14 +++ ChangeLog 16 Dec 2004 01:07:16 -0000 1.624.2.15 @@ -1,3 +1,21 @@ +2004-12-16 Jan-Oliver Wagner + + Some fixes of gns2shp extension. + + * Extensions/gns2shp/test/__init__.py: New. Make this directory a + package. + + * Extensions/gns2shp/test/test_gns2shp.py: Add some import paths + dynamically. + + * Extensions/gns2shp/test/README: Simplified description how to test. + + * Extensions/gns2shp/gns2shp.py (gns2shp): Fixed doc-string, + fixed some dimensions of fields according to the GNS documentation + which seems to change undocumented. + Now killing trailing \n and/or \r from MODIFY_DATE. + This fixes RT#2453. + 2004-12-15 Bernhard Herzog * Thuban/UI/classgen.py (GenQuantilesPanel.__init__): Set the From jan at intevation.de Thu Dec 16 02:22:47 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 16 Dec 2004 02:22:47 +0100 Subject: [Thuban-devel] Middle button pans In-Reply-To: <16831.5424.130392.525341@desk.crynwr.com> References: <16831.5424.130392.525341@desk.crynwr.com> Message-ID: <20041216012247.GA32454@intevation.de> On Tue, Dec 14, 2004 at 11:30:40AM -0500, Russell Nelson wrote: > This patch causes the middle button to pan. Press middle, and the > tool switches to Pan from whatever it was. Release middle, and the > tool switches back. *Extremely useful*. I like it :-) Any comments from others why this should not go into standard Thuban? > The next thing that I want is for the scroll wheel (button4 and button > 5) to zoom in and out. > > After that, I want the line/polygon underneath the cursor to be > automagically identified. > > After that, I want a table click to cause an automatic re-pan and zoom > so the entire feature is visible. > > I have Plans. sounds promising! -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From nelson at crynwr.com Thu Dec 16 07:37:51 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 16 Dec 2004 01:37:51 -0500 Subject: [Thuban-devel] Middle button pans In-Reply-To: <20041216012247.GA32454@intevation.de> References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> Message-ID: <16833.11583.389518.600030@desk.crynwr.com> Jan-Oliver Wagner writes: > Any comments from others why this should not go into standard > Thuban? Silence is golden! > > The next thing that I want is for the scroll wheel (button4 and button > > 5) to zoom in and out. That seems to be harder than I'd hoped. There is a scrollwheel event, but there seems to be some problem with catching scrollwheel events in bitmaps, or something like that. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From frank.koormann at intevation.de Thu Dec 16 10:10:29 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Thu, 16 Dec 2004 10:10:29 +0100 Subject: [Thuban-devel] Middle button pans In-Reply-To: <16833.11583.389518.600030@desk.crynwr.com> References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> Message-ID: <20041216091029.GA17622@intevation.de> Hi, * Russell Nelson [041216 07:37]: > Jan-Oliver Wagner writes: > > Any comments from others why this should not go into standard > > Thuban? I like this feature also very much. However, it chrashes Thuban, if you click the middle mouse button over a view without a session loaded. | An unhandled exception occurred: | 'NoneType' object has no attribute 'Hide' | (please report to http://thuban.intevation.org/bugtracker.html) | | Traceback (most recent call last): | File "/mobilehome/frank/projects/thuban/thuban-dev/Thuban/UI/view.py", | line 365, in OnMiddleUp | self.OnLeftUp(event) | File "/mobilehome/frank/projects/thuban/thuban-dev/Thuban/UI/view.py", | line 393, in OnLeftUp | self.tool.Hide(self.drag_dc) | AttributeError: 'NoneType' object has no attribute 'Hide' > > > The next thing that I want is for the scroll wheel (button4 and button > > > 5) to zoom in and out. > > That seems to be harder than I'd hoped. There is a scrollwheel event, > but there seems to be some problem with catching scrollwheel events in > bitmaps, or something like that. Works for me here on a Debian Sarge with: Thuban 1.1 cvs-20041216 ChangeLog 2004-12-15 Currently using: wxPython 2.4.2.4 Python 2.3.4 PySQLite 0.5.1 SQLite 2.8.15 GDAL 1.2.1.0 psycopg 1.1.15 Compiled for: GTK 1.2.10 proj 4.4.8 Some snippets: EVT_MOUSEWHEEL(self, self.OnMouseWheel) def OnMouseWheel(self, event): print event print "wxMouseEvent::GetWheelRotation: %s" % event.GetWheelRotation() print "wxMouseEvent::GetWheelDelta : %s" % event.GetWheelDelta() wxMouseEvent::GetWheelRotation: -120 wxMouseEvent::GetWheelDelta : 0 wxMouseEvent::GetWheelRotation: 120 wxMouseEvent::GetWheelDelta : 0 Looking forward to see these features in Thuban! -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.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/20041216/8bef7fcd/attachment.bin From bernhard at intevation.de Thu Dec 16 11:52:02 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Thu, 16 Dec 2004 11:52:02 +0100 Subject: [Thuban-devel] Middle button pans In-Reply-To: <16833.11583.389518.600030@desk.crynwr.com> References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> Message-ID: <20041216105202.GI31109@intevation.de> On Thu, Dec 16, 2004 at 01:37:51AM -0500, Russell Nelson wrote: > Jan-Oliver Wagner writes: > > Any comments from others why this should not go into standard > > Thuban? > > Silence is golden! Most of the time it isn't. The feature sounds fine to me, I could not test it yet. -------------- 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/20041216/d84d5f2c/attachment.bin From cvs at intevation.de Thu Dec 16 11:56:19 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 11:56:19 +0100 (CET) Subject: bh: thuban/Thuban/UI projdialog.py,1.39,1.39.2.1 Message-ID: <20041216105619.D716B102BD0@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv5927/Thuban/UI Modified Files: Tag: thuban-1-0-branch projdialog.py Log Message: (ProjFrame._show_proj_panel): If the panel to be shown is the UnknownProjPanel disable the OK and Try buttons. Otherwise enable them. (ProjFrame.__GetProjection): The UnknownProjPanel returns None for the parameters. In that case __GetProjection also returns None now. Index: projdialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/projdialog.py,v retrieving revision 1.39 retrieving revision 1.39.2.1 diff -u -d -r1.39 -r1.39.2.1 --- projdialog.py 21 Jan 2004 17:09:15 -0000 1.39 +++ projdialog.py 16 Dec 2004 10:56:17 -0000 1.39.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: # Jonathan Coles # Frank Koormann @@ -530,10 +530,14 @@ def _show_proj_panel(self, panel_class): """Show the panel as the projection panel""" if panel_class is UnknownProjPanel: + self.button_ok.Disable() + self.button_try.Disable() self.edit_box.Disable() self.nbsizer.Activate(self.unknown_projection_panel) self.curProjPanel = self.unknown_projection_panel else: + self.button_ok.Enable(True) + self.button_try.Enable(True) self.edit_box.Enable(True) self.unknown_projection_panel.Hide() for panel in self.projection_panels: @@ -569,8 +573,9 @@ # self.curProjPanel should always contain the most relevant data # for a projection if self.curProjPanel is not None: - return Projection(self.curProjPanel.GetParameters(), - self.projname.GetValue()) + parameters = self.curProjPanel.GetParameters() + if parameters is not None: + return Projection(parameters, self.projname.GetValue()) return None From cvs at intevation.de Thu Dec 16 11:56:19 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 11:56:19 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.15,1.624.2.16 Message-ID: <20041216105619.DED95102BDC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv5927 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: (ProjFrame._show_proj_panel): If the panel to be shown is the UnknownProjPanel disable the OK and Try buttons. Otherwise enable them. (ProjFrame.__GetProjection): The UnknownProjPanel returns None for the parameters. In that case __GetProjection also returns None now. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.15 retrieving revision 1.624.2.16 diff -u -d -r1.624.2.15 -r1.624.2.16 --- ChangeLog 16 Dec 2004 01:07:16 -0000 1.624.2.15 +++ ChangeLog 16 Dec 2004 10:56:17 -0000 1.624.2.16 @@ -1,3 +1,14 @@ +2004-12-16 Bernhard Herzog + + Fix for RT#2237 + + * Thuban/UI/projdialog.py (ProjFrame._show_proj_panel): If the + panel to be shown is the UnknownProjPanel disable the OK and Try + buttons. Otherwise enable them. + (ProjFrame.__GetProjection): The UnknownProjPanel returns None for + the parameters. In that case __GetProjection also returns None + now. + 2004-12-16 Jan-Oliver Wagner Some fixes of gns2shp extension. From cvs at intevation.de Thu Dec 16 12:00:12 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 12:00:12 +0100 (CET) Subject: bh: thuban/Thuban/UI projdialog.py,1.39,1.40 Message-ID: <20041216110012.10142102C6A@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv6104/Thuban/UI Modified Files: projdialog.py Log Message: Fix for RT#2237 (ProjFrame._show_proj_panel): If the panel to be shown is the UnknownProjPanel disable the OK and Try buttons. Otherwise enable them. (ProjFrame.__GetProjection): The UnknownProjPanel returns None for the parameters. In that case __GetProjection also returns None now. Index: projdialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/projdialog.py,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- projdialog.py 21 Jan 2004 17:09:15 -0000 1.39 +++ projdialog.py 16 Dec 2004 11:00:10 -0000 1.40 @@ -1,4 +1,4 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: # Jonathan Coles # Frank Koormann @@ -530,10 +530,14 @@ def _show_proj_panel(self, panel_class): """Show the panel as the projection panel""" if panel_class is UnknownProjPanel: + self.button_ok.Disable() + self.button_try.Disable() self.edit_box.Disable() self.nbsizer.Activate(self.unknown_projection_panel) self.curProjPanel = self.unknown_projection_panel else: + self.button_ok.Enable(True) + self.button_try.Enable(True) self.edit_box.Enable(True) self.unknown_projection_panel.Hide() for panel in self.projection_panels: @@ -569,8 +573,9 @@ # self.curProjPanel should always contain the most relevant data # for a projection if self.curProjPanel is not None: - return Projection(self.curProjPanel.GetParameters(), - self.projname.GetValue()) + parameters = self.curProjPanel.GetParameters() + if parameters is not None: + return Projection(parameters, self.projname.GetValue()) return None From cvs at intevation.de Thu Dec 16 12:00:12 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 12:00:12 +0100 (CET) Subject: bh: thuban ChangeLog,1.734,1.735 Message-ID: <20041216110012.1C85F102C6B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv6104 Modified Files: ChangeLog Log Message: Fix for RT#2237 (ProjFrame._show_proj_panel): If the panel to be shown is the UnknownProjPanel disable the OK and Try buttons. Otherwise enable them. (ProjFrame.__GetProjection): The UnknownProjPanel returns None for the parameters. In that case __GetProjection also returns None now. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.734 retrieving revision 1.735 diff -u -d -r1.734 -r1.735 --- ChangeLog 15 Dec 2004 16:42:56 -0000 1.734 +++ ChangeLog 16 Dec 2004 11:00:10 -0000 1.735 @@ -1,3 +1,14 @@ +2004-12-16 Bernhard Herzog + + Fix for RT#2237 + + * Thuban/UI/projdialog.py (ProjFrame._show_proj_panel): If the + panel to be shown is the UnknownProjPanel disable the OK and Try + buttons. Otherwise enable them. + (ProjFrame.__GetProjection): The UnknownProjPanel returns None for + the parameters. In that case __GetProjection also returns None + now. + 2004-12-15 Bernhard Herzog * Thuban/UI/classgen.py (GenQuantilesPanel.__init__): Set the From bh at intevation.de Thu Dec 16 12:13:26 2004 From: bh at intevation.de (Bernhard Herzog) Date: Thu, 16 Dec 2004 12:13:26 +0100 Subject: frank: thuban/test test_load.py,1.41,1.42 In-Reply-To: <20041215094436.52A8E102BCC@lists.intevation.de> (cvs@intevation.de's message of "Wed, 15 Dec 2004 10:44:36 +0100 (CET)") References: <20041215094436.52A8E102BCC@lists.intevation.de> Message-ID: cvs at intevation.de writes: > --- test_load.py 13 Dec 2004 17:51:11 -0000 1.41 > +++ test_load.py 15 Dec 2004 09:44:34 -0000 1.42 [...] > @@ -1028,15 +1028,34 @@ > > ''' > > + def checkSession(self, session): > + """Check if session has been loaded successfully.""" > + > + eq = self.assertEquals > + > + map = session.Maps()[0] > + layers = map.Layers() > + > + eq("AltPath Test session", session.Title()) > + eq("not the iceland map", map.Title()) > + eq(3,len(layers)) > + eq("political",layers[0].Title()) > + eq("roads-line",layers[1].Title()) > + eq("something else",layers[2].Title()) I'm not sure this really is better than before. All you check are titles and the number of layers, but both aspects are not affected by the filenames. Plus, you do this test as the only actual check in three test cases. That looks fishy to me. Those three test cases use callbacks that do differ in what they return. Doesn't that lead to some observable differences in behavior that you can test for? Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From frank.koormann at intevation.de Thu Dec 16 12:51:32 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Thu, 16 Dec 2004 12:51:32 +0100 Subject: frank: thuban/test test_load.py,1.41,1.42 In-Reply-To: References: <20041215094436.52A8E102BCC@lists.intevation.de> Message-ID: <20041216115132.GA20474@intevation.de> * Bernhard Herzog [041216 12:13]: > > + def checkSession(self, session): > > + """Check if session has been loaded successfully.""" > > I'm not sure this really is better than before. All you check are > titles and the number of layers, but both aspects are not affected by > the filenames. What else should I check? The point is, the session defined for the test is broken, the path to roads_line.shp is wrong. The current approach is "all or nothing", i.e. you can't cancel loading for a missing shapefile but load all others. The existance of a session with three layers is the pointer that the loading has been successfully. And it couldn't be successfully without interpreting the callbacks correct: What I test is open_shapefile(): test_01_single_path_error_fix: - the SessionLoader.open_shapefile should recognizes the missing roads_line.shp - the callback is called with mode "search" and returns ("../Data/iceland/roads-line.shp",0), i.e. the path has been entered interactively (0 means "not from list of known paths) - SessionLoader.open_shapefile should try again and succeed - proceed without further user interaction. --> The seesion with three layers exists. test_02_path_error_fix_from_list: - the SessionLoader.open_shapefile should recognizes the missing roads_line.shp - the callback is called with mode "search" and returns ("../Data/iceland/roads-line.shp",1), i.e. the path has been taken from list of known path. - SessionLoader.open_shapefile should try again and succeed - since taken from a list, interact with the user (call callback with mode "check") - callback returns (os.path.abspath("../Data/iceland/roads-line.shp"),1), i.e. the user accepts the suggested alternative. - SessionLoader.open_shapefile should proceed --> The seesion with three layers exists. [...] What could be added is something like already implemented in test_06_path_error_fix_from_list_fails to ensure that all reactions defined for the callback actually have been used: self.assertRaises(IndexError, s_cb.s_cb, None, "search") self.assertRaises(IndexError, s_cb.s_cb, None, "check") --> pop on an empty list should cause an IndexError > > Plus, you do this test as the only actual check in three test cases. > That looks fishy to me. Those three test cases use callbacks that do > differ in what they return. Doesn't that lead to some observable > differences in behavior that you can test for? No, as explained above. Frank -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.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/20041216/0992abae/attachment.bin From bh at intevation.de Thu Dec 16 14:16:44 2004 From: bh at intevation.de (Bernhard Herzog) Date: Thu, 16 Dec 2004 14:16:44 +0100 Subject: frank: thuban/test test_load.py,1.41,1.42 In-Reply-To: <20041216115132.GA20474@intevation.de> (Frank Koormann's message of "Thu, 16 Dec 2004 12:51:32 +0100") References: <20041215094436.52A8E102BCC@lists.intevation.de> <20041216115132.GA20474@intevation.de> Message-ID: Frank Koormann writes: > What else should I check? The point is, the session defined for the test > is broken, the path to roads_line.shp is wrong. The current > approach is "all or nothing", i.e. you can't cancel loading for a > missing shapefile but load all others. The existance of a session > with three layers is the pointer that the loading has been successfully. > And it couldn't be successfully without interpreting the callbacks > correct: The callbacks behave differently in all three test cases. If the differences are not observable, what's the point? > What I test is open_shapefile(): > > test_01_single_path_error_fix: [...] > test_02_path_error_fix_from_list: [...] This information could be added to the test cases as doc-strings or comments. > What could be added is something like already implemented in > test_06_path_error_fix_from_list_fails > to ensure that all reactions defined for the callback actually have been > used: > self.assertRaises(IndexError, s_cb.s_cb, None, "search") > self.assertRaises(IndexError, s_cb.s_cb, None, "check") > --> pop on an empty list should cause an IndexError I think its better to more explicit. You could for instance record the parameters with which the callback was called and check that at the end. See this patch for an example: *** test_load.py.~1.43.~ Wed Dec 15 11:02:38 2004 --- test_load.py Thu Dec 16 14:15:30 2004 *************** *** 992,1000 **** --- 992,1002 ---- """ self.params = params + self.calls = [] def s_cb(self, filename, mode = None, second_try= 0): + self.calls.append((filename, mode, second_try)) if self.params.has_key(mode): return self.params[mode].pop(0) else: *************** *** 1052,1057 **** --- 1054,1065 ---- self.session = load_session(self.filename(), shapefile_callback =s_cb.s_cb) self.checkSession(self.session) + self.assertEquals(s_cb.calls, + [(os.path.abspath(os.path.join(self.temp_dir(), + "..", "Data", + "iceland", + "roads-line.shp")), + 'search', 0)]) def test_02_path_error_fix_from_list(self): """Test single file path error fix.""" >> Plus, you do this test as the only actual check in three test cases. >> That looks fishy to me. Those three test cases use callbacks that do >> differ in what they return. Doesn't that lead to some observable >> differences in behavior that you can test for? > > No, as explained above. Whether and how the callback is called is an observable difference. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From thuban-bugs at intevation.de Thu Dec 16 15:16:20 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Thu, 16 Dec 2004 15:16:20 +0100 (CET) Subject: [bug #2849] (thuban) Should the return value of UniqueValues Message-ID: <20041216141620.2EF2C102BF5@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2849 ------------------------------------------------------------------------- Subject: Should the return value of UniqueValues Should the return value of the table method UniqueValues be sorted? The only table implementation in Thuban itself that does not sort the result is PostGISTable at the moment. -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Thu Dec 16 15:19:23 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 15:19:23 +0100 (CET) Subject: bh: thuban/test test_postgis_db.py, 1.16, 1.17 postgissupport.py, 1.11, 1.12 Message-ID: <20041216141923.48E77102BF3@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv25897/test Modified Files: test_postgis_db.py postgissupport.py Log Message: Make the test suite work with PostGIS 0.8.2 and PostgreSQL 7.4 * test/postgissupport.py (find_postgis_sql): Different postgis versions put the postgis.sql file into slightly different places so we have to look in both. The updated doc string describes this is more detail. * test/test_postgis_db.py (TestPostGISSpecialCases.test_column_name_quoting): The return value of UniqueValues is unsorted, so it has to be sorted for comparison. Index: test_postgis_db.py =================================================================== RCS file: /thubanrepository/thuban/test/test_postgis_db.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_postgis_db.py 12 Mar 2004 12:59:33 -0000 1.16 +++ test_postgis_db.py 16 Dec 2004 14:19:21 -0000 1.17 @@ -233,7 +233,12 @@ self.assertEquals(table.ReadValue(2, 1, row_is_ordinal = True), 3.0) self.assertEquals(table.ReadValue(2, 1, row_is_ordinal = False), 2.0) self.assertEquals(table.ValueRange("with space"), (1.0, 3.0)) - self.assertEquals(table.UniqueValues("with \" quote"), [0, 1]) + + # The return value of UniqueValues is unsorted, so we need to + # sort it for comparison. + unique_values = table.UniqueValues("with \" quote") + unique_values.sort() + self.assertEquals(unique_values, [0, 1]) self.assertEquals(table.SimpleQuery(table.Columns()[2], "==", 1), [2, 3]) self.assertEquals(table.SimpleQuery(table.Columns()[0], "==", Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- postgissupport.py 15 Dec 2004 14:01:04 -0000 1.11 +++ postgissupport.py 16 Dec 2004 14:19:21 -0000 1.12 @@ -495,15 +495,29 @@ """Return the name of the postgis_sql file A postgis installation usually has the postgis_sql file in - PostgreSQL's datadir (i.e. the directory where PostgreSQL keeps + PostgreSQL's $datadir (i.e. the directory where PostgreSQL keeps static files, not the directory containing the databases). Unfortunately there's no way to determine the name of this directory with pg_config so we assume here that it's $bindir/../share/postgresql/. + + Furthermore, different versions of postgis place the file in + slightly different locations. For instance: + + postgis 0.7.5 $datadir/contrib/postgis.sql + postgis 0.8.1 $datadir/postgis.sql + + To support both versions, we look in both places and return the + first one found (looking under contrib first). If the file is not + found the return value is None. """ bindir = run_config_script("pg_config --bindir").strip() - return os.path.join(bindir, "..", "share", "postgresql", - "contrib", "postgis.sql") + datadir = os.path.join(bindir, "..", "share", "postgresql") + for filename in [os.path.join(datadir, "contrib", "postgis.sql"), + os.path.join(datadir, "postgis.sql")]: + if os.path.exists(filename): + return filename + _postgres_server = None def get_test_server(): From cvs at intevation.de Thu Dec 16 15:19:23 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 15:19:23 +0100 (CET) Subject: bh: thuban ChangeLog,1.735,1.736 Message-ID: <20041216141923.567CF102BF5@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv25897 Modified Files: ChangeLog Log Message: Make the test suite work with PostGIS 0.8.2 and PostgreSQL 7.4 * test/postgissupport.py (find_postgis_sql): Different postgis versions put the postgis.sql file into slightly different places so we have to look in both. The updated doc string describes this is more detail. * test/test_postgis_db.py (TestPostGISSpecialCases.test_column_name_quoting): The return value of UniqueValues is unsorted, so it has to be sorted for comparison. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.735 retrieving revision 1.736 diff -u -d -r1.735 -r1.736 --- ChangeLog 16 Dec 2004 11:00:10 -0000 1.735 +++ ChangeLog 16 Dec 2004 14:19:21 -0000 1.736 @@ -1,5 +1,19 @@ 2004-12-16 Bernhard Herzog + Make the test suite work with PostGIS 0.8.2 and PostgreSQL 7.4 + + * test/postgissupport.py (find_postgis_sql): Different postgis + versions put the postgis.sql file into slightly different places + so we have to look in both. The updated doc string describes this + is more detail. + + * test/test_postgis_db.py + (TestPostGISSpecialCases.test_column_name_quoting): The return + value of UniqueValues is unsorted, so it has to be sorted for + comparison. + +2004-12-16 Bernhard Herzog + Fix for RT#2237 * Thuban/UI/projdialog.py (ProjFrame._show_proj_panel): If the From nelson at crynwr.com Thu Dec 16 15:40:05 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 16 Dec 2004 09:40:05 -0500 Subject: [Thuban-devel] Middle button pans In-Reply-To: <20041216091029.GA17622@intevation.de> References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> <20041216091029.GA17622@intevation.de> Message-ID: <16833.40517.421052.681358@desk.crynwr.com> Frank Koormann writes: > I like this feature also very much. However, it chrashes Thuban, if you > click the middle mouse button over a view without a session loaded. Hahahaha! Indeed it does. Patch against CVS HEAD, including EVT_SCROLLWHEEL similar to yours. Could you try scrolling with the mouse wheel? I'm not getting anything printed out. Index: Thuban/UI/view.py =================================================================== RCS file: /home/thuban/jail/thubanrepository/thuban/Thuban/UI/view.py,v retrieving revision 1.63 diff -u -r1.63 view.py --- Thuban/UI/view.py 13 Dec 2004 18:26:11 -0000 1.63 +++ Thuban/UI/view.py 16 Dec 2004 14:35:50 -0000 @@ -24,6 +24,8 @@ wxPaintDC, wxColour, wxClientDC, wxINVERT, wxTRANSPARENT_BRUSH, wxFont,\ EVT_PAINT, EVT_LEFT_DOWN, EVT_LEFT_UP, EVT_MOTION, EVT_LEAVE_WINDOW, \ wxPlatform, wxBeginBusyCursor, wxEndBusyCursor, wxFileDialog, wxSAVE, \ + EVT_MIDDLE_DOWN, EVT_MIDDLE_UP, \ + EVT_MOUSEWHEEL, \ wxOVERWRITE_PROMPT, wxID_OK # Export related stuff @@ -128,6 +130,9 @@ EVT_PAINT(self, self.OnPaint) EVT_LEFT_DOWN(self, self.OnLeftDown) EVT_LEFT_UP(self, self.OnLeftUp) + EVT_MIDDLE_DOWN(self, self.OnMiddleDown) + EVT_MIDDLE_UP(self, self.OnMiddleUp) + EVT_MOUSEWHEEL(self, self.OnMouseWheel) EVT_MOTION(self, self.OnMotion) EVT_LEAVE_WINDOW(self, self.OnLeaveWindow) wx.EVT_SIZE(self, self.OnSize) @@ -352,6 +357,20 @@ def GetPortSizeTuple(self): return self.GetSizeTuple() + + def OnMouseWheel(self, event): + print "wheeled", event + + def OnMiddleDown(self, event): + self.remembertool = self.tool + if self.tool: + self.PanTool() + self.OnLeftDown(event) + + def OnMiddleUp(self, event): + if self.remembertool: + self.OnLeftUp(event) + self.SelectTool(self.remembertool) def OnLeftDown(self, event): self.MouseLeftDown(event) -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bh at intevation.de Thu Dec 16 15:55:26 2004 From: bh at intevation.de (Bernhard Herzog) Date: Thu, 16 Dec 2004 15:55:26 +0100 Subject: [Thuban-devel] Middle button pans In-Reply-To: <16833.40517.421052.681358@desk.crynwr.com> (Russell Nelson's message of "Thu, 16 Dec 2004 09:40:05 -0500") References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> <20041216091029.GA17622@intevation.de> <16833.40517.421052.681358@desk.crynwr.com> Message-ID: Russell Nelson writes: > Frank Koormann writes: > > I like this feature also very much. However, it chrashes Thuban, if you > > click the middle mouse button over a view without a session loaded. > > Hahahaha! Indeed it does. Patch against CVS HEAD, It's better now, but I have to activate a tool before I can pan with the middle mouse button. > Could you try scrolling with the > mouse wheel? I get wheeled This is with wxPython 2.4.2.4 Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From nelson at crynwr.com Thu Dec 16 15:56:02 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 16 Dec 2004 09:56:02 -0500 Subject: RT drop-downs out of date Message-ID: <16833.41474.727311.279365@desk.crynwr.com> The RT drop-down menus are all out of date. I'm running these versions of packages, and not a one is in the list: proj-4.4.8-0.fdr.1 python-sqlite-0.5.0-0.fdr.2 wxGTK2-2.4.2-0.fdr.2.2 wxPythonGTK2-2.4.2.4-0.fdr.3.2 ..... or should I have entered this into RT? :-) -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From thuban-bugs at intevation.de Thu Dec 16 16:07:58 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Thu, 16 Dec 2004 16:07:58 +0100 (CET) Subject: [bug #2850] (thuban) Selecting Projection... menu item crashes Thuban (segfault) Message-ID: <20041216150758.11C37102BF1@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2850 ------------------------------------------------------------------------- Subject: Selecting Projection... menu item crashes Thuban (segfault) Operating System: other, FC2 Thuban version: CVS, 20041216 wxPython version: other, 2.4.2.4-0.fdr.3.2 Python version: other, 2.3.3 PySQLite version: other, 0.5.0-0.fdr.2 SQLite version: 2.8.6 GDAL version: other, 1.2.3 proj version: 4.4.8 If you fire up the CVS HEAD version of thuban, go to the Map menu, and select the Projection... menu entry, Thuban prints the following and crashes: Could not read "/home/nelson/.thuban/user.proj": [Errno 2] No such file or directory: '/home/nelson/.thuban/user.proj'Segmentation fault Clearly this is meant to be just a warning, looking at the code, however, later on something is needed which is missing, and which causes one of the libraries to segfault. It actually gets as far as firing up the dialog box, but then crashes while trying to paint it. Here's the last few lines of the gdb output. It actually looks like it's a wxWindows but there may be a work-around for us. #0 0x00b2da33 in strlen () from /lib/tls/libc.so.6 #1 0x00fea42d in wxWindowDC::DoGetTextExtent () from /usr/lib/libwx_gtk2-2.4.so.0 #2 0x00f6eed9 in wxListLineData::DrawTextFormatted () from /usr/lib/libwx_gtk2-2.4.so.0 #3 0x00f6ed08 in wxListLineData::DrawInReportMode () from /usr/lib/libwx_gtk2-2.4.so.0 #4 0x00f743cf in wxListMainWindow::OnPaint () from /usr/lib/libwx_gtk2-2.4.so.0 #5 0x0106ab07 in wxEvtHandler::SearchEventTable () from /usr/lib/libwx_gtk2-2.4.so.0 #6 0x0106a923 in wxEvtHandler::ProcessEvent () from /usr/lib/libwx_gtk2-2.4.so.0 #7 0x0102a825 in wxWindow::GtkSendPaintEvents () from /usr/lib/libwx_gtk2-2.4.so.0 #8 0x010243a1 in gtk_window_own_expose_callback () from /usr/lib/libwx_gtk2-2.4.so.0 #9 0x008ebd64 in gtk_marshal_VOID__UINT_STRING () from /usr/lib/libgtk-x11-2.0.so.0 -------------------------------------------- Managed by Request Tracker From jan at intevation.de Thu Dec 16 16:09:38 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 16 Dec 2004 16:09:38 +0100 Subject: [Thuban-devel] RT drop-downs out of date In-Reply-To: <16833.41474.727311.279365@desk.crynwr.com> References: <16833.41474.727311.279365@desk.crynwr.com> Message-ID: <20041216150938.GC1085@intevation.de> On Thu, Dec 16, 2004 at 09:56:02AM -0500, Russell Nelson wrote: > The RT drop-down menus are all out of date. I'm running these > versions of packages, and not a one is in the list: > > proj-4.4.8-0.fdr.1 > python-sqlite-0.5.0-0.fdr.2 > wxGTK2-2.4.2-0.fdr.2.2 > wxPythonGTK2-2.4.2.4-0.fdr.3.2 I've added these to the web form. > ..... or should I have entered this into RT? :-) its not wrong to copy and paste the whole about dialog info into the report :-) -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From cvs at intevation.de Thu Dec 16 16:18:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 16:18:59 +0100 (CET) Subject: bh: thuban/test test_postgis_db.py, 1.17, 1.18 postgissupport.py, 1.12, 1.13 Message-ID: <20041216151859.4E51A10016A@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv26776/test Modified Files: test_postgis_db.py postgissupport.py Log Message: Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING * test/postgissupport.py (PostgreSQLServer.get_default_static_data_db): Rename the "roads" table to "roads-multi" because it now uses MULTILINESTRING geometries and introduce a new "roads" table that uses LINESTRING (coords_to_multilinestring): Make the doc string more precise (coords_to_linestring): New. Create a LINESTRING WKT representatin (wkt_converter): Add coords_to_linestring (upload_shapefile): Rephrase the doc-string a bit. * test/test_postgis_db.py (TestPostGISShapestoreArc) (LineStringTests) (TestPostGISShapestoreLineString) (TestPostGISShapestoreMultiLineString): Split TestPostGISShapestoreArc into a base class LineStringTests and two derived classes TestPostGISShapestoreLineString for LINESTRING geometries and TestPostGISShapestoreMultiLineString for MULTILINESTRING geometries. Most test methods are in the base class with the exception of tests that explicitly check the raw format. Index: test_postgis_db.py =================================================================== RCS file: /thubanrepository/thuban/test/test_postgis_db.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- test_postgis_db.py 16 Dec 2004 14:19:21 -0000 1.17 +++ test_postgis_db.py 16 Dec 2004 15:18:57 -0000 1.18 @@ -734,14 +734,12 @@ id_column = "point_id") -class TestPostGISShapestoreArc(PostGISStaticTests): +class LineStringTests: - """Tests for PostGISShapeStore objects with MULTILINESTRING data""" + """Tests shared by the LINESTRING and MULTILINESTRING tests. - def setUp(self): - """Extend inherited method to set self.table to a PostGISShapeStore""" - PostGISStaticTests.setUp(self) - self.store = PostGISShapeStore(self.db, "roads") + The tests are the same because they are based on the same data. + """ def test_shape_type(self): """Test PostGISShapeStore.ShapeType() with ARC shapes""" @@ -767,17 +765,43 @@ [[(-15.0821743011474, 66.2773818969726), (-15.0263500213623, 66.2733917236328)]]) - def test_shape_raw_data(self): - """Test PostGISShapeStore.Shape(i).RawData() with ARC shapes""" - self.assertEquals(self.store.Shape(32).RawData(), - "MULTILINESTRING((-15.0821743011475 66.2773818969727," - "-15.0263500213623 66.2733917236328))") - def test_shapes_in_region(self): """Test PostGISShapeStore.ShapesInRegion() with ARC shapes""" shapes = self.store.ShapesInRegion((-24.0, 64.5, -23.5, 65.0)) self.assertEquals([s.ShapeID() for s in shapes], [573, 581, 613]) + +class TestPostGISShapestoreLineString(LineStringTests, PostGISStaticTests): + + """Tests for PostGISShapeStore objects with LINESTRING data""" + + def setUp(self): + """Extend inherited method to set self.table to a PostGISShapeStore""" + PostGISStaticTests.setUp(self) + self.store = PostGISShapeStore(self.db, "roads") + + def test_shape_raw_data(self): + """Test PostGISShapeStore.Shape(i).RawData() with ARC shapes""" + self.assertEquals(self.store.Shape(32).RawData(), + "LINESTRING(-15.0821743011475 66.2773818969727," + "-15.0263500213623 66.2733917236328)") + + +class TestPostGISShapestoreMultiLineString(LineStringTests, + PostGISStaticTests): + + """Tests for PostGISShapeStore objects with MULTILINESTRING data""" + + def setUp(self): + """Extend inherited method to set self.table to a PostGISShapeStore""" + PostGISStaticTests.setUp(self) + self.store = PostGISShapeStore(self.db, "roads_multi") + + def test_shape_raw_data(self): + """Test PostGISShapeStore.Shape(i).RawData() with ARC shapes""" + self.assertEquals(self.store.Shape(32).RawData(), + "MULTILINESTRING((-15.0821743011475 66.2773818969727," + "-15.0263500213623 66.2733917236328))") class PolygonTests: Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- postgissupport.py 16 Dec 2004 14:19:21 -0000 1.12 +++ postgissupport.py 16 Dec 2004 15:18:57 -0000 1.13 @@ -251,9 +251,15 @@ [("gid_offset", 1000)]), ("political", os.path.join("..", "Data", "iceland", "political.shp")), - ("roads", os.path.join("..", "Data", "iceland", + ("roads_multi", os.path.join("..", "Data", "iceland", "roads-line.shp")), + # same as roads-multi but using LINESTRING instead of + # MULTILINESTRING + ("roads", os.path.join("..", "Data", "iceland", + "roads-line.shp"), + [("force_wkt_type", "LINESTRING")]), + # The polygon data as a MULTIPOLYGON geometry type ("political_multi", os.path.join("..", "Data", "iceland", "political.shp"), @@ -629,8 +635,14 @@ poly.append(", ".join(["%r %r" % p for p in ring])) return "POLYGON((%s))" % "), (".join(poly) +def coords_to_linestring(coords): + """Return string with a LINESTRING WKT representation of coords""" + if len(coords) > 1: + raise ValueError("A LINESTRING can only have one arc") + return "LINESTRING(%s)" % ", ".join(["%r %r" % p for p in coords[0]]) + def coords_to_multilinestring(coords): - """Return string with a WKT representation of the arc in coords""" + """Return string with a MULTILINESTRING WKT representation of coords""" poly = [] for ring in coords: poly.append(", ".join(["%r %r" % p for p in ring])) @@ -645,6 +657,7 @@ wkt_converter = { "POINT": coords_to_point, + "LINESTRING": coords_to_linestring, "MULTILINESTRING": coords_to_multilinestring, "POLYGON": coords_to_polygon, "MULTIPOLYGON": coords_to_multipolygon, @@ -663,9 +676,9 @@ tablename -- The name of the table to create and into which the data is to be inserted - force_wkt_type -- If given the real WKT geometry type to use instead - of the default that would be chosen based on the type of - the shapefile + force_wkt_type -- If given and not None, this is used as the WKT + geometry type to use instead of the default that would + be chosen based on the type of the shapefile gid_offset -- A number to add to the shapeid to get the value for the gid column (default 0) From cvs at intevation.de Thu Dec 16 16:18:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 16:18:59 +0100 (CET) Subject: bh: thuban/Thuban/Model postgisdb.py,1.18,1.19 Message-ID: <20041216151859.54791102BF1@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv26776/Thuban/Model Modified Files: postgisdb.py Log Message: Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING * test/postgissupport.py (PostgreSQLServer.get_default_static_data_db): Rename the "roads" table to "roads-multi" because it now uses MULTILINESTRING geometries and introduce a new "roads" table that uses LINESTRING (coords_to_multilinestring): Make the doc string more precise (coords_to_linestring): New. Create a LINESTRING WKT representatin (wkt_converter): Add coords_to_linestring (upload_shapefile): Rephrase the doc-string a bit. * test/test_postgis_db.py (TestPostGISShapestoreArc) (LineStringTests) (TestPostGISShapestoreLineString) (TestPostGISShapestoreMultiLineString): Split TestPostGISShapestoreArc into a base class LineStringTests and two derived classes TestPostGISShapestoreLineString for LINESTRING geometries and TestPostGISShapestoreMultiLineString for MULTILINESTRING geometries. Most test methods are in the base class with the exception of tests that explicitly check the raw format. Index: postgisdb.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/postgisdb.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- postgisdb.py 12 Mar 2004 12:59:33 -0000 1.18 +++ postgisdb.py 16 Dec 2004 15:18:57 -0000 1.19 @@ -478,6 +478,7 @@ shapetype_map = {"POLYGON": SHAPETYPE_POLYGON, "MULTIPOLYGON": SHAPETYPE_POLYGON, + "LINESTRING": SHAPETYPE_ARC, "MULTILINESTRING": SHAPETYPE_ARC, "POINT": SHAPETYPE_POINT} From cvs at intevation.de Thu Dec 16 16:18:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 16:18:59 +0100 (CET) Subject: bh: thuban ChangeLog,1.736,1.737 Message-ID: <20041216151859.69B58102BF3@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv26776 Modified Files: ChangeLog Log Message: Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING * test/postgissupport.py (PostgreSQLServer.get_default_static_data_db): Rename the "roads" table to "roads-multi" because it now uses MULTILINESTRING geometries and introduce a new "roads" table that uses LINESTRING (coords_to_multilinestring): Make the doc string more precise (coords_to_linestring): New. Create a LINESTRING WKT representatin (wkt_converter): Add coords_to_linestring (upload_shapefile): Rephrase the doc-string a bit. * test/test_postgis_db.py (TestPostGISShapestoreArc) (LineStringTests) (TestPostGISShapestoreLineString) (TestPostGISShapestoreMultiLineString): Split TestPostGISShapestoreArc into a base class LineStringTests and two derived classes TestPostGISShapestoreLineString for LINESTRING geometries and TestPostGISShapestoreMultiLineString for MULTILINESTRING geometries. Most test methods are in the base class with the exception of tests that explicitly check the raw format. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.736 retrieving revision 1.737 diff -u -d -r1.736 -r1.737 --- ChangeLog 16 Dec 2004 14:19:21 -0000 1.736 +++ ChangeLog 16 Dec 2004 15:18:57 -0000 1.737 @@ -1,5 +1,33 @@ 2004-12-16 Bernhard Herzog + Add support for PostGIS tables with LINESTRING geomentries. + Fixes RT#2299 + + * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING + + * test/postgissupport.py + (PostgreSQLServer.get_default_static_data_db): Rename the "roads" + table to "roads-multi" because it now uses MULTILINESTRING + geometries and introduce a new "roads" table that uses LINESTRING + (coords_to_multilinestring): Make the doc string more precise + (coords_to_linestring): New. Create a LINESTRING WKT + representatin + (wkt_converter): Add coords_to_linestring + (upload_shapefile): Rephrase the doc-string a bit. + + * test/test_postgis_db.py (TestPostGISShapestoreArc) + (LineStringTests) + (TestPostGISShapestoreLineString) + (TestPostGISShapestoreMultiLineString): Split + TestPostGISShapestoreArc into a base class LineStringTests and two + derived classes TestPostGISShapestoreLineString for LINESTRING + geometries and TestPostGISShapestoreMultiLineString for + MULTILINESTRING geometries. Most test methods are in the base + class with the exception of tests that explicitly check the raw + format. + +2004-12-16 Bernhard Herzog + Make the test suite work with PostGIS 0.8.2 and PostgreSQL 7.4 * test/postgissupport.py (find_postgis_sql): Different postgis From nelson at crynwr.com Thu Dec 16 16:49:28 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 16 Dec 2004 10:49:28 -0500 Subject: [Thuban-devel] Middle button pans In-Reply-To: References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> <20041216091029.GA17622@intevation.de> <16833.40517.421052.681358@desk.crynwr.com> Message-ID: <16833.44680.370317.77203@desk.crynwr.com> Bernhard Herzog writes: > Russell Nelson writes: > > > Frank Koormann writes: > > > I like this feature also very much. However, it chrashes Thuban, if you > > > click the middle mouse button over a view without a session loaded. > > > > Hahahaha! Indeed it does. Patch against CVS HEAD, > > It's better now, but I have to activate a tool before I can pan with the > middle mouse button. True. Maybe thuban should activate one of the tools when a layer is added? > > Could you try scrolling with the > > mouse wheel? > > I get > wheeled > > This is with wxPython 2.4.2.4 Urgh. I'm using the same wxPython! Jan-Oliver Wagner writes: > > ..... or should I have entered this into RT? :-) > > its not wrong to copy and paste the whole about dialog > info into the report :-) Ahhh, yes, I see. That's like shooting fish in a barrel. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bh at intevation.de Thu Dec 16 17:21:08 2004 From: bh at intevation.de (Bernhard Herzog) Date: Thu, 16 Dec 2004 17:21:08 +0100 Subject: [Thuban-devel] Middle button pans In-Reply-To: <16833.44680.370317.77203@desk.crynwr.com> (Russell Nelson's message of "Thu, 16 Dec 2004 10:49:28 -0500") References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> <20041216091029.GA17622@intevation.de> <16833.40517.421052.681358@desk.crynwr.com> <16833.44680.370317.77203@desk.crynwr.com> Message-ID: Russell Nelson writes: > Bernhard Herzog writes: > > This is with wxPython 2.4.2.4 > > Urgh. I'm using the same wxPython! Which GTK version (assuming it actually is wxGTK)? My wxGTK is built with gtk+ 1.2.10 Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From nelson at crynwr.com Thu Dec 16 18:10:30 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 16 Dec 2004 12:10:30 -0500 Subject: [Thuban-devel] Middle button pans In-Reply-To: References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> <20041216091029.GA17622@intevation.de> <16833.40517.421052.681358@desk.crynwr.com> <16833.44680.370317.77203@desk.crynwr.com> Message-ID: <16833.49542.804921.855145@desk.crynwr.com> Bernhard Herzog writes: > Russell Nelson writes: > > > Bernhard Herzog writes: > > > This is with wxPython 2.4.2.4 > > > > Urgh. I'm using the same wxPython! > > Which GTK version (assuming it actually is wxGTK)? My wxGTK is built > with gtk+ 1.2.10 gtk+-1.2.10-29.1.1 pygtk2-2.2.0-1 wxGTK2-2.4.2-0.fdr.2.2 wxPythonGTK2-2.4.2.4-0.fdr.3.2 And of course the mouse wheel works with everything else. Here's the appropriate lines from my /etc/X11/xorg.conf. Option "Protocol" "IMPS/2" Option "ZAxisMapping" "4 5" Option "Device" "/dev/input/mouse0" -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From cvs at intevation.de Thu Dec 16 20:17:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 20:17:53 +0100 (CET) Subject: bh: thuban/test test_postgis_db.py, 1.13, 1.13.2.1 postgissupport.py, 1.7, 1.7.2.1 Message-ID: <20041216191753.D3935102BEB@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv29760/test Modified Files: Tag: thuban-1-0-branch test_postgis_db.py postgissupport.py Log Message: Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING * test/postgissupport.py (PostgreSQLServer.get_default_static_data_db): Rename the "roads" table to "roads-multi" because it now uses MULTILINESTRING geometries and introduce a new "roads" table that uses LINESTRING (coords_to_multilinestring): Make the doc string more precise (coords_to_linestring): New. Create a LINESTRING WKT representatin (wkt_converter): Add coords_to_linestring (upload_shapefile): Rephrase the doc-string a bit. * test/test_postgis_db.py (TestPostGISShapestoreArc) (LineStringTests) (TestPostGISShapestoreLineString) (TestPostGISShapestoreMultiLineString): Split TestPostGISShapestoreArc into a base class LineStringTests and two derived classes TestPostGISShapestoreLineString for LINESTRING geometries and TestPostGISShapestoreMultiLineString for MULTILINESTRING geometries. Most test methods are in the base class with the exception of tests that explicitly check the raw format. Index: test_postgis_db.py =================================================================== RCS file: /thubanrepository/thuban/test/test_postgis_db.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -d -r1.13 -r1.13.2.1 --- test_postgis_db.py 11 Feb 2004 09:05:40 -0000 1.13 +++ test_postgis_db.py 16 Dec 2004 19:17:51 -0000 1.13.2.1 @@ -572,14 +572,12 @@ -class TestPostGISShapestoreArc(PostGISStaticTests): +class LineStringTests: - """Tests for PostGISShapeStore objects with MULTILINESTRING data""" + """Tests shared by the LINESTRING and MULTILINESTRING tests. - def setUp(self): - """Extend inherited method to set self.table to a PostGISShapeStore""" - PostGISStaticTests.setUp(self) - self.store = PostGISShapeStore(self.db, "roads") + The tests are the same because they are based on the same data. + """ def test_shape_type(self): """Test PostGISShapeStore.ShapeType() with ARC shapes""" @@ -605,17 +603,43 @@ [[(-15.0821743011474, 66.2773818969726), (-15.0263500213623, 66.2733917236328)]]) - def test_shape_raw_data(self): - """Test PostGISShapeStore.Shape(i).RawData() with ARC shapes""" - self.assertEquals(self.store.Shape(32).RawData(), - "MULTILINESTRING((-15.0821743011475 66.2773818969727," - "-15.0263500213623 66.2733917236328))") - def test_shapes_in_region(self): """Test PostGISShapeStore.ShapesInRegion() with ARC shapes""" shapes = self.store.ShapesInRegion((-24.0, 64.5, -23.5, 65.0)) self.assertEquals([s.ShapeID() for s in shapes], [573, 581, 613]) + +class TestPostGISShapestoreLineString(LineStringTests, PostGISStaticTests): + + """Tests for PostGISShapeStore objects with LINESTRING data""" + + def setUp(self): + """Extend inherited method to set self.table to a PostGISShapeStore""" + PostGISStaticTests.setUp(self) + self.store = PostGISShapeStore(self.db, "roads") + + def test_shape_raw_data(self): + """Test PostGISShapeStore.Shape(i).RawData() with ARC shapes""" + self.assertEquals(self.store.Shape(32).RawData(), + "LINESTRING(-15.0821743011475 66.2773818969727," + "-15.0263500213623 66.2733917236328)") + + +class TestPostGISShapestoreMultiLineString(LineStringTests, + PostGISStaticTests): + + """Tests for PostGISShapeStore objects with MULTILINESTRING data""" + + def setUp(self): + """Extend inherited method to set self.table to a PostGISShapeStore""" + PostGISStaticTests.setUp(self) + self.store = PostGISShapeStore(self.db, "roads_multi") + + def test_shape_raw_data(self): + """Test PostGISShapeStore.Shape(i).RawData() with ARC shapes""" + self.assertEquals(self.store.Shape(32).RawData(), + "MULTILINESTRING((-15.0821743011475 66.2773818969727," + "-15.0263500213623 66.2733917236328))") class PolygonTests: Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- postgissupport.py 10 Feb 2004 15:51:57 -0000 1.7 +++ postgissupport.py 16 Dec 2004 19:17:51 -0000 1.7.2.1 @@ -243,15 +243,21 @@ [("gid_offset", 1000)]), ("political", os.path.join("..", "Data", "iceland", "political.shp")), - ("roads", os.path.join("..", "Data", "iceland", + ("roads_multi", os.path.join("..", "Data", "iceland", "roads-line.shp")), + # same as roads-multi but using LINESTRING instead of + # MULTILINESTRING + ("roads", os.path.join("..", "Data", "iceland", + "roads-line.shp"), + [("force_wkt_type", "LINESTRING")]), + # The polygon data as a MULTIPOLYGON geometry type ("political_multi", os.path.join("..", "Data", "iceland", "political.shp"), [("force_wkt_type", "MULTIPOLYGON")]), - # Copy of landmarks but using an srid + # Copy of landmarks but using an srid != -1 ("landmarks_srid", os.path.join("..", "Data", "iceland", "cultural_landmark-point.shp"), [("gid_offset", 1000), @@ -551,8 +557,14 @@ poly.append(", ".join(["%r %r" % p for p in ring])) return "POLYGON((%s))" % "), (".join(poly) +def coords_to_linestring(coords): + """Return string with a LINESTRING WKT representation of coords""" + if len(coords) > 1: + raise ValueError("A LINESTRING can only have one arc") + return "LINESTRING(%s)" % ", ".join(["%r %r" % p for p in coords[0]]) + def coords_to_multilinestring(coords): - """Return string with a WKT representation of the arc in coords""" + """Return string with a MULTILINESTRING WKT representation of coords""" poly = [] for ring in coords: poly.append(", ".join(["%r %r" % p for p in ring])) @@ -567,6 +579,7 @@ wkt_converter = { "POINT": coords_to_point, + "LINESTRING": coords_to_linestring, "MULTILINESTRING": coords_to_multilinestring, "POLYGON": coords_to_polygon, "MULTIPOLYGON": coords_to_multipolygon, @@ -585,9 +598,9 @@ tablename -- The name of the table to create and into which the data is to be inserted - force_wkt_type -- If given the real WKT geometry type to use instead - of the default that would be chosen based on the type of - the shapefile + force_wkt_type -- If given and not None, this is used as the WKT + geometry type to use instead of the default that would + be chosen based on the type of the shapefile gid_offset -- A number to add to the shapeid to get the value for the gid column (default 0) From cvs at intevation.de Thu Dec 16 20:17:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 20:17:53 +0100 (CET) Subject: bh: thuban/Thuban/Model postgisdb.py,1.15,1.15.2.1 Message-ID: <20041216191753.DA0AA102BF1@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv29760/Thuban/Model Modified Files: Tag: thuban-1-0-branch postgisdb.py Log Message: Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING * test/postgissupport.py (PostgreSQLServer.get_default_static_data_db): Rename the "roads" table to "roads-multi" because it now uses MULTILINESTRING geometries and introduce a new "roads" table that uses LINESTRING (coords_to_multilinestring): Make the doc string more precise (coords_to_linestring): New. Create a LINESTRING WKT representatin (wkt_converter): Add coords_to_linestring (upload_shapefile): Rephrase the doc-string a bit. * test/test_postgis_db.py (TestPostGISShapestoreArc) (LineStringTests) (TestPostGISShapestoreLineString) (TestPostGISShapestoreMultiLineString): Split TestPostGISShapestoreArc into a base class LineStringTests and two derived classes TestPostGISShapestoreLineString for LINESTRING geometries and TestPostGISShapestoreMultiLineString for MULTILINESTRING geometries. Most test methods are in the base class with the exception of tests that explicitly check the raw format. Index: postgisdb.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/postgisdb.py,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -d -r1.15 -r1.15.2.1 --- postgisdb.py 11 Feb 2004 09:05:40 -0000 1.15 +++ postgisdb.py 16 Dec 2004 19:17:51 -0000 1.15.2.1 @@ -381,6 +381,7 @@ shapetype_map = {"POLYGON": SHAPETYPE_POLYGON, "MULTIPOLYGON": SHAPETYPE_POLYGON, + "LINESTRING": SHAPETYPE_ARC, "MULTILINESTRING": SHAPETYPE_ARC, "POINT": SHAPETYPE_POINT} From cvs at intevation.de Thu Dec 16 20:17:54 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 20:17:54 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.16,1.624.2.17 Message-ID: <20041216191754.02E0E102BF3@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv29760 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING * test/postgissupport.py (PostgreSQLServer.get_default_static_data_db): Rename the "roads" table to "roads-multi" because it now uses MULTILINESTRING geometries and introduce a new "roads" table that uses LINESTRING (coords_to_multilinestring): Make the doc string more precise (coords_to_linestring): New. Create a LINESTRING WKT representatin (wkt_converter): Add coords_to_linestring (upload_shapefile): Rephrase the doc-string a bit. * test/test_postgis_db.py (TestPostGISShapestoreArc) (LineStringTests) (TestPostGISShapestoreLineString) (TestPostGISShapestoreMultiLineString): Split TestPostGISShapestoreArc into a base class LineStringTests and two derived classes TestPostGISShapestoreLineString for LINESTRING geometries and TestPostGISShapestoreMultiLineString for MULTILINESTRING geometries. Most test methods are in the base class with the exception of tests that explicitly check the raw format. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.16 retrieving revision 1.624.2.17 diff -u -d -r1.624.2.16 -r1.624.2.17 --- ChangeLog 16 Dec 2004 10:56:17 -0000 1.624.2.16 +++ ChangeLog 16 Dec 2004 19:17:51 -0000 1.624.2.17 @@ -1,5 +1,33 @@ 2004-12-16 Bernhard Herzog + Add support for PostGIS tables with LINESTRING geomentries. + Fixes RT#2299 + + * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING + + * test/postgissupport.py + (PostgreSQLServer.get_default_static_data_db): Rename the "roads" + table to "roads-multi" because it now uses MULTILINESTRING + geometries and introduce a new "roads" table that uses LINESTRING + (coords_to_multilinestring): Make the doc string more precise + (coords_to_linestring): New. Create a LINESTRING WKT + representatin + (wkt_converter): Add coords_to_linestring + (upload_shapefile): Rephrase the doc-string a bit. + + * test/test_postgis_db.py (TestPostGISShapestoreArc) + (LineStringTests) + (TestPostGISShapestoreLineString) + (TestPostGISShapestoreMultiLineString): Split + TestPostGISShapestoreArc into a base class LineStringTests and two + derived classes TestPostGISShapestoreLineString for LINESTRING + geometries and TestPostGISShapestoreMultiLineString for + MULTILINESTRING geometries. Most test methods are in the base + class with the exception of tests that explicitly check the raw + format. + +2004-12-16 Bernhard Herzog + Fix for RT#2237 * Thuban/UI/projdialog.py (ProjFrame._show_proj_panel): If the From cvs at intevation.de Thu Dec 16 20:21:55 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 20:21:55 +0100 (CET) Subject: bh: thuban/test postgissupport.py,1.7.2.1,1.7.2.2 Message-ID: <20041216192155.551D9102BEB@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv29853/test Modified Files: Tag: thuban-1-0-branch postgissupport.py Log Message: (PostgreSQLServer.is_running) (skip_if_addgeometrycolumn_does_not_use_quote_ident): Doc-string fixes backported from HEAD Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -d -r1.7.2.1 -r1.7.2.2 --- postgissupport.py 16 Dec 2004 19:17:51 -0000 1.7.2.1 +++ postgissupport.py 16 Dec 2004 19:21:53 -0000 1.7.2.2 @@ -184,12 +184,16 @@ raise RuntimeError("postmaster didn't start") def is_running(self): - """Return true a postmaster process is running on self.dbdir + """Return whether a postmaster process is running on self.dbdir - This method runs pg_ctl status on the dbdir so even if the - object has just been created it is possible that this method - returns true if there's still a postmaster process running for - self.dbdir. + This method runs pg_ctl status on the dbdir and returns True if + that command succeeds and False otherwise. + + Note that it is possible that this method returns true even if + the PostgreSQLServer instance has just been created and + createdb() has not been called yet. This can happen, for + instance, if the server has been started manually for debugging + purposes after a test suite run. """ return run_boolean_command(["pg_ctl", "-D", self.dbdir, "status"]) @@ -535,7 +539,7 @@ The test performed by this function is a bit simplistic because it only tests whether the string 'quote_ident' occurs anywhere in the - postgis.sql file. This will hopefully works because when this was + postgis.sql file. This will hopefully work because when this was fixed in postgis CVS AddGeometryColumn was the first function to use quote_ident. """ From cvs at intevation.de Thu Dec 16 20:21:55 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 20:21:55 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.17,1.624.2.18 Message-ID: <20041216192155.6DA36102BF1@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv29853 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: (PostgreSQLServer.is_running) (skip_if_addgeometrycolumn_does_not_use_quote_ident): Doc-string fixes backported from HEAD Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.17 retrieving revision 1.624.2.18 diff -u -d -r1.624.2.17 -r1.624.2.18 --- ChangeLog 16 Dec 2004 19:17:51 -0000 1.624.2.17 +++ ChangeLog 16 Dec 2004 19:21:53 -0000 1.624.2.18 @@ -1,5 +1,11 @@ 2004-12-16 Bernhard Herzog + * test/postgissupport.py (PostgreSQLServer.is_running) + (skip_if_addgeometrycolumn_does_not_use_quote_ident): Doc-string + fixes backported from HEAD + +2004-12-16 Bernhard Herzog + Add support for PostGIS tables with LINESTRING geomentries. Fixes RT#2299 From cvs at intevation.de Thu Dec 16 21:34:05 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 21:34:05 +0100 (CET) Subject: bh: thuban/test test_postgis_db.py, 1.13.2.1, 1.13.2.2 postgissupport.py, 1.7.2.2, 1.7.2.3 Message-ID: <20041216203405.7FC9E102BD0@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv21002/test Modified Files: Tag: thuban-1-0-branch test_postgis_db.py postgissupport.py Log Message: * test/postgissupport.py (find_postgis_sql): Different postgis versions put the postgis.sql file into slightly different places so we have to look in both. The updated doc string describes this is more detail. * test/test_postgis_db.py (TestPostGISSpecialCases.test_column_name_quoting): The return value of UniqueValues is unsorted, so it has to be sorted for comparison. Index: test_postgis_db.py =================================================================== RCS file: /thubanrepository/thuban/test/test_postgis_db.py,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -d -r1.13.2.1 -r1.13.2.2 --- test_postgis_db.py 16 Dec 2004 19:17:51 -0000 1.13.2.1 +++ test_postgis_db.py 16 Dec 2004 20:34:03 -0000 1.13.2.2 @@ -216,7 +216,12 @@ self.assertEquals(table.ReadValue(2, 1, row_is_ordinal = True), 3.0) self.assertEquals(table.ReadValue(2, 1, row_is_ordinal = False), 2.0) self.assertEquals(table.ValueRange("with space"), (1.0, 3.0)) - self.assertEquals(table.UniqueValues("with \" quote"), [0, 1]) + + # The return value of UniqueValues is unsorted, so we need to + # sort it for comparison. + unique_values = table.UniqueValues("with \" quote") + unique_values.sort() + self.assertEquals(unique_values, [0, 1]) self.assertEquals(table.SimpleQuery(table.Columns()[2], "==", 1), [2, 3]) self.assertEquals(table.SimpleQuery(table.Columns()[0], "==", Index: postgissupport.py =================================================================== RCS file: /thubanrepository/thuban/test/postgissupport.py,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -d -r1.7.2.2 -r1.7.2.3 --- postgissupport.py 16 Dec 2004 19:21:53 -0000 1.7.2.2 +++ postgissupport.py 16 Dec 2004 20:34:03 -0000 1.7.2.3 @@ -17,6 +17,7 @@ import popen2 import shutil import traceback +import re import support @@ -297,17 +298,39 @@ return " ".join(params) def execute_sql(self, dbname, user, sql): - """Execute the sql statament + """Execute the sql statament and return a result for SELECT statements The user parameter us used as in connection_params. The dbname - parameter must be the name of a database in the cluster. + parameter must be the name of a database in the cluster. The + sql parameter is the SQL statement to execute as a string. If + the string starts with 'select' (matched case insensitively) the + first row of the result will be returned. Otherwise the return + value is None. """ conn = psycopg.connect("dbname=%s " % dbname + self.connection_string(user)) cursor = conn.cursor() cursor.execute(sql) + if sql.lower().startswith("select"): + row = cursor.fetchone() + else: + row = None conn.commit() conn.close() + return row + + def server_version(self): + """Return the server version as a tuple (major, minor, patch) + + Each item in the tuple is an int. + """ + result = self.execute_sql("template1", "admin", "SELECT version();")[0] + match = re.match(r"PostgreSQL (\d+\.\d+\.\d+)", result) + if match: + return tuple(map(int, match.group(1).split("."))) + else: + raise RutimeError("Cannot determine PostgreSQL server version" + " from %r" % result) def require_authentication(self, required): """Switch authentication requirements on or off @@ -319,10 +342,17 @@ corresponding call to switch it off again in the test case' tearDown method or in a finally: block. """ + # Starting with PostgreSQL 7.3 the pg_hba.conf file has an + # additional column with a username. Query the server version + # and generate a file in the correct format. + if self.server_version() >= (7, 3): + user = "all" + else: + user = "" if required: - contents = "local all password\n" + contents = "local all %s password\n" % user else: - contents = "local all trust\n" + contents = "local all %s trust\n" % user f = open(os.path.join(self.dbdir, "pg_hba.conf"), "w") f.write(contents) f.close() @@ -441,15 +471,29 @@ """Return the name of the postgis_sql file A postgis installation usually has the postgis_sql file in - PostgreSQL's datadir (i.e. the directory where PostgreSQL keeps + PostgreSQL's $datadir (i.e. the directory where PostgreSQL keeps static files, not the directory containing the databases). Unfortunately there's no way to determine the name of this directory with pg_config so we assume here that it's $bindir/../share/postgresql/. + + Furthermore, different versions of postgis place the file in + slightly different locations. For instance: + + postgis 0.7.5 $datadir/contrib/postgis.sql + postgis 0.8.1 $datadir/postgis.sql + + To support both versions, we look in both places and return the + first one found (looking under contrib first). If the file is not + found the return value is None. """ bindir = run_config_script("pg_config --bindir").strip() - return os.path.join(bindir, "..", "share", "postgresql", - "contrib", "postgis.sql") + datadir = os.path.join(bindir, "..", "share", "postgresql") + for filename in [os.path.join(datadir, "contrib", "postgis.sql"), + os.path.join(datadir, "postgis.sql")]: + if os.path.exists(filename): + return filename + _postgres_server = None def get_test_server(): From cvs at intevation.de Thu Dec 16 21:34:05 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 16 Dec 2004 21:34:05 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.18,1.624.2.19 Message-ID: <20041216203405.99756102BEB@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv21002 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: * test/postgissupport.py (find_postgis_sql): Different postgis versions put the postgis.sql file into slightly different places so we have to look in both. The updated doc string describes this is more detail. * test/test_postgis_db.py (TestPostGISSpecialCases.test_column_name_quoting): The return value of UniqueValues is unsorted, so it has to be sorted for comparison. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.18 retrieving revision 1.624.2.19 diff -u -d -r1.624.2.18 -r1.624.2.19 --- ChangeLog 16 Dec 2004 19:21:53 -0000 1.624.2.18 +++ ChangeLog 16 Dec 2004 20:34:03 -0000 1.624.2.19 @@ -1,5 +1,20 @@ 2004-12-16 Bernhard Herzog + Make the test suite work with PostGIS 0.8.2 and PostgreSQL 7.4 + Yet another backport from HEAD + + * test/postgissupport.py (find_postgis_sql): Different postgis + versions put the postgis.sql file into slightly different places + so we have to look in both. The updated doc string describes this + is more detail. + + * test/test_postgis_db.py + (TestPostGISSpecialCases.test_column_name_quoting): The return + value of UniqueValues is unsorted, so it has to be sorted for + comparison. + +2004-12-16 Bernhard Herzog + * test/postgissupport.py (PostgreSQLServer.is_running) (skip_if_addgeometrycolumn_does_not_use_quote_ident): Doc-string fixes backported from HEAD From dcalvelo at minag.gob.pe Fri Dec 17 09:04:00 2004 From: dcalvelo at minag.gob.pe (Daniel Calvelo Aros) Date: Fri, 17 Dec 2004 03:04:00 -0500 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041215213937.GA29934@intevation.de> References: <20041215213937.GA29934@intevation.de> Message-ID: <20041217080219.M32302@minag.gob.pe> Attached are fr and es. Shorter than I thought. One question, though: what about extensions? Daniel. -- Daniel Calvelo Aros ---------- Original Message ----------- From: Jan-Oliver Wagner To: Thuban Developer Mailing List Sent: Wed, 15 Dec 2004 22:39:37 +0100 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 > Dear Thuban translators, > > soon thuban-1-0-branch is string-freezed for release > of 1.0.1. > > Can those of you who are ready to update the po files > quickly give me a short ping and let me know whether > you can work on CVS directly (in that case we do > not need to prepare a special tar-ball) and what your > reaction time will be in the next couple of days. > > Thanks and all the best > > Jan > -- > Jan-Oliver Wagner http://intevation.de/~jan/ > > Intevation GmbH http://intevation.de/ > FreeGIS http://freegis.org/ > > _______________________________________________ > Thuban-devel mailing list > Thuban-devel at intevation.de > https://intevation.de/mailman/listinfo/thuban-devel ------- End of Original Message ------- -------------- next part -------------- A non-text attachment was scrubbed... Name: es+fr.zip Type: application/zip Size: 19992 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041217/69e24cc8/esfr.zip From jan at intevation.de Fri Dec 17 09:25:26 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Fri, 17 Dec 2004 09:25:26 +0100 Subject: [Thuban-devel] Re: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041217080219.M32302@minag.gob.pe> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> Message-ID: <20041217082526.GB2730@intevation.de> On Fri, Dec 17, 2004 at 03:04:00AM -0500, Daniel Calvelo Aros wrote: > Attached are fr and es. Shorter than I thought. oops, that was quick. Actually we did not yet announce string freeze... in my last email I waas only asking for readiness. > One question, though: what about extensions? Good question. I vote for adding them for translation. Most strings there are already using _(). -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From thuban-bugs at intevation.de Fri Dec 17 16:03:36 2004 From: thuban-bugs at intevation.de (guest user via RT) Date: Fri, 17 Dec 2004 16:03:36 +0100 (CET) Subject: [bug #2850] (thuban) Selecting Projection... menu item crashes Thuban (segfault) Message-ID: <20041217150336.C4AC2102C35@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2850 Request number 2850 was commented on by 'guest' (guest user). Responding to this message will send mail to the requestor. Request Tracker rt at intevation.de -------------------------------------------------------------- Cc: thuban-devel at intevation.de Aha! I have nailed the problem down to non-ASCII characters in Resources/Projections/defaults.proj. If you remove the accented characters from the Lambert-93 projection name, the segfault goes away. -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Fri Dec 17 16:54:25 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 17 Dec 2004 16:54:25 +0100 (CET) Subject: bh: thuban/Thuban/UI about.py,1.11.2.2,1.11.2.3 Message-ID: <20041217155425.8E53C102BE2@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv8072/Thuban/UI Modified Files: Tag: thuban-1-0-branch about.py Log Message: (unicodeToLocale): Use getdefaultlocale instead of getlocale because it yields a usable encoding name on a german windows 2000 Index: about.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/about.py,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -u -d -r1.11.2.2 -r1.11.2.3 --- about.py 15 Dec 2004 14:49:55 -0000 1.11.2.2 +++ about.py 17 Dec 2004 15:54:23 -0000 1.11.2.3 @@ -13,7 +13,7 @@ from wxPython.wx import * -from locale import getlocale +from locale import getdefaultlocale from Thuban import _ from Thuban.version import versions @@ -133,5 +133,4 @@ def unicodeToLocale(unicodeStr): "Function to convert unicode to the user's locale encoding" - - return unicodeStr.encode(getlocale()[1]) + return unicodeStr.encode(getdefaultlocale()[1]) From cvs at intevation.de Fri Dec 17 16:54:25 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 17 Dec 2004 16:54:25 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.19,1.624.2.20 Message-ID: <20041217155425.997CA102BEC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv8072 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: (unicodeToLocale): Use getdefaultlocale instead of getlocale because it yields a usable encoding name on a german windows 2000 Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.19 retrieving revision 1.624.2.20 diff -u -d -r1.624.2.19 -r1.624.2.20 --- ChangeLog 16 Dec 2004 20:34:03 -0000 1.624.2.19 +++ ChangeLog 17 Dec 2004 15:54:23 -0000 1.624.2.20 @@ -1,3 +1,9 @@ +2004-12-17 Bernhard Herzog + + * Thuban/UI/about.py (unicodeToLocale): Use getdefaultlocale + instead of getlocale because it yields a usable encoding name on + a german windows 2000 + 2004-12-16 Bernhard Herzog Make the test suite work with PostGIS 0.8.2 and PostgreSQL 7.4 From cvs at intevation.de Fri Dec 17 18:51:50 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 17 Dec 2004 18:51:50 +0100 (CET) Subject: bh: thuban setup.py,1.44,1.44.2.1 ChangeLog,1.624.2.20,1.624.2.21 Message-ID: <20041217175150.A54D3102BF4@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv9719 Modified Files: Tag: thuban-1-0-branch setup.py ChangeLog Log Message: windows build: Removed the absolute path names and made all prfixes relative to the directory containing setup.py. Makes it a little easier to adapt to a different system. Index: setup.py =================================================================== RCS file: /thubanrepository/thuban/setup.py,v retrieving revision 1.44 retrieving revision 1.44.2.1 diff -u -d -r1.44 -r1.44.2.1 --- setup.py 22 Dec 2003 17:49:43 -0000 1.44 +++ setup.py 17 Dec 2004 17:51:48 -0000 1.44.2.1 @@ -1,4 +1,4 @@ -# Copyright (c) 2001, 2002, 2003 by Intevation GmbH +# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH # Authors: # Bernhard Herzog # @@ -15,6 +15,7 @@ # hand below. # +import sys import os from types import TupleType import glob @@ -81,21 +82,23 @@ ################################################################# # Windows configuration. # - + + basedir = os.path.dirname(sys.argv[0]) + # Directories where Proj4 is installed - proj4_prefix = r"D:\cygwin\home\user\projects\thuban\proj-4.4.7\src" + proj4_prefix = os.path.join(basedir, "..", "proj-4.4.7", "src") proj4_incdir = proj4_prefix proj4_libdir = proj4_prefix proj4_lib = "proj_i" # Define include and lib directories for wxWindows and - wx_prefix = r"d:\cygwin\home\user\projects\thuban\wxPython-2.4.0.7" + wx_prefix = os.path.join(basedir, "..", "wxPython-2.4.2.4") wx_inc = [os.path.join(wx_prefix, 'lib', 'mswdllh'), os.path.join(wx_prefix, "include")] wx_lib = [os.path.join(wx_prefix, "lib")] # Define include and lib directories for GDAL - gdal_prefix = r"D:\cygwin\home\user\projects\thuban\gdal-1.1.8" + gdal_prefix = os.path.join(basedir, "..", "gdal-1.1.8") gdal_inc = [os.path.join(gdal_prefix, 'alg'), os.path.join(gdal_prefix, 'ogr'), os.path.join(gdal_prefix, 'port'), Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.20 retrieving revision 1.624.2.21 diff -u -d -r1.624.2.20 -r1.624.2.21 --- ChangeLog 17 Dec 2004 15:54:23 -0000 1.624.2.20 +++ ChangeLog 17 Dec 2004 17:51:48 -0000 1.624.2.21 @@ -1,5 +1,11 @@ 2004-12-17 Bernhard Herzog + * setup.py: windows build: Removed the absolute path names and + made all prfixes relative to the directory containing setup.py. + Makes it a little easier to adapt to a different system. + +2004-12-17 Bernhard Herzog + * Thuban/UI/about.py (unicodeToLocale): Use getdefaultlocale instead of getlocale because it yields a usable encoding name on a german windows 2000 From cvs at intevation.de Fri Dec 17 19:48:51 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 17 Dec 2004 19:48:51 +0100 (CET) Subject: bh: thuban/Thuban/UI about.py,1.17,1.18 Message-ID: <20041217184851.10C33102C2E@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv10472/Thuban/UI Modified Files: about.py Log Message: * Thuban/UI/about.py (unicodeToLocale): Use getdefaultlocale instead of getlocale because getlocale doesn't return a usable encoding name on a german windows 2000 * setup.py: windows build: Removed the absolute path names and made all prfixes relative to the directory containing setup.py. Makes it a little easier to adapt to a different system. Index: about.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/about.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- about.py 27 Nov 2004 21:40:01 -0000 1.17 +++ about.py 17 Dec 2004 18:48:49 -0000 1.18 @@ -15,7 +15,7 @@ from wxPython.wx import * -from locale import getlocale +from locale import getdefaultlocale from Thuban import _ from Thuban.version import versions @@ -165,6 +165,8 @@ def unicodeToLocale(unicodeStr): "Function to convert unicode to the user's locale encoding" - - return unicodeStr.encode(getlocale()[1]) - + # Under a german windows 2000 getlocale returns an encoding name + # that's not direcly usable (it's missing a "cp" at the beginning). + # getdefaultlocale does return a usable encoding name so we use that + # instead. + return unicodeStr.encode(getdefaultlocale()[1]) From cvs at intevation.de Fri Dec 17 19:48:51 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 17 Dec 2004 19:48:51 +0100 (CET) Subject: bh: thuban setup.py,1.45,1.46 ChangeLog,1.737,1.738 Message-ID: <20041217184851.1D229102C3C@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv10472 Modified Files: setup.py ChangeLog Log Message: * Thuban/UI/about.py (unicodeToLocale): Use getdefaultlocale instead of getlocale because getlocale doesn't return a usable encoding name on a german windows 2000 * setup.py: windows build: Removed the absolute path names and made all prfixes relative to the directory containing setup.py. Makes it a little easier to adapt to a different system. Index: setup.py =================================================================== RCS file: /thubanrepository/thuban/setup.py,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- setup.py 17 May 2004 15:47:57 -0000 1.45 +++ setup.py 17 Dec 2004 18:48:49 -0000 1.46 @@ -15,6 +15,7 @@ # hand below. # +import sys import os from types import TupleType import glob @@ -81,21 +82,23 @@ ################################################################# # Windows configuration. # - + + basedir = os.path.dirname(sys.argv[0]) + # Directories where Proj4 is installed - proj4_prefix = r"D:\cygwin\home\user\projects\thuban\proj-4.4.7\src" + proj4_prefix = os.path.join(basedir, "..", "proj-4.4.7", "src") proj4_incdir = proj4_prefix proj4_libdir = proj4_prefix proj4_lib = "proj_i" # Define include and lib directories for wxWindows and - wx_prefix = r"d:\cygwin\home\user\projects\thuban\wxPython-2.4.0.7" + wx_prefix = os.path.join(basedir, "..", "wxPython-2.4.2.4") wx_inc = [os.path.join(wx_prefix, 'lib', 'mswdllh'), os.path.join(wx_prefix, "include")] wx_lib = [os.path.join(wx_prefix, "lib")] # Define include and lib directories for GDAL - gdal_prefix = r"D:\cygwin\home\user\projects\thuban\gdal-1.1.8" + gdal_prefix = os.path.join(basedir, "..", "gdal-1.1.8") gdal_inc = [os.path.join(gdal_prefix, 'alg'), os.path.join(gdal_prefix, 'ogr'), os.path.join(gdal_prefix, 'port'), Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.737 retrieving revision 1.738 diff -u -d -r1.737 -r1.738 --- ChangeLog 16 Dec 2004 15:18:57 -0000 1.737 +++ ChangeLog 17 Dec 2004 18:48:49 -0000 1.738 @@ -1,3 +1,15 @@ +2004-12-17 Bernhard Herzog + + Two windows specific fixes ported from thuban-1­0-branch: + + * Thuban/UI/about.py (unicodeToLocale): Use getdefaultlocale + instead of getlocale because getlocale doesn't return a usable + encoding name on a german windows 2000 + + * setup.py: windows build: Removed the absolute path names and + made all prfixes relative to the directory containing setup.py. + Makes it a little easier to adapt to a different system. + 2004-12-16 Bernhard Herzog Add support for PostGIS tables with LINESTRING geomentries. From thuban-bugs at intevation.de Fri Dec 17 23:22:11 2004 From: thuban-bugs at intevation.de (guest user via RT) Date: Fri, 17 Dec 2004 23:22:11 +0100 (CET) Subject: [bug #2850] (thuban) Selecting Projection... menu item crashes Thuban (segfault) Message-ID: <20041217222211.C77FC102BCD@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2850 Request number 2850 was commented on by 'guest' (guest user). Responding to this message will send mail to the requestor. Request Tracker rt at intevation.de -------------------------------------------------------------- Cc: thuban-devel at intevation.de Aha! I have nailed the problem down to non-ASCII characters in Resources/Projections/defaults.proj. If you remove the accented characters from the Lambert-93 projection name, the segfault goes away. -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Sat Dec 18 00:06:05 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 00:06:05 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.738,1.739 Message-ID: <20041217230605.167E7102BE2@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv14182 Modified Files: ChangeLog Log Message: Refactored svgexport tests: 9 double tests runs eliminated; code size reduced by 8 lines. * Extensions/svgexport/test/test_svgmapwriter.py: (class TestWithDC): Renamed to BaseTestWithDC, moved to top. (class BaseWithDCtools): New, subclass from BaseTestWithDC. (class TestDrawSplines): now subclass from BaseTestWithDCtools, this fixed the double running of the nine tests of TestVirtualDC. (class TestVirtualDC): Using self.dc and self.file from setUp(). Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.738 retrieving revision 1.739 diff -u -d -r1.738 -r1.739 --- ChangeLog 17 Dec 2004 18:48:49 -0000 1.738 +++ ChangeLog 17 Dec 2004 23:06:03 -0000 1.739 @@ -1,3 +1,15 @@ +2004-12-18 Bernhard Reiter + + Refactored svgexport tests: 9 double tests runs eliminated; + code size reduced by 8 lines. + + * Extensions/svgexport/test/test_svgmapwriter.py: + (class TestWithDC): Renamed to BaseTestWithDC, moved to top. + (class BaseWithDCtools): New, subclass from BaseTestWithDC. + (class TestDrawSplines): now subclass from BaseTestWithDCtools, + this fixed the double running of the nine tests of TestVirtualDC. + (class TestVirtualDC): Using self.dc and self.file from setUp(). + 2004-12-17 Bernhard Herzog Two windows specific fixes ported from thuban-1­0-branch: @@ -12,7 +24,7 @@ 2004-12-16 Bernhard Herzog - Add support for PostGIS tables with LINESTRING geomentries. + Add support for PostGIS tables with LINESTRING geometries. Fixes RT#2299 * Thuban/Model/postgisdb.py (shapetype_map): Add LINESTRING From cvs at intevation.de Sat Dec 18 00:06:05 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 00:06:05 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.14, 1.15 Message-ID: <20041217230605.1C8E3102BE4@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv14182/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: Refactored svgexport tests: 9 double tests runs eliminated; code size reduced by 8 lines. * Extensions/svgexport/test/test_svgmapwriter.py: (class TestWithDC): Renamed to BaseTestWithDC, moved to top. (class BaseWithDCtools): New, subclass from BaseTestWithDC. (class TestDrawSplines): now subclass from BaseTestWithDCtools, this fixed the double running of the nine tests of TestVirtualDC. (class TestVirtualDC): Using self.dc and self.file from setUp(). Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_svgmapwriter.py 13 Dec 2004 14:59:24 -0000 1.14 +++ test_svgmapwriter.py 17 Dec 2004 23:06:03 -0000 1.15 @@ -46,12 +46,33 @@ # We use xmlsupport to verify the SVG output import xmlsupport -class TestVirtualDC(unittest.TestCase): - '''Test VirtualDC capabilities that imitates a wxDC and writes - SVGRenderer instead.''' +class BaseTestWithDC(unittest.TestCase): + """Add dc creation and self.to_destroy list to setUp() and tearDown(). + This is a baseclass for tests needing a dc. + """ def setUp(self): - '''Initialize our tools.''' + """Create dc for testing and set up self.to_destroy. + + Test should put all objects whose Destroy + should be called at unittest.main + the end into this list so that they're destroyed in tearDown + """ + self.to_destroy = [] + + self.file = StringIO.StringIO() + self.dc = VirtualDC(self.file) + + def tearDown(self): + for obj in self.to_destroy: + obj.Destroy() + + +class BaseTestWithDCtools(BaseTestWithDC): + """Add standard colors and polygon to setUp() for DC tests.""" + def setUp(self): + """Initialize tools.""" + BaseTestWithDC.setUp(self) self.black = Black self.solid_pen = Pen(Color(1.0, 0.0, 1.0), 3, SOLID) self.trans_pen = TRANSPARENT_PEN @@ -61,31 +82,32 @@ Point(5.0,95.0), Point(5.0,5.0)] self.meta = {"Object":"test", "Label":"nothing"} self.font = Font("Helvetica", 12) - + + +class TestVirtualDC(BaseTestWithDCtools): + '''Test VirtualDC imitating a wxDC and writing SVGRenderer instead.''' + def test_clippath(self): '''Define a clipping region and close it afterwards.''' data = '\n' - file = StringIO.StringIO() - dc = VirtualDC(file) - dc.BeginClipPath('testid') - dc.EndClipPath() - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - + self.dc.BeginClipPath('testid') + self.dc.EndClipPath() + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_polygon_closed(self): '''Set drawing properties and draw a polygon onto the dc.''' data = ('') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) dc.DrawPolygon(self.polygon, 1) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) def test_polygon_opened(self): '''Set drawing properties and draw a polygon onto the dc.''' @@ -93,14 +115,13 @@ 'stroke-width:3; stroke-linecap:round; fill:#00ff00" ' 'meta="Object:test; Label:nothing" d="M 5.6 5.5' '\nL 95.4 5.3\nL 95.2 95.1\nL 5.0 95.0\nL 5.0 5.0"/>') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) dc.DrawPolygon(self.polygon, 0) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) def test_transparent_polygon(self): '''Test dc drawing a transparent polygon.''' @@ -108,87 +129,80 @@ 'stroke-width:3; stroke-linecap:round; fill:none" ' 'meta="Object:test; Label:nothing" d="M 5.6 5.5' ' L 95.4 5.3\nL 95.2 95.1\nL 5.0 95.0\nL 5.0 5.0"/>') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.trans_brush) dc.DrawPolygon(self.polygon, 0) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_rect(self): '''Set drawing properties and draw a rectangle''' data = ('') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.trans_brush) dc.DrawRectangle(5.5, 5.4, 90.3, 90.2) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_circle(self): '''Set drawing properties and draw a circle''' data = ('') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetPen(self.trans_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) dc.DrawCircle(5.5, 5.3, 90.1) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_ellipse(self): '''Set drawing properties and draw a circle''' data = ('') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetPen(self.trans_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) dc.DrawEllipse(5.5, 5.3, 90.1, 100.321) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_text(self): '''Set drawing properties and draw a circle''' data = ('Some text.') - file = StringIO.StringIO() - dc = VirtualDC(file) + dc = self.dc dc.SetTextForeground(self.black) dc.SetFont(self.font) dc.DrawText('Some text.', 123.321, 1515.5151) - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) - + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_document(self): '''Set up a document with a dimension and latin encoding''' data = ('\n\n') - file = StringIO.StringIO() - dc = VirtualDC(file) - dc.BeginExport() - dc.EndExport() - self.assertEquals(xmlsupport.sax_eventlist(data = data), - xmlsupport.sax_eventlist(data = file.getvalue())) + self.dc.BeginExport() + self.dc.EndExport() + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) -class TestDrawSplines(TestVirtualDC): +class TestDrawSplines(BaseTestWithDCtools): """Testing DrawSpline variations. See comments in DrawSpline(). """ def setUp(self): - TestVirtualDC.setUp(self) + BaseTestWithDCtools.setUp(self) self.dataframe = ('') @@ -227,29 +241,8 @@ xmlsupport.sax_eventlist(data = self.file.getvalue())) -class TestWithDC(unittest.TestCase): - """Add dc creation and self.to_destroy list to setUp() and tearDown(). - - This is a baseclass for tests needing a dc. - """ - - def setUp(self): - """Create dc for testing and set up self.to_destroy. - - Test should put all objects whose Destroy - should be called at unittest.main - the end into this list so that they're destroyed in tearDown - """ - self.to_destroy = [] - - file = StringIO.StringIO() - self.dc = VirtualDC(file) - - def tearDown(self): - for obj in self.to_destroy: - obj.Destroy() -class TestSVGRendererIDHandling(TestWithDC): +class TestSVGRendererIDHandling(BaseTestWithDC): def test_make_id_nonintegersetid(self): """Test that exception is raised when SetID was called with chars.""" @@ -342,7 +335,7 @@ self.assertRaises(SVGMapWriterError, renderer.RenderMap, None, None) -class Testobjectexport(TestWithDC): +class Testobjectexport(BaseTestWithDC): def test_transparent_polygon(self): """ Create layer with non-filled polygon and test svg rendering.""" From bernhard at intevation.de Sat Dec 18 00:08:23 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Sat, 18 Dec 2004 00:08:23 +0100 Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.11, 1.12 In-Reply-To: <20041213155158.GP17099@intevation.de> References: <20041211020349.9F4C4102C2D@lists.intevation.de> <20041213155158.GP17099@intevation.de> Message-ID: <20041217230823.GA30718@intevation.de> On Mon, Dec 13, 2004 at 04:51:58PM +0100, Bernhard Reiter wrote: > On Mon, Dec 13, 2004 at 03:57:53PM +0100, Bernhard Herzog wrote: > > > > +class TestDrawSplines(TestVirtualDC): > > > > First, do you realise that you inflate the number of tests by deriving > > from a baseclass that defines test_* methods? > > What a stupid mistake, good that you have noticed it. Fixed. -------------- 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/20041218/6ac9d656/attachment.bin From cvs at intevation.de Sat Dec 18 01:29:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 01:29:06 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.739,1.740 Message-ID: <20041218002906.A11AB102BE2@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv14941 Modified Files: ChangeLog Log Message: Refactored in svgexport: DrawPath replaces DrawPolygon; added newline in front of "M" in paths. * Extensions/svgexport/svgmapwriter.py Added verbosity level 3 to print out polygon points. (class Point): added __repr__ (class Brush, __str__()): Added space after ,. (DrawPolygon): Renamed to DrawPath() (DrawPath): Takes list of polygons as input now, adds \n before "M"s. (DrawLines): Using DrawPath now. * Extensions/svgexport/test/test_svgmapwriter.py: Replaced DrawPolygon() calls with DrawPath() and put the first argument inside another list. Adapted test data with a newline before "M". Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.739 retrieving revision 1.740 diff -u -d -r1.739 -r1.740 --- ChangeLog 17 Dec 2004 23:06:03 -0000 1.739 +++ ChangeLog 18 Dec 2004 00:29:04 -0000 1.740 @@ -1,4 +1,21 @@ 2004-12-18 Bernhard Reiter + + Refactored in svgexport: + DrawPath replaces DrawPolygon; added newline in front of "M" in paths. + + * Extensions/svgexport/svgmapwriter.py + Added verbosity level 3 to print out polygon points. + (class Point): added __repr__ + (class Brush, __str__()): Added space after ,. + (DrawPolygon): Renamed to DrawPath() + (DrawPath): Takes list of polygons as input now, adds \n before "M"s. + (DrawLines): Using DrawPath now. + + * Extensions/svgexport/test/test_svgmapwriter.py: + Replaced DrawPolygon() calls with DrawPath() and put the first argument + inside another list. Adapted test data with a newline before "M". + +2004-12-18 Bernhard Reiter Refactored svgexport tests: 9 double tests runs eliminated; code size reduced by 8 lines. From cvs at intevation.de Sat Dec 18 01:29:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 01:29:06 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport svgmapwriter.py,1.11,1.12 Message-ID: <20041218002906.A875E102BE4@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv14941/Extensions/svgexport Modified Files: svgmapwriter.py Log Message: Refactored in svgexport: DrawPath replaces DrawPolygon; added newline in front of "M" in paths. * Extensions/svgexport/svgmapwriter.py Added verbosity level 3 to print out polygon points. (class Point): added __repr__ (class Brush, __str__()): Added space after ,. (DrawPolygon): Renamed to DrawPath() (DrawPath): Takes list of polygons as input now, adds \n before "M"s. (DrawLines): Using DrawPath now. * Extensions/svgexport/test/test_svgmapwriter.py: Replaced DrawPolygon() calls with DrawPath() and put the first argument inside another list. Adapted test data with a newline before "M". Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- svgmapwriter.py 11 Dec 2004 03:24:36 -0000 1.11 +++ svgmapwriter.py 18 Dec 2004 00:29:04 -0000 1.12 @@ -21,7 +21,7 @@ import sys -# Verboseness level for debugging. +# Verboseness level for debugging. Useful values: 0,1,2,3 verbose=0 log=sys.stdout.write @@ -63,6 +63,9 @@ self.x = xp self.y = yp + def __repr__(self): + return "Point(%s, %s)" % (str(self.x), str(self.y)) + class Trafo: """Class for transformation properties transfer.""" def __init__(self): @@ -125,7 +128,7 @@ self.pattern = bpattern def __str__(self): - return "Brush(" + str(self.fill) + "," + str(self.pattern) + ")" + return "Brush(" + str(self.fill) + ", " + str(self.pattern) + ")" def GetColor(self): return self.fill @@ -217,15 +220,14 @@ if verbose > 1: log("drawing polygon with brush %s and pen %s\n" % (str(brush), str(pen)) ) + if verbose > 2: + log("points: %s\n" %(repr(points))) self.dc.SetBrush(brush) self.dc.SetPen(pen) - # FIXME: understand what BaseRenderer.draw_polygon_shape does - # so complicated here and fix it here, too. - # Maybe that is handling of holes? for parts in points: - self.dc.DrawPolygon(parts,closed=1) - + self.dc.DrawPath([parts],closed=1) + def draw_point_shape(self, layer, points, pen, brush, size=2): """Draw a point shape from layer with the given brush and pen @@ -239,7 +241,7 @@ points = self.projected_points(layer, points) if not points: return - + radius = self.factor * size self.dc.SetBrush(brush) self.dc.SetPen(pen) @@ -687,22 +689,24 @@ """Draw some points into a Buffer that will be written before the next object. """ - self.DrawPolygon(points,0) + self.DrawPath([points],0) - def DrawPolygon(self, polygon, closed=1): - """Draw a polygon onto the virtual dc.""" + def DrawPath(self, path, closed=1): + """Draw a polygon with sonto the virtual dc.""" self.write_indent('\n' % (self.make_id(), self.make_meta(), join(data, '') ) ) From cvs at intevation.de Sat Dec 18 01:29:06 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 01:29:06 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.15, 1.16 Message-ID: <20041218002906.ADD66102C13@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv14941/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: Refactored in svgexport: DrawPath replaces DrawPolygon; added newline in front of "M" in paths. * Extensions/svgexport/svgmapwriter.py Added verbosity level 3 to print out polygon points. (class Point): added __repr__ (class Brush, __str__()): Added space after ,. (DrawPolygon): Renamed to DrawPath() (DrawPath): Takes list of polygons as input now, adds \n before "M"s. (DrawLines): Using DrawPath now. * Extensions/svgexport/test/test_svgmapwriter.py: Replaced DrawPolygon() calls with DrawPath() and put the first argument inside another list. Adapted test data with a newline before "M". Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test_svgmapwriter.py 17 Dec 2004 23:06:03 -0000 1.15 +++ test_svgmapwriter.py 18 Dec 2004 00:29:04 -0000 1.16 @@ -99,13 +99,13 @@ '''Set drawing properties and draw a polygon onto the dc.''' data = ('') dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) - dc.DrawPolygon(self.polygon, 1) + dc.DrawPath([self.polygon], 1) self.assertEquals(xmlsupport.sax_eventlist(data=data), xmlsupport.sax_eventlist(data=self.file.getvalue())) @@ -113,13 +113,13 @@ '''Set drawing properties and draw a polygon onto the dc.''' data = ('') dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) - dc.DrawPolygon(self.polygon, 0) + dc.DrawPath([self.polygon], 0) self.assertEquals(xmlsupport.sax_eventlist(data=data), xmlsupport.sax_eventlist(data=self.file.getvalue())) @@ -127,13 +127,13 @@ '''Test dc drawing a transparent polygon.''' data = ('') dc = self.dc dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.trans_brush) - dc.DrawPolygon(self.polygon, 0) + dc.DrawPath([self.polygon], 0) self.assertEquals(xmlsupport.sax_eventlist(data=data), xmlsupport.sax_eventlist(data=self.file.getvalue())) @@ -349,7 +349,7 @@ ' \n' + ' d="\nM 0.0 0.0\nL 10.0 -10.0\nL 0.0 -10.0\nL 0.0 0.0 Z"/>\n' ' \n\n') table = MemoryTable([("type", FIELDTYPE_STRING), ("value", FIELDTYPE_DOUBLE), From cvs at intevation.de Sat Dec 18 01:32:50 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 01:32:50 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport TODO,NONE,1.1 Message-ID: <20041218003250.D0D1D102BE2@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv15044/Extensions/svgexport Added Files: TODO Log Message: Added Extensions/svgexport/TODO --- NEW FILE: TODO --- Todo file for Thuban svgexport Extension For 1.0.0: * Support holes and islands in a "polygon". * Add basic documentation For 1.0.x: Better support for variable Point sizes: * a real test for variable point sizes * save point size in an svg attribute value * Create a better legend for variable point symbols * add a progress bar or something so that the user is informed during exports of huge files. A simple interator return of draw_shape_layer_incrementally() might not be enough, because the user might stop this operation when doing something. For later: * use styles for the geographic objects in one class in each layer after making sure that Skencil can do this, too. From cvs at intevation.de Sat Dec 18 01:32:50 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 01:32:50 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.740,1.741 Message-ID: <20041218003250.D3D14102BE4@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv15044 Modified Files: ChangeLog Log Message: Added Extensions/svgexport/TODO Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.740 retrieving revision 1.741 diff -u -d -r1.740 -r1.741 --- ChangeLog 18 Dec 2004 00:29:04 -0000 1.740 +++ ChangeLog 18 Dec 2004 00:32:48 -0000 1.741 @@ -1,5 +1,9 @@ 2004-12-18 Bernhard Reiter + Added Extensions/svgexport/TODO + +2004-12-18 Bernhard Reiter + Refactored in svgexport: DrawPath replaces DrawPolygon; added newline in front of "M" in paths. From cvs at intevation.de Sat Dec 18 03:37:01 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 03:37:01 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.741,1.742 Message-ID: <20041218023701.D3BC010015A@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv16171 Modified Files: ChangeLog Log Message: svgexport 1.0.0: Treats holes and islands nicely. Documentation added. * Extensions/svgexport/test/test_svgmapwriter.py: Added new tests: test_export_polygon_with_hole() and test_polygon_with_hole(). * Extensions/svgexport/svgmapwriter.py (draw_polygon_shape()): Uses DrawPath correctly now. * Doc/manual/thuban-manual.xml: Added documentation for stable extention svgexport. * Doc/manual/thuban-manual-de.xml: Copied English section about svexport over. * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. * Extensions/svgexport/svgsaver.py,maplegend.py: Moved from experimental to stable extension menu. * Extensions/svgexport/TODO: updated. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.741 retrieving revision 1.742 diff -u -d -r1.741 -r1.742 --- ChangeLog 18 Dec 2004 00:32:48 -0000 1.741 +++ ChangeLog 18 Dec 2004 02:36:59 -0000 1.742 @@ -1,5 +1,29 @@ 2004-12-18 Bernhard Reiter + svgexport 1.0.0: Treats holes and islands nicely. Documentation added. + + * Extensions/svgexport/test/test_svgmapwriter.py: + Added new tests: test_export_polygon_with_hole() + and test_polygon_with_hole(). + + * Extensions/svgexport/svgmapwriter.py + (draw_polygon_shape()): Uses DrawPath correctly now. + + * Doc/manual/thuban-manual.xml: Added documentation for stable + extention svgexport. + * Doc/manual/thuban-manual-de.xml: Copied English section about + svexport over. + + * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. + + * Extensions/svgexport/svgsaver.py,maplegend.py: + Moved from experimental to stable extension menu. + + * Extensions/svgexport/TODO: updated. + + +2004-12-18 Bernhard Reiter + Added Extensions/svgexport/TODO 2004-12-18 Bernhard Reiter From cvs at intevation.de Sat Dec 18 03:37:01 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 03:37:01 +0100 (CET) Subject: bernhard: thuban/Doc/manual thuban-manual-de.xml, 1.3, 1.4 thuban-manual.xml, 1.28, 1.29 Message-ID: <20041218023701.E08E310015F@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Doc/manual In directory doto:/tmp/cvs-serv16171/Doc/manual Modified Files: thuban-manual-de.xml thuban-manual.xml Log Message: svgexport 1.0.0: Treats holes and islands nicely. Documentation added. * Extensions/svgexport/test/test_svgmapwriter.py: Added new tests: test_export_polygon_with_hole() and test_polygon_with_hole(). * Extensions/svgexport/svgmapwriter.py (draw_polygon_shape()): Uses DrawPath correctly now. * Doc/manual/thuban-manual.xml: Added documentation for stable extention svgexport. * Doc/manual/thuban-manual-de.xml: Copied English section about svexport over. * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. * Extensions/svgexport/svgsaver.py,maplegend.py: Moved from experimental to stable extension menu. * Extensions/svgexport/TODO: updated. Index: thuban-manual-de.xml =================================================================== RCS file: /thubanrepository/thuban/Doc/manual/thuban-manual-de.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- thuban-manual-de.xml 3 Oct 2004 19:37:37 -0000 1.3 +++ thuban-manual-de.xml 18 Dec 2004 02:36:59 -0000 1.4 @@ -1673,7 +1673,7 @@ They are considered to be free of bugs, but may be further polished with helpful user interactions. -
gns2shp +
gns2shp This tool converts data of the Geospatial Names Server (GNS, see ) @@ -1700,7 +1700,47 @@ is included in the directory Extensions/gns2shp/test. -
+
+
SVG Export + + Map and legend can be exported separately in the + Thuban-Map-SVG format. + You get files that comply with + the Scalable Vector Graphics (SVG) 1.1 Specification + and can be read by many vector drawing applications. + + + Goal of svgexport is to provide + the start of a printing pipeline for Thuban. + For this purpose the written Thuban-Map-SVG files + contain information that can be used in postprocessing. + Typically a general vector drawing application is + more powerful then a geographic information viewer; + e.g. having much fancier symbols and fonts. + Also users benefit much more when learning to use a + more general application they can also use for other + tasks. So the charming idea is to enable + the drawing application to postprocess a Thuban maps. + So thee xtra information in the format will make it + possible to export from Thuban and if a few geoobjects + change, and keep the general layout and style + of the full map in the vector drawing appplication. + + + Markus Rechtien has developed a prototype of this + printing pipline as his Diplom thetis, showing + the feasability of Bernhard Reiter's concept. + Scripts exist for the drawing application Skencil + (). + + + Technical notes: the names of the layers are used + as base for ids within the SVG format. + If you try to export with two layers having + the same name, you will get a name clash error. + Just change one of the layer names and try again. + +
Experimental extensions Index: thuban-manual.xml =================================================================== RCS file: /thubanrepository/thuban/Doc/manual/thuban-manual.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- thuban-manual.xml 13 Dec 2004 11:53:15 -0000 1.28 +++ thuban-manual.xml 18 Dec 2004 02:36:59 -0000 1.29 @@ -1673,13 +1673,13 @@
Stable extensions - - These extensions provide extra-functionality to Thuban - that has not (yet) been integrated in the main application. - They are considered to be free of bugs, but may be - further polished with helpful user interactions. - -
gns2shp + + These extensions provide extra-functionality to Thuban + that has not (yet) been integrated in the main application. + They are considered to be free of bugs, but may be + further polished with helpful user interactions. + +
gns2shp This tool converts data of the Geospatial Names Server (GNS, see ) @@ -1706,7 +1706,47 @@ is included in the directory Extensions/gns2shp/test. -
+
+
SVG Export + + Map and legend can be exported separately in the + Thuban-Map-SVG format. + You get files that comply with + the Scalable Vector Graphics (SVG) 1.1 Specification + and can be read by many vector drawing applications. + + + Goal of svgexport is to provide + the start of a printing pipeline for Thuban. + For this purpose the written Thuban-Map-SVG files + contain information that can be used in postprocessing. + Typically a general vector drawing application is + more powerful then a geographic information viewer; + e.g. having much fancier symbols and fonts. + Also users benefit much more when learning to use a + more general application they can also use for other + tasks. So the charming idea is to enable + the drawing application to postprocess a Thuban maps. + So thee xtra information in the format will make it + possible to export from Thuban and if a few geoobjects + change, and keep the general layout and style + of the full map in the vector drawing appplication. + + + Markus Rechtien has developed a prototype of this + printing pipline as his Diplom thetis, showing + the feasability of Bernhard Reiter's concept. + Scripts exist for the drawing application Skencil + (). + + + Technical notes: the names of the layers are used + as base for ids within the SVG format. + If you try to export with two layers having + the same name, you will get a name clash error. + Just change one of the layer names and try again. + +
Experimental extensions From cvs at intevation.de Sat Dec 18 03:37:01 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 03:37:01 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.16, 1.17 Message-ID: <20041218023701.ED2C1100160@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv16171/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: svgexport 1.0.0: Treats holes and islands nicely. Documentation added. * Extensions/svgexport/test/test_svgmapwriter.py: Added new tests: test_export_polygon_with_hole() and test_polygon_with_hole(). * Extensions/svgexport/svgmapwriter.py (draw_polygon_shape()): Uses DrawPath correctly now. * Doc/manual/thuban-manual.xml: Added documentation for stable extention svgexport. * Doc/manual/thuban-manual-de.xml: Copied English section about svexport over. * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. * Extensions/svgexport/svgsaver.py,maplegend.py: Moved from experimental to stable extension menu. * Extensions/svgexport/TODO: updated. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- test_svgmapwriter.py 18 Dec 2004 00:29:04 -0000 1.16 +++ test_svgmapwriter.py 18 Dec 2004 02:36:59 -0000 1.17 @@ -137,6 +137,25 @@ self.assertEquals(xmlsupport.sax_eventlist(data=data), xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_polygon_with_hole(self): + '''Set drawing properties and draw a polygon onto the dc.''' + + holepolygon = [Point(11.1,11.1), Point(33.3,11.1), Point(22.2,22.2), + Point(11.1,11.1)] + data = ('') + + dc = self.dc + dc.SetPen(self.solid_pen) + dc.SetMeta(self.meta) + dc.SetBrush(self.solid_brush) + dc.DrawPath([self.polygon, holepolygon], 1) + self.assertEquals(xmlsupport.sax_eventlist(data=data), + xmlsupport.sax_eventlist(data=self.file.getvalue())) + def test_rect(self): '''Set drawing properties and draw a rectangle''' data = ('\n' + ' \n' + '\n' + '\n' + ' \n' + ' \n' + ' \n\n') + table = MemoryTable([("type", FIELDTYPE_STRING), + ("value", FIELDTYPE_DOUBLE), + ("code", FIELDTYPE_INT)], + [("UNKNOWN", 0.0, 0)]) + shapes = [[[(0, 0), (0, 10), (10, 10), (0, 0) ], + [(5, 6), (5, 7), ( 4, 7), (4, 6), (5, 6)] + ]] store = SimpleShapeStore(SHAPETYPE_POLYGON, shapes, table) map = Map("testpolygonexport") From cvs at intevation.de Sat Dec 18 03:37:01 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 03:37:01 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport TODO, 1.1, 1.2 __init__.py, 1.6, 1.7 maplegend.py, 1.3, 1.4 svgmapwriter.py, 1.12, 1.13 svgsaver.py, 1.5, 1.6 Message-ID: <20041218023701.F23A610016A@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv16171/Extensions/svgexport Modified Files: TODO __init__.py maplegend.py svgmapwriter.py svgsaver.py Log Message: svgexport 1.0.0: Treats holes and islands nicely. Documentation added. * Extensions/svgexport/test/test_svgmapwriter.py: Added new tests: test_export_polygon_with_hole() and test_polygon_with_hole(). * Extensions/svgexport/svgmapwriter.py (draw_polygon_shape()): Uses DrawPath correctly now. * Doc/manual/thuban-manual.xml: Added documentation for stable extention svgexport. * Doc/manual/thuban-manual-de.xml: Copied English section about svexport over. * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. * Extensions/svgexport/svgsaver.py,maplegend.py: Moved from experimental to stable extension menu. * Extensions/svgexport/TODO: updated. Index: TODO =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TODO 18 Dec 2004 00:32:48 -0000 1.1 +++ TODO 18 Dec 2004 02:36:59 -0000 1.2 @@ -1,11 +1,9 @@ Todo file for Thuban svgexport Extension -For 1.0.0: - -* Support holes and islands in a "polygon". -* Add basic documentation +For 1.0.x, x>0: -For 1.0.x: +* find out why the memory shapes in class Testobjectexport + return points with negative values with projected_points Better support for variable Point sizes: * a real test for variable point sizes Index: __init__.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- __init__.py 11 Dec 2004 03:24:36 -0000 1.6 +++ __init__.py 18 Dec 2004 02:36:59 -0000 1.7 @@ -23,8 +23,8 @@ from Thuban.UI.extensionregistry import ExtensionDesc, ext_registry ext_registry.add(ExtensionDesc( - name = 'SVGexport', - version = '0.9.2', + name = 'SVG Export', + version = '1.0.0', authors= [ 'Markus Rechtien', 'Bernhard Reiter' ], copyright = '2004 Intevation GmbH', desc = _("Export the current map and legend in Thuban-map-SVG format."))) Index: maplegend.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/maplegend.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- maplegend.py 24 Nov 2004 22:52:06 -0000 1.3 +++ maplegend.py 18 Dec 2004 02:36:59 -0000 1.4 @@ -172,9 +172,8 @@ registry.Add(Command('write_legend', _('Write SVG Legend'), write_legend, helptext = _('Write a basic Legend for the map.'))) -# find the experimental menu (create it anew if not found) -experimental_menu = main_menu.FindOrInsertMenu('experimental', - _('Experimenta&l')) +# find the menu we want to be in (create it anew if not found) +menu = main_menu.FindOrInsertMenu('extensions', _('E&xtensions')) # finally bind the new command with an entry in the extensions menu -experimental_menu.InsertItem('write_legend') +menu.InsertItem('write_legend') Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- svgmapwriter.py 18 Dec 2004 00:29:04 -0000 1.12 +++ svgmapwriter.py 18 Dec 2004 02:36:59 -0000 1.13 @@ -225,8 +225,7 @@ self.dc.SetBrush(brush) self.dc.SetPen(pen) - for parts in points: - self.dc.DrawPath([parts],closed=1) + self.dc.DrawPath(points,closed=1) def draw_point_shape(self, layer, points, pen, brush, size=2): """Draw a point shape from layer with the given brush and pen Index: svgsaver.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgsaver.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- svgsaver.py 20 Nov 2004 12:52:25 -0000 1.5 +++ svgsaver.py 18 Dec 2004 02:36:59 -0000 1.6 @@ -99,9 +99,8 @@ registry.Add(Command('write_to_svg', _('Write SVG Map'), write_to_svg, helptext = _('Export the a map into a SVG file'))) -# find the experimental menu (create it anew if not found) -experimental_menu = main_menu.FindOrInsertMenu('experimental', - _('Experimenta&l')) +# find the menu we want to be in (create it anew if not found) +menu = main_menu.FindOrInsertMenu('extensions', _('E&xtensions')) # finally bind the new command with an entry in the extensions menu -experimental_menu.InsertItem('write_to_svg') +menu.InsertItem('write_to_svg') From bernhard at intevation.de Sat Dec 18 03:40:48 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Sat, 18 Dec 2004 03:40:48 +0100 Subject: Manual: Extensions in table of contents Message-ID: <20041218024048.GA1412@intevation.de> I just noticed that the names of the extensions is not listed in the table of contents of the Thuban-Manual. If nobody know the switch to make this lowest level appear for this section I would suggest to somehow elimate on level above this. The names of the extensions are important to see in the table of contents IMO. -------------- 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/20041218/28661267/attachment.bin From bernhard at intevation.de Sat Dec 18 03:43:34 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Sat, 18 Dec 2004 03:43:34 +0100 Subject: svgexport 1.0.0! In-Reply-To: <20041218023701.ED2C1100160@lists.intevation.de> References: <20041218023701.ED2C1100160@lists.intevation.de> Message-ID: <20041218024334.GB1412@intevation.de> With this commit svgexport is ready for prime time. Does it warrant a news? Shall I write to thuban-list, too? Should be backport to Thuban 1.0.1 and release it with it? (I would say yes, probably we need to rechange registration and the point size feature might need to be removed for the backport.) Bernhard On Sat, Dec 18, 2004 at 03:37:01AM +0100, cvs at intevation.de wrote: > Log Message: > svgexport 1.0.0: Treats holes and islands nicely. Documentation added. -------------- 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/20041218/0213e8b3/attachment.bin From nelson at crynwr.com Sat Dec 18 05:03:02 2004 From: nelson at crynwr.com (Russell Nelson) Date: Fri, 17 Dec 2004 23:03:02 -0500 Subject: am I insane or is something broken? Message-ID: <16835.44022.460828.230550@desk.crynwr.com> Could somebody please take a look at these two files: http://russnelson.com/089uni00s.zip http://russnelson.com/089map.zip The first is a set of polygons enclosing school districts in my county. The second is a pair of files describing a map of my county. If I simply load them both, and then hit "Zoom to full map extent", then the shapefile is drawn in the region of N44 W75, whereas the map, being a UTM map, is drawn at the (near-)equivalent UTM coords of 435000, 4875000. Okay, obviously the shapefile is being mis-projected. I'll bring up Map/Projection.... and select UTM Zone 18 for the shapefile. Hey! It works! My data appears exactly where it should. The trouble occurs whenever I want to do any redisplay of the data. As soon as I do, Python gets the scale completely wrong, and starts telling me about uncaught division-by-zero errors. I threw in some debugging print statements, and Thuban.Model.map.BoundingBox is confused. It's computing one BoundingBox in the wrong projection, and then returning a BoundingBox that makes no sense: BoundingBox: (435168.0, 4875232.0, 537568.0, 4992032.0) BoundingBox: [-75.860046999999994, 44.050399999999996, -74.525683000000001, 45.01585] BoundingBox returning (-75.860046999999994, 44.050399999999996, 537568.0, 4992032.0) The scale gets set too small: scale: 6.2099508879e-05 Weird! I also see this in the Thuban output: Warning: .MAP_PROJECTION_CHANGED: >() -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Sat Dec 18 07:22:33 2004 From: nelson at crynwr.com (Russell Nelson) Date: Sat, 18 Dec 2004 01:22:33 -0500 Subject: am I insane or is something broken? In-Reply-To: <16835.44022.460828.230550@desk.crynwr.com> References: <16835.44022.460828.230550@desk.crynwr.com> Message-ID: <16835.52393.765587.157767@desk.crynwr.com> Russell Nelson writes: > http://russnelson.com/089map.zip > > The second is a pair of files describing a map of my county. I've tracked the problem down to this file; or at least, I see *a* problem here. I'm printing the output of LatLongBoundingBox, and it sure looks like UTM northing and easting rather than LatLong. If I load that file and then run Map/Projection..., it says that the map is UTM Zone 18. Great! Thuban knows that it's UTM. So why is LatLongBoundingBox printing UTM? It's calling self.Inverse, to get the inverse projection (that is, lat/lon). How can the inverse of UTM be UTM?? -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From cvs at intevation.de Sat Dec 18 23:37:07 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 23:37:07 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp/test __init__.py,1.1,1.2 Message-ID: <20041218223707.82CA0100168@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp/test In directory doto:/tmp/cvs-serv23642 Added Files: __init__.py Log Message: Make this directory a package. From cvs at intevation.de Sat Dec 18 23:40:47 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 23:40:47 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp/test test_gns2shp.py,1.1,1.2 Message-ID: <20041218224047.ED1E4100168@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp/test In directory doto:/tmp/cvs-serv23700 Modified Files: test_gns2shp.py Log Message: Add some import paths dynamically. Index: test_gns2shp.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/gns2shp/test/test_gns2shp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_gns2shp.py 4 Sep 2003 15:35:51 -0000 1.1 +++ test_gns2shp.py 18 Dec 2004 22:40:45 -0000 1.2 @@ -1,6 +1,6 @@ -# Copyright (c) 2003 by Intevation GmbH +# Copyright (c) 2003, 2004 by Intevation GmbH # Authors: -# Jan-Oliver Wagner +# Jan-Oliver Wagner (2003, 2004) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -15,6 +15,18 @@ import unittest import os +import sys + +# If run directly as a script, add Thuban's test directory, the Lib +# directory and the Thuban directory itself to the path. +# Otherwise we assume that the importing code as already done it +if __name__ == "__main__": + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), + "..", "..", "..", "test")) + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), + "..", "..", "..", "Lib")) + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), + "..", "..", "..")) import support import shapelib From cvs at intevation.de Sat Dec 18 23:42:51 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 23:42:51 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp/test README,1.1,1.2 Message-ID: <20041218224251.1B139100168@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp/test In directory doto:/tmp/cvs-serv23750 Modified Files: README Log Message: Simplified description how to test. Index: README =================================================================== RCS file: /thubanrepository/thuban/Extensions/gns2shp/test/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 4 Sep 2003 15:28:38 -0000 1.1 +++ README 18 Dec 2004 22:42:49 -0000 1.2 @@ -6,7 +6,5 @@ retrieved from: http://www.nima.mil/gns/html/cntry_files.html -Howto run test (assume thuban source is under ~/project): - -export PYTHONPATH=~/project/thuban:~/project/thuban/Lib:~/project/thuban/test +Run test with: python test_gns2shp.py From cvs at intevation.de Sat Dec 18 23:57:05 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 23:57:05 +0100 (CET) Subject: jan: thuban/Extensions/gns2shp gns2shp.py,1.5,1.6 Message-ID: <20041218225705.A79E3100168@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Extensions/gns2shp In directory doto:/tmp/cvs-serv23898 Modified Files: gns2shp.py Log Message: (gns2shp): Fixed doc-string, fixed some dimensions of fields according to the GNS documentation which seems to change undocumented. Now killing trailing \n and/or \r from MODIFY_DATE. This fixes RT#2453. Index: gns2shp.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/gns2shp/gns2shp.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gns2shp.py 16 Nov 2004 21:15:17 -0000 1.5 +++ gns2shp.py 18 Dec 2004 22:57:03 -0000 1.6 @@ -39,7 +39,7 @@ """Convert a file from gns textformat into a Shapefile. The GNS text format is described on - http://www.nima.mil/gns/html/cntyfile/gis.html + http://www.nima.mil/gns/html/gis.html src_fname -- Filename of the GNS standard textfile (including suffix '.txt) dest_fname -- Filename where to write the Shapefile components (name @@ -64,19 +64,19 @@ dbf.add_field('JOG', dbflib.FTString, 7, 0) dbf.add_field('FC', dbflib.FTString, 1, 0) dbf.add_field('DSG', dbflib.FTString, 5, 0) - dbf.add_field('PC', dbflib.FTInteger, 10, 0) + dbf.add_field('PC', dbflib.FTInteger, 1, 0) dbf.add_field('CC1', dbflib.FTString, 2, 0) dbf.add_field('ADM1', dbflib.FTString, 2, 0) - dbf.add_field('ADM2', dbflib.FTString, 2, 0) + dbf.add_field('ADM2', dbflib.FTString, 200, 0) dbf.add_field('DIM', dbflib.FTInteger, 10, 0) dbf.add_field('CC2', dbflib.FTString, 2, 0) dbf.add_field('NT', dbflib.FTString, 1, 0) dbf.add_field('LC', dbflib.FTString, 2, 0) - dbf.add_field('SHORT_FORM', dbflib.FTString, 40, 0) - dbf.add_field('GENERIC', dbflib.FTString, 40, 0) - dbf.add_field('SORT_NAME', dbflib.FTString, 40, 0) - dbf.add_field('FULL_NAME', dbflib.FTString, 40, 0) - dbf.add_field('FULL_ND', dbflib.FTString, 40, 0) + dbf.add_field('SHORT_FORM', dbflib.FTString, 128, 0) + dbf.add_field('GENERIC', dbflib.FTString, 128, 0) + dbf.add_field('SORT_NAME', dbflib.FTString, 200, 0) + dbf.add_field('FULL_NAME', dbflib.FTString, 200, 0) + dbf.add_field('FULL_ND', dbflib.FTString, 200, 0) # FULL_NAME_ND dbf.add_field('MODIFY_DATE', dbflib.FTString, 11, 0) del dbf dbf = dbflib.open(dbf_filename, 'r+b') @@ -99,6 +99,7 @@ except: PC = None try: DIM = int(DIM) except: DIM = None + MODIFY_DATE = MODIFY_DATE[0:10] # kill trailing "\n" or "\r\n" obj = shapelib.SHPObject(shapelib.SHPT_POINT, i, [[(DD_LONG, DD_LAT)]]) shp.write_object(-1, obj) dbf.write_record(i, { 'RC': RC, 'UFI': UFI, 'UNI': UNI, 'UTM': UTM, From cvs at intevation.de Sat Dec 18 23:57:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sat, 18 Dec 2004 23:57:36 +0100 (CET) Subject: jan: thuban ChangeLog,1.742,1.743 Message-ID: <20041218225736.135B5100168@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv23929 Modified Files: ChangeLog Log Message: Some fixes of gns2shp extension. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.742 retrieving revision 1.743 diff -u -d -r1.742 -r1.743 --- ChangeLog 18 Dec 2004 02:36:59 -0000 1.742 +++ ChangeLog 18 Dec 2004 22:57:34 -0000 1.743 @@ -1,3 +1,21 @@ +2004-12-18 Jan-Oliver Wagner + + Some fixes of gns2shp extension. + + * Extensions/gns2shp/test/__init__.py: New. Make this directory a + package. + + * Extensions/gns2shp/test/test_gns2shp.py: Add some import paths + dynamically. + + * Extensions/gns2shp/test/README: Simplified description how to test. + + * Extensions/gns2shp/gns2shp.py (gns2shp): Fixed doc-string, + fixed some dimensions of fields according to the GNS documentation + which seems to change undocumented. + Now killing trailing \n and/or \r from MODIFY_DATE. + This fixes RT#2453. + 2004-12-18 Bernhard Reiter svgexport 1.0.0: Treats holes and islands nicely. Documentation added. From bernhard at intevation.de Sun Dec 19 11:12:47 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Sun, 19 Dec 2004 11:12:47 +0100 Subject: typos; extension registering tests In-Reply-To: <20041218224047.ED1E4100168@lists.intevation.de> References: <20041218224047.ED1E4100168@lists.intevation.de> Message-ID: <20041219101247.GA1450@intevation.de> On Sat, Dec 18, 2004 at 11:40:47PM +0100, cvs at intevation.de wrote: > Author: jan > RCS file: /thubanrepository/thuban/Extensions/gns2shp/test/test_gns2shp.py,v > +# Otherwise we assume that the importing code as already done it Typo in there: as -> has In general: Is is okay to just commit tiny typos like this in commentary prose without notification or changelog entry? It seems we start duplicating the following ugly code to some extend. So far we cannot help this, but it is a motivation to get the separation of the Extensions done earlier: Registration tests documentation > +if __name__ == "__main__": > + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), > + "..", "..", "..", "test")) > + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), > + "..", "..", "..", "Lib")) > + sys.path.append(os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), > + "..", "..", "..")) -------------- 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/20041219/4d1d835d/attachment.bin From cvs at intevation.de Sun Dec 19 11:14:40 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 19 Dec 2004 11:14:40 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport svgmapwriter.py,1.13,1.14 Message-ID: <20041219101440.1E39A102BF9@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv326/Extensions/svgexport Modified Files: svgmapwriter.py Log Message: svgexport: Improved code quality, mainly by better naming. * Extensions/svgexport/svgmapwriter.py: DrawPath() renamed to DrawPolygonPath(), added documentation, improved comments and variable names. * Extensions/svgexport/svgmapwriter.py, Extensions/svgexport/test/test_svgmapwriter.py: All using DrawPolygonPath() now, the default parameter closed=True omitted. * Extensions/svgexport/test/test_svgmapwriter.py: renamed test_polygon_opened() to test_polyline() renamed test_transparent_polygon() to test_transparent_polyline() Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- svgmapwriter.py 18 Dec 2004 02:36:59 -0000 1.13 +++ svgmapwriter.py 19 Dec 2004 10:14:38 -0000 1.14 @@ -225,7 +225,7 @@ self.dc.SetBrush(brush) self.dc.SetPen(pen) - self.dc.DrawPath(points,closed=1) + self.dc.DrawPolygonPath(points) def draw_point_shape(self, layer, points, pen, brush, size=2): """Draw a point shape from layer with the given brush and pen @@ -688,20 +688,27 @@ """Draw some points into a Buffer that will be written before the next object. """ - self.DrawPath([points],0) + self.DrawPolygonPath([points], closed=False) - def DrawPath(self, path, closed=1): - """Draw a polygon with sonto the virtual dc.""" + def DrawPolygonPath(self, polys, closed=True): + """Draw a list of polygons or polylines as one SVG path. + + Parameter: + polys list of poly- gons/lines; each consisting of a list of points + closed Boolean; optional; Default: True + False will leave each subpath open thus making it polylines. + """ self.write_indent(' Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv326 Modified Files: ChangeLog Log Message: svgexport: Improved code quality, mainly by better naming. * Extensions/svgexport/svgmapwriter.py: DrawPath() renamed to DrawPolygonPath(), added documentation, improved comments and variable names. * Extensions/svgexport/svgmapwriter.py, Extensions/svgexport/test/test_svgmapwriter.py: All using DrawPolygonPath() now, the default parameter closed=True omitted. * Extensions/svgexport/test/test_svgmapwriter.py: renamed test_polygon_opened() to test_polyline() renamed test_transparent_polygon() to test_transparent_polyline() Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.743 retrieving revision 1.744 diff -u -d -r1.743 -r1.744 --- ChangeLog 18 Dec 2004 22:57:34 -0000 1.743 +++ ChangeLog 19 Dec 2004 10:14:37 -0000 1.744 @@ -1,3 +1,20 @@ +2004-12-19 Bernhard Reiter + + svgexport: Improved code quality, mainly by better naming. + + * Extensions/svgexport/svgmapwriter.py: + DrawPath() renamed to DrawPolygonPath(), + added documentation, improved comments and variable names. + + * Extensions/svgexport/svgmapwriter.py, + Extensions/svgexport/test/test_svgmapwriter.py: + All using DrawPolygonPath() now, the default parameter closed=True + omitted. + + * Extensions/svgexport/test/test_svgmapwriter.py: + renamed test_polygon_opened() to test_polyline() + renamed test_transparent_polygon() to test_transparent_polyline() + 2004-12-18 Jan-Oliver Wagner Some fixes of gns2shp extension. From cvs at intevation.de Sun Dec 19 11:14:40 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Sun, 19 Dec 2004 11:14:40 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.17, 1.18 Message-ID: <20041219101440.24AA6102C09@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv326/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: svgexport: Improved code quality, mainly by better naming. * Extensions/svgexport/svgmapwriter.py: DrawPath() renamed to DrawPolygonPath(), added documentation, improved comments and variable names. * Extensions/svgexport/svgmapwriter.py, Extensions/svgexport/test/test_svgmapwriter.py: All using DrawPolygonPath() now, the default parameter closed=True omitted. * Extensions/svgexport/test/test_svgmapwriter.py: renamed test_polygon_opened() to test_polyline() renamed test_transparent_polygon() to test_transparent_polyline() Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- test_svgmapwriter.py 18 Dec 2004 02:36:59 -0000 1.17 +++ test_svgmapwriter.py 19 Dec 2004 10:14:38 -0000 1.18 @@ -105,12 +105,12 @@ dc.SetPen(self.solid_pen) dc.SetMeta(self.meta) dc.SetBrush(self.solid_brush) - dc.DrawPath([self.polygon], 1) + dc.DrawPolygonPath([self.polygon]) self.assertEquals(xmlsupport.sax_eventlist(data=data), xmlsupport.sax_eventlist(data=self.file.getvalue())) - def test_polygon_opened(self): - '''Set drawing properties and draw a polygon onto the dc.''' + def test_polyline(self): + '''Set drawing properties and draw a polyline onto the dc.''' data = (' Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv3171 Modified Files: ChangeLog Log Message: * Extensions/svgexport/TODO: Added idea to support triggering the application down the pipe. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.744 retrieving revision 1.745 diff -u -d -r1.744 -r1.745 --- ChangeLog 19 Dec 2004 10:14:37 -0000 1.744 +++ ChangeLog 19 Dec 2004 11:34:25 -0000 1.745 @@ -1,5 +1,10 @@ 2004-12-19 Bernhard Reiter + * Extensions/svgexport/TODO: Added idea to support triggering + the application down the pipe. + +2004-12-19 Bernhard Reiter + svgexport: Improved code quality, mainly by better naming. * Extensions/svgexport/svgmapwriter.py: From nelson at crynwr.com Sun Dec 19 18:10:01 2004 From: nelson at crynwr.com (Russell Nelson) Date: Sun, 19 Dec 2004 12:10:01 -0500 Subject: am I insane or is something broken? In-Reply-To: <16835.52393.765587.157767@desk.crynwr.com> References: <16835.44022.460828.230550@desk.crynwr.com> <16835.52393.765587.157767@desk.crynwr.com> Message-ID: <16837.46569.618634.215026@desk.crynwr.com> Russell Nelson writes: > Russell Nelson writes: > > http://russnelson.com/089map.zip > > > > The second is a pair of files describing a map of my county. > > I've tracked the problem down to this file; or at least, I see *a* > problem here. I'm printing the output of LatLongBoundingBox, and it > sure looks like UTM northing and easting rather than LatLong. Just to be sure that it's not the image, and to give you smaller test data, I made a wholly-green image and called it test.zip http://russnelson.com/test.zip Just to be sure that it's not the world file, I downloaded a map and world file from terraserver-usa.com, and I still have the same problem: LatLongBoundingBox returns UTM data. I apologize that I don't have sufficient familiarity with Thuban yet to fix this problem myself. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Sun Dec 19 18:22:37 2004 From: nelson at crynwr.com (Russell Nelson) Date: Sun, 19 Dec 2004 12:22:37 -0500 Subject: moving LatLongBoundingBox? Message-ID: <16837.47325.159089.849147@desk.crynwr.com> I notice that RasterLayer is using this definition of LatLongBoundingBox: def LatLongBoundingBox(self): bbox = self.BoundingBox() if bbox is None: return None if self.projection is not None: bbox = self.projection.InverseBBox(bbox) return bbox And Layer is using this definition: def LatLongBoundingBox(self): bbox = self.BoundingBox() if bbox is not None and self.projection is not None: bbox = self.projection.InverseBBox(bbox) return bbox They both do the same thing, and both classes are derived from BaseLayer, so shouldn't it be defined in BaseLayer? I'd pick the first of the two because it's more clear. Also, I would use this Python ideom: if self.projection: rather than this: if self.projection is not None: The first is more clear than the second, which essentially involves two negatives. Negatives are harder to process mentally. Yes, I realize that these are not equal tests (although they are equivalent). If the first is not as efficient as the second, then we should submit a PEP. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From joey at infodrom.org Sun Dec 19 18:35:34 2004 From: joey at infodrom.org (Martin Schulze) Date: Sun, 19 Dec 2004 18:35:34 +0100 Subject: moving LatLongBoundingBox? In-Reply-To: <16837.47325.159089.849147@desk.crynwr.com> References: <16837.47325.159089.849147@desk.crynwr.com> Message-ID: <20041219173534.GV7329@finlandia.infodrom.north.de> Russell Nelson wrote: > I notice that RasterLayer is using this definition of LatLongBoundingBox: > def LatLongBoundingBox(self): > bbox = self.BoundingBox() > if bbox is None: > return None > > if self.projection is not None: > bbox = self.projection.InverseBBox(bbox) > > return bbox > > And Layer is using this definition: > def LatLongBoundingBox(self): > bbox = self.BoundingBox() > if bbox is not None and self.projection is not None: > bbox = self.projection.InverseBBox(bbox) > return bbox > > > They both do the same thing, and both classes are derived from > BaseLayer, so shouldn't it be defined in BaseLayer? I'd pick the > first of the two because it's more clear. Also, I would use this > Python ideom: There are other layers as well (Extensions/wms) that dont' share the above definitions, so not sure if it should be moved to the upward class. Regards, Joey -- This is GNU/Linux Country. On a quiet night, you can hear Windows reboot. From nelson at crynwr.com Sun Dec 19 19:01:27 2004 From: nelson at crynwr.com (Russell Nelson) Date: Sun, 19 Dec 2004 13:01:27 -0500 Subject: moving LatLongBoundingBox? In-Reply-To: <20041219173534.GV7329@finlandia.infodrom.north.de> References: <16837.47325.159089.849147@desk.crynwr.com> <20041219173534.GV7329@finlandia.infodrom.north.de> Message-ID: <16837.49655.534227.15471@desk.crynwr.com> Martin Schulze writes: > There are other layers as well (Extensions/wms) that dont' share > the above definitions, so not sure if it should be moved to the > upward class. The base class should have the "naive" or "common" definition of a method. No problem overriding it in derived classes that need something more sophisticated. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Sun Dec 19 19:23:27 2004 From: nelson at crynwr.com (Russell Nelson) Date: Sun, 19 Dec 2004 13:23:27 -0500 Subject: Success (sort-of)! Message-ID: <16837.50975.528784.554287@desk.crynwr.com> Success!! I got my dataset to display correctly! That's good for me in that I can get my task done. However, the trouble that I had indicates that Thuban is fragile. It doesn't withstand native users very well. It has, in essence, the same problem that GRASS has: intolerance of ignorance. Here's what I had to do: 1) start with a new session (by running Thuban) 2) set the projection of the session using Map/Projection... 3) load the raster map, and set its projection using Layer/Projection... 4) load the shapefile. How can we change the code so as to prevent other people from having the same trouble I had? (Not to mention preventing the resultant zero scale problem.) We could do it heuristically: by noticing that, when someone loads two layers, the unprojected layers don't overlap, but there is a projection which causes them to overlap. Emit a warning that says "Select and use Layer/Projection..." We could do it algorithmically: by refusing to display anything if two layers are loaded and any of them remain unprojected. .... or by setting the Map projection (if None) to default to the projection of the first layer loaded. Yes, I know that all of this is documented. The software shouldn't misbehave if the user doesn't read or obey the instructions. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Sun Dec 19 19:35:56 2004 From: nelson at crynwr.com (Russell Nelson) Date: Sun, 19 Dec 2004 13:35:56 -0500 Subject: auto-fetching layers Message-ID: <16837.51724.232399.35800@desk.crynwr.com> Hmmmm..... Y'know, you could make Thuban *very* easy to use by creating a MIME type mapping between thuban and .thuban. If somebody clicked on a .thuban session file, it would start up thuban with the session file. Of course, the session file would need to have URLs instead of filenames. Wouldn't it be trivially easy to put a URL fetcher wrapper everywhere a filename is referenced? That wrapper would download the URL and put it in a cache, then return the cache filename. You'd also need a program which took a session file and a base URL, then it would rewrite the session file with the URLs wherever filenames were found. In case you're wondering why I'm harping on usability, it's because I want to go to my county government and tell them "Hey, there's this free program called Thuban which will give any county citizen the ability to display GIS files, if only we were publishing them." I'll have no crediability if Thuban causes people trouble. They're currently using some stupid for-pay service to give county taxpayers access to the tax map. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bernhard at intevation.de Mon Dec 20 10:39:22 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 20 Dec 2004 10:39:22 +0100 Subject: getdefault locale In-Reply-To: <20041217155425.8E53C102BE2@lists.intevation.de> References: <20041217155425.8E53C102BE2@lists.intevation.de> Message-ID: <20041220093922.GA25444@intevation.de> On Fri, Dec 17, 2004 at 04:54:25PM +0100, cvs at intevation.de wrote: > Author: bh > def unicodeToLocale(unicodeStr): > "Function to convert unicode to the user's locale encoding" > - > - return unicodeStr.encode(getlocale()[1]) > + return unicodeStr.encode(getdefaultlocale()[1]) BTW: This code is not robust against getdefaultlocale() returning (None, None), which can happen according to the manual. -------------- 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/20041220/13a4a729/attachment.bin From bernhard at intevation.de Mon Dec 20 10:48:37 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 20 Dec 2004 10:48:37 +0100 Subject: Selection bug Message-ID: <20041220094837.GB25444@intevation.de> Current CVS version gives me trouble when selecting stuff. Start Thuban. Open the iceland_sample.thuban session. Activate identify mode, click on a point, then move the mouse. This results in: Traceback (most recent call last): File "/mobilehome/bernhard/hacking/thuban/root/thuban/Extensions/svgexport/test/../../../test/../Thuban/UI/view.py", line 206, in _do_redraw if self.render_iter.next(): File "/mobilehome/bernhard/hacking/thuban/root/thuban/Extensions/svgexport/test/../../../test/../Thuban/UI/view.py", line 272, in _render_iterator for cont in renderer.draw_selection_incrementally(layer, shapes): File "/mobilehome/bernhard/hacking/thuban/root/thuban/Extensions/svgexport/test/../../../test/../Thuban/UI/renderer.py", line 170, in draw_selection_incrementally value = table.ReadValue(shape.ShapeID(), field) File "/mobilehome/bernhard/hacking/thuban/root/thuban/Thuban/Model/transientdb.py", line 598, in ReadValue row_is_ordinal = row_is_ordinal) File "/mobilehome/bernhard/hacking/thuban/root/thuban/Thuban/Model/table.py", line 166, in ReadValue return self.dbf.read_attribute(row, self.column_map[col].index) KeyError I get many of those when moving the mouse. Note the strange path, though I have started thuban without extra path from the root/thuban directory -------------- 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/20041220/d137ac23/attachment.bin From cvs at intevation.de Mon Dec 20 11:09:00 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 11:09:00 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.745,1.746 Message-ID: <20041220100900.828CD102BCC@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv3170 Modified Files: ChangeLog Log Message: * Extensions/svgexport/TODO: updated to add support for raster layers and labels for 1.0.1. * Extensions/svgexport/svgmapwriter.py (draw_raster_layer): Issue a warning now. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.745 retrieving revision 1.746 diff -u -d -r1.745 -r1.746 --- ChangeLog 19 Dec 2004 11:34:25 -0000 1.745 +++ ChangeLog 20 Dec 2004 10:08:58 -0000 1.746 @@ -1,3 +1,11 @@ +2004-12-20 Bernhard Reiter + + * Extensions/svgexport/TODO: updated to add support for + raster layers and labels for 1.0.1. + + * Extensions/svgexport/svgmapwriter.py (draw_raster_layer): + Issue a warning now. + 2004-12-19 Bernhard Reiter * Extensions/svgexport/TODO: Added idea to support triggering From cvs at intevation.de Mon Dec 20 11:09:00 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 11:09:00 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport TODO, 1.3, 1.4 svgmapwriter.py, 1.14, 1.15 Message-ID: <20041220100900.84543102BCD@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv3170/Extensions/svgexport Modified Files: TODO svgmapwriter.py Log Message: * Extensions/svgexport/TODO: updated to add support for raster layers and labels for 1.0.1. * Extensions/svgexport/svgmapwriter.py (draw_raster_layer): Issue a warning now. Index: TODO =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TODO 19 Dec 2004 11:34:25 -0000 1.3 +++ TODO 20 Dec 2004 10:08:58 -0000 1.4 @@ -1,6 +1,11 @@ -Todo file for Thuban svgexport Extension +TODO file for Thuban svgexport Extension -For 1.0.x, x>0: +For 1.0.1: + +* Enable label export. +* Enable Raster file export. + +For 1.0.x, x>1: * find out why the memory shapes in class Testobjectexport return points with negative values with projected_points Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- svgmapwriter.py 19 Dec 2004 10:14:38 -0000 1.14 +++ svgmapwriter.py 20 Dec 2004 10:08:58 -0000 1.15 @@ -336,12 +336,13 @@ def draw_raster_layer(self, layer): """Draw the raster layer""" - # For now we cannot draw raster layers onto our VirtualDC - pass + # TODO: For now we cannot draw raster layers onto our VirtualDC + log(_("Warning: Raster layer not written as " + + "svgexport does not support this yet!\n")) def draw_raster_data(self, data, format="BMP"): """Draw the raster image in data onto the DC""" - # For now we cannot draw raster data onto our VirtualDC + # TODO: For now we cannot draw raster data onto our VirtualDC pass def RenderMap(self, selected_layer, selected_shapes): From cvs at intevation.de Mon Dec 20 12:27:49 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 12:27:49 +0100 (CET) Subject: bh: thuban setup.py, 1.44.2.1, 1.44.2.2 ChangeLog, 1.624.2.21, 1.624.2.22 Message-ID: <20041220112749.81618102BCD@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv4943 Modified Files: Tag: thuban-1-0-branch setup.py ChangeLog Log Message: (bdist_inno.user_options): New options compression-method and compression-solid to control how Innosetup compresses. (bdist_inno.initialize_options): Initilize the new options (bdist_inno.generate_iss): Use the new otions if they were given Index: setup.py =================================================================== RCS file: /thubanrepository/thuban/setup.py,v retrieving revision 1.44.2.1 retrieving revision 1.44.2.2 diff -u -d -r1.44.2.1 -r1.44.2.2 --- setup.py 17 Dec 2004 17:51:48 -0000 1.44.2.1 +++ setup.py 20 Dec 2004 11:27:47 -0000 1.44.2.2 @@ -878,9 +878,16 @@ "(defaults to --)."), ("iss-revision", None, "revision of the generated installer of the package version"), + ("compression-method=", None, + "compression method to use, e.g. zip, bzip, lzma." + " This is the value for the Compression setting in the [Setup]" + " section of the inno setup file."), + ("compression-solid=", None, + "Value for the SolidCompression setting of the [Setup] section" + " of the Innosetup file."), ("icons-entries", None, - "List if InnoIconItems " + "List of InnoIconItems " "(this can only be set from inside the setup.py script)"), ] @@ -895,6 +902,8 @@ self.default_dir_name = None self.default_group_name = None self.license_file = None + self.compression_method = None + self.compression_solid = None self.output_basename = None self.iss_revision = None self.icons_entries = [] @@ -978,6 +987,10 @@ iss.append("AppCopyright=" + self.copyright) if self.license_file: iss.append("LicenseFile=" + self.license_file) + if self.compression_method: + iss.append("Compression=" + self.compression_method) + if self.compression_solid: + iss.append("SolidCompression=" + self.compression_solid) iss.append("OutputBasefilename=" + self.output_basename) Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.21 retrieving revision 1.624.2.22 diff -u -d -r1.624.2.21 -r1.624.2.22 --- ChangeLog 17 Dec 2004 17:51:48 -0000 1.624.2.21 +++ ChangeLog 20 Dec 2004 11:27:47 -0000 1.624.2.22 @@ -1,3 +1,11 @@ +2004-12-20 Bernhard Herzog + + * setup.py (bdist_inno.user_options): New options + compression-method and compression-solid to control how Innosetup + compresses. + (bdist_inno.initialize_options): Initilize the new options + (bdist_inno.generate_iss): Use the new otions if they were given + 2004-12-17 Bernhard Herzog * setup.py: windows build: Removed the absolute path names and From cvs at intevation.de Mon Dec 20 12:34:16 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 12:34:16 +0100 (CET) Subject: bh: thuban/Thuban version.py,1.13.2.1,1.13.2.2 Message-ID: <20041220113416.A08C4102BCD@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban In directory doto:/tmp/cvs-serv5070/Thuban Modified Files: Tag: thuban-1-0-branch version.py Log Message: Prepare for a 1.0.1 release * Thuban/version.py (thuban_release): Set to "1" * setup.py (setup call): version 1.0.1 * setup.cfg (copyright): extend to 2004 Index: version.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/version.py,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -d -r1.13.2.1 -r1.13.2.2 --- version.py 25 Feb 2004 10:46:59 -0000 1.13.2.1 +++ version.py 20 Dec 2004 11:34:14 -0000 1.13.2.2 @@ -39,7 +39,7 @@ # thuban_branch = "1.0" -thuban_release = "cvs" +thuban_release = "1" From cvs at intevation.de Mon Dec 20 12:34:16 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 12:34:16 +0100 (CET) Subject: bh: thuban setup.py, 1.44.2.2, 1.44.2.3 setup.cfg, 1.8, 1.8.2.1 ChangeLog, 1.624.2.22, 1.624.2.23 Message-ID: <20041220113416.BBC2D102BEC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv5070 Modified Files: Tag: thuban-1-0-branch setup.py setup.cfg ChangeLog Log Message: Prepare for a 1.0.1 release * Thuban/version.py (thuban_release): Set to "1" * setup.py (setup call): version 1.0.1 * setup.cfg (copyright): extend to 2004 Index: setup.py =================================================================== RCS file: /thubanrepository/thuban/setup.py,v retrieving revision 1.44.2.2 retrieving revision 1.44.2.3 diff -u -d -r1.44.2.2 -r1.44.2.3 --- setup.py 20 Dec 2004 11:27:47 -0000 1.44.2.2 +++ setup.py 20 Dec 2004 11:34:14 -0000 1.44.2.3 @@ -1124,7 +1124,7 @@ """ setup(name = "Thuban", - version = "1.0.0", + version = "1.0.1", description = "Geographic data viewer", long_description = long_description, license = "GPL", Index: setup.cfg =================================================================== RCS file: /thubanrepository/thuban/setup.cfg,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- setup.cfg 19 Aug 2003 21:54:06 -0000 1.8 +++ setup.cfg 20 Dec 2004 11:34:14 -0000 1.8.2.1 @@ -13,4 +13,4 @@ prefix = /usr [bdist_inno] -copyright = Copyright © 2001-2003 Intevation GmbH +copyright = Copyright © 2001-2004 Intevation GmbH Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.22 retrieving revision 1.624.2.23 diff -u -d -r1.624.2.22 -r1.624.2.23 --- ChangeLog 20 Dec 2004 11:27:47 -0000 1.624.2.22 +++ ChangeLog 20 Dec 2004 11:34:14 -0000 1.624.2.23 @@ -1,5 +1,15 @@ 2004-12-20 Bernhard Herzog + Prepare for a 1.0.1 release + + * Thuban/version.py (thuban_release): Set to "1" + + * setup.py (setup call): version 1.0.1 + + * setup.cfg (copyright): extend to 2004 + +2004-12-20 Bernhard Herzog + * setup.py (bdist_inno.user_options): New options compression-method and compression-solid to control how Innosetup compresses. From thuban-bugs at intevation.de Mon Dec 20 12:44:21 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Mon, 20 Dec 2004 12:44:21 +0100 (CET) Subject: [bug #2863] (thuban) Changing point size doesn't work well on windows Message-ID: <20041220114421.42201102C05@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2863 ------------------------------------------------------------------------- Subject: Changing point size doesn't work well on windows Open the iceland_sample_class.thuban session and double click on the point layer in the legend window to open the classificaition dialog. Double click on one the point classes and change the size to at least 8. smaller values work fine on the system I tested this on and the minumum size to reproduce the problem may be system dependent. The result is that the symbol column is resized and the dialog seems to update itself continuously. The dialog cannot be closed properly anymore. Closing only works on the second try and then produces a traceback: Traceback (most recent call last): File "D:\cygwin\home\user\projects\thuban\thuban\Thuban\UI\classifier.py", line 1053, in OnClose self.unsubscribe_messages() File "D:\cygwin\home\user\projects\thuban\thuban\Thuban\UI\classifier.py", line 884, in unsubscribe_messages self.parent.Unsubscribe(MAP_REPLACED, self.map_replaced) File "D:\cygwin\home\user\projects\thuban\thuban\Thuban\UI\mainwindow.py", line 140, in Unsubscribe object.Unsubscribe(channel, *args) File "D:\cygwin\home\user\projects\thuban\thuban\Thuban\UI\viewport.py", line 291, in Unsubscribe Conduit.Unsubscribe(self, channel, *args) File "D:\cygwin\home\user\projects\thuban\thuban\Thuban\Lib\connector.py", line 158, in Unsubscribe Disconnect(self, channel, func, args) File "D:\cygwin\home\user\projects\thuban\thuban\Thuban\Lib\connector.py", line 64, in Disconnect raise ConnectorError, \ ConnectorError: no receivers for channel MAP_REPLACED of Versions: Thuban 1.1 cvs-20041217 ChangeLog 2004-12-16 Currently using: wxPython 2.4.2.4 Python 2.3.4 PySQLite 0.4.3 SQLite 2.8.2 GDAL 1.1.8.0 psycopg - not available Compiled for: GTK - not available proj 4.4.7 Extensions: importAPR 0.1.1 -------------------------------------------- Managed by Request Tracker From bh at intevation.de Mon Dec 20 12:48:06 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 20 Dec 2004 12:48:06 +0100 Subject: moving LatLongBoundingBox? In-Reply-To: <16837.47325.159089.849147@desk.crynwr.com> (Russell Nelson's message of "Sun, 19 Dec 2004 12:22:37 -0500") References: <16837.47325.159089.849147@desk.crynwr.com> Message-ID: Russell Nelson writes: > I notice that RasterLayer is using this definition of LatLongBoundingBox: > def LatLongBoundingBox(self): > bbox = self.BoundingBox() > if bbox is None: > return None > > if self.projection is not None: > bbox = self.projection.InverseBBox(bbox) > > return bbox > > And Layer is using this definition: > def LatLongBoundingBox(self): > bbox = self.BoundingBox() > if bbox is not None and self.projection is not None: > bbox = self.projection.InverseBBox(bbox) > return bbox > > > They both do the same thing, and both classes are derived from > BaseLayer, so shouldn't it be defined in BaseLayer? That would probably be better. What do we do about BoundingBox()? Implement it in BaseLayer too with the default implementation simply returning None? > I'd pick the > first of the two because it's more clear. Also, I would use this > Python ideom: > > if self.projection: > > rather than this: > > if self.projection is not None: > > The first is more clear than the second, which essentially involves > two negatives. Negatives are harder to process mentally. Yes, I > realize that these are not equal tests (although they are equivalent). Not sure what you mean by that exactly, but the tests are not equivalent in general, although they would both work in this particular case (the projections will never be considered false in the current implementation). The first tests whether self.projection is true when considered as a boolean. The second one tests whether self.projection is not None, which is different. There values that are false and not None. That's why Python's PEP 8 recommends this: - Comparisons to singletons like None should always be done with 'is' or 'is not'. Also, beware of writing "if x" when you really mean "if x is not None" -- e.g. when testing whether a variable or argument that defaults to None was set to some other value. The other value might be a value that's false in a Boolean context! I learned that the hard way several years ago. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From jan at intevation.de Mon Dec 20 13:04:32 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 20 Dec 2004 13:04:32 +0100 Subject: String-freeze for 1.0.1 Message-ID: <20041220120432.GA8021@intevation.de> Hi Thuban-Developers, now we have string freeze for 1.0.1 in CVS thuban-1-0-branch. If your time permits, please update the translations right now. Final release will before christmas. The sooner we receive the translations the higher the chance that it gets into 1.0.1. Else they will go into 1.0.2 which hopefully takes not a full year again. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From jan at intevation.de Mon Dec 20 13:10:17 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 20 Dec 2004 13:10:17 +0100 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041217082526.GB2730@intevation.de> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041217082526.GB2730@intevation.de> Message-ID: <20041220121017.GB8021@intevation.de> On Fri, Dec 17, 2004 at 09:25:26AM +0100, Jan-Oliver Wagner wrote: > On Fri, Dec 17, 2004 at 03:04:00AM -0500, Daniel Calvelo Aros wrote: > > One question, though: what about extensions? > > Good question. I vote for adding them for translation. > Most strings there are already using _(). The most clean way to implement this is to have the extenions maintain their own po management. As time permits we will commit an example. I added this as an item on the Roadmap. Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bh at intevation.de Mon Dec 20 13:21:30 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 20 Dec 2004 13:21:30 +0100 Subject: bernhard: thuban/Extensions/svgexport TODO, 1.3, 1.4 svgmapwriter.py, 1.14, 1.15 In-Reply-To: <20041220100900.84543102BCD@lists.intevation.de> (cvs@intevation.de's message of "Mon, 20 Dec 2004 11:09:00 +0100 (CET)") References: <20041220100900.84543102BCD@lists.intevation.de> Message-ID: cvs at intevation.de writes: > +For 1.0.1: > + > +* Enable label export. > +* Enable Raster file export. Do you really meant to get that into 1.0.1? We're almost done with it. > --- svgmapwriter.py 19 Dec 2004 10:14:38 -0000 1.14 > +++ svgmapwriter.py 20 Dec 2004 10:08:58 -0000 1.15 > @@ -336,12 +336,13 @@ > > def draw_raster_layer(self, layer): > """Draw the raster layer""" > - # For now we cannot draw raster layers onto our VirtualDC > - pass > + # TODO: For now we cannot draw raster layers onto our VirtualDC > + log(_("Warning: Raster layer not written as " + > + "svgexport does not support this yet!\n")) There's no need to concatenate the string with a "+" here. In fact it's wrong to do that with a translatable string because xgettext will treat them as two different strings: #: ../Extensions/svgexport/svgmapwriter.py:340 msgid "Warning: Raster layer not written as " msgstr "" #: ../Extensions/svgexport/svgmapwriter.py:341 msgid "svgexport does not support this yet!\n" msgstr "" xgettext does know about automatic string concatenation so omitting the + works fine with xgettext too. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 20 15:13:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 15:13:59 +0100 (CET) Subject: nhueffme: thuban ChangeLog,1.746,1.747 Message-ID: <20041220141359.52AAB102C10@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv29961 Modified Files: ChangeLog Log Message: Fixed some issues from Bernhard. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.746 retrieving revision 1.747 diff -u -d -r1.746 -r1.747 --- ChangeLog 20 Dec 2004 10:08:58 -0000 1.746 +++ ChangeLog 20 Dec 2004 14:13:57 -0000 1.747 @@ -1,3 +1,16 @@ +2004-12-20 Nina Hueffmeyer + + * Extensions/ogr/ogrshapes.py: Fixed some issues from + Bernhard (coding guidelines etc.). Additionally it is now possible to + display shapefiles containing feature collections (e.g.polygons + with holes). Works with gdal 1.2.1 now. + + * Extensions/ogr/test/test_OGRShapestore.py: Fixed some issues + from Bernhard (coding guidelines etc.). If ogr can't be imported, + tests are skipped now. + + * Extensions/ogr/ogrstart.py: Fixed some typings. + 2004-12-20 Bernhard Reiter * Extensions/svgexport/TODO: updated to add support for From cvs at intevation.de Mon Dec 20 15:13:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 15:13:59 +0100 (CET) Subject: nhueffme: thuban/Extensions/ogr ogrshapes.py, 1.2, 1.3 ogrstart.py, 1.1, 1.2 Message-ID: <20041220141359.554F0102C24@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/Extensions/ogr In directory doto:/tmp/cvs-serv29961/Extensions/ogr Modified Files: ogrshapes.py ogrstart.py Log Message: Fixed some issues from Bernhard. Index: ogrshapes.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/ogr/ogrshapes.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ogrshapes.py 8 Dec 2004 17:37:30 -0000 1.2 +++ ogrshapes.py 20 Dec 2004 14:13:57 -0000 1.3 @@ -1,6 +1,6 @@ # Copyright (C) 2004 by Intevation GmbH # Authors: -# Nina Hüffmeyer +# Nina Hueffmeyer # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with the software for details. @@ -26,10 +26,6 @@ from Thuban.Model.data import SHAPETYPE_POLYGON, SHAPETYPE_ARC, SHAPETYPE_POINT from Thuban.Model.data import RAW_PYTHON, RAW_SHAPEFILE, RAW_WKT -# Raw data in ogr format -RAW_OGRSHAPES = "RAW_OGRSHAPES" - - def has_ogr_support(): """Return whether this Thuban instance supports ogr file formats @@ -42,12 +38,12 @@ if ogr is not None: # mapping from ogr-lib shapetype and table constants to our constants ogrlib_shapetypes = {ogr.wkbPolygon: SHAPETYPE_POLYGON, - ogr.wkbLineString: SHAPETYPE_ARC, - ogr.wkbPoint: SHAPETYPE_POINT} + ogr.wkbLineString: SHAPETYPE_ARC, + ogr.wkbPoint: SHAPETYPE_POINT} fieldtype_map = {ogr.OFTString: table.FIELDTYPE_STRING, - ogr.OFTInteger: table.FIELDTYPE_INT, - ogr.OFTReal: table.FIELDTYPE_DOUBLE} + ogr.OFTInteger: table.FIELDTYPE_INT, + ogr.OFTReal: table.FIELDTYPE_DOUBLE} class OGRShape: @@ -62,30 +58,54 @@ """ Return the bounding box of the shape as a tuple (minx,miny,maxx,maxy) """ - shape = self.ogrlayer.GetFeature(self.shapeid) - geom = shape.GetGeometryRef() - minx, maxx, miny, maxy = geom.GetEnvelope() - return (minx, miny, maxx, maxy) + shape = self.ogrlayer.GetFeature(self.shapeid) + geom = shape.GetGeometryRef() + minx, maxx, miny, maxy = geom.GetEnvelope() + return (minx, miny, maxx, maxy) def ShapeID(self): return self.shapeid - # diese Methode funktioniert vielleicht noch nicht für andere Formate als shp + # diese Methode funktioniert vielleicht noch nicht für andere Formate + #als shp #(wenn ein polygon aus mehreren - # Ringen besteht o.ä., hat ein Geometry-Objekt mehr als einen GeometryRef().---------------------------- + # Ringen besteht o.ä., hat ein Geometry-Objekt mehr als einen + #GeometryRef().--------- def Points(self): """Return the coordinates of the shape as a list of lists of pairs""" feature = self.ogrlayer.GetFeature(self.shapeid) - geometry = feature.GetGeometryRef() - while geometry.GetGeometryCount() != 0: - geometry = geometry.GetGeometryRef(0) - points = [] - for point in range(geometry.GetPointCount()): - x = geometry.GetX(point) - y = geometry.GetY(point) - points.append((x, y)) - points = [points] - return points + geom = feature.GetGeometryRef() + shape = [] + # if geometry object is of type point or line + if geom.GetGeometryCount() == 0: + points =[] + for point in range(geom.GetPointCount()): + x = geom.GetX(point) + y = geom.GetY(point) + points.append((x, y)) + return [points] + # if geometry object is of type polygon or multipolygon + for i in range(geom.GetGeometryCount()): + points = [] + geometry = geom.GetGeometryRef(i) + # if geometry object is polygon + if geometry.GetGeometryCount() == 0: + for point in range(geometry.GetPointCount()): + x = geometry.GetX(point) + y = geometry.GetY(point) + points.append((x, y)) + shape.append(points) + # if geometry object is of type multipolygon + else: + for j in range(geometry.GetGeometryCount()): + points = [] + subgeom = geometry.GetGeometryRef(j) + for point in range(subgeom.GetPointCount()): + x = subgeom.GetX(point) + y = subgeom.GetY(point) + points.append((x, y)) + shape.append(points) + return shape def RawData(self): """Return the shape id to use with the shapestore""" @@ -98,8 +118,9 @@ class OGRShapeStore: - """Corresponds to an OGRLayer object, containing features/shapes and providing all methods Thuban - needs.""" + """Corresponds to an OGRLayer object, containing features/shapes and + providing all methods Thuban needs. + """ def __init__(self, session, filename, layername): # Make the filename absolute. The filename will be @@ -107,26 +128,26 @@ # session we need to compare absolute paths and it's usually # safer to always work with absolute paths. - self.filename = os.path.abspath(filename) - self.layername = layername + self.filename = os.path.abspath(filename) + self.layername = layername - self.ogrdatasource = ogr.Open(self.filename) - self.ogrlayer = (self.ogrdatasource).GetLayerByName(layername) - self.table = OGRTable(self.ogrdatasource, self.ogrlayer) + self.ogrdatasource = ogr.Open(self.filename) + self.ogrlayer = (self.ogrdatasource).GetLayerByName(layername) + self.table = OGRTable(self.ogrdatasource, self.ogrlayer) self._open_ogrlayer(layername) def _open_ogrlayer(self, layername): - self.numshapes = self.ogrlayer.GetFeatureCount() - self.shapetype = self.ogrlayer.GetLayerDefn().GetGeomType() - extent = self.ogrlayer.GetExtent() + self.numshapes = self.ogrlayer.GetFeatureCount() + self.shapetype = self.ogrlayer.GetLayerDefn().GetGeomType() + extent = self.ogrlayer.GetExtent() - if extent: - self.bbox = [extent[0], extent[2], extent[1], extent[3]] - else: - self.bbox = None + if extent: + self.bbox = [extent[0], extent[2], extent[1], extent[3]] + else: + self.bbox = None - self.shapetype = ogrlib_shapetypes[self.shapetype] + self.shapetype = ogrlib_shapetypes[self.shapetype] def OGRLayer(self): """Return the OGRLayer object""" @@ -148,8 +169,8 @@ return self.shapetype def RawShapeFormat(self): - """Return the raw data format of the shape data, i.e. RAW_OGRSHAPES""" - return RAW_OGRSHAPES + """Return the raw data format of the shape data, i.e. RAW_PYTHON""" + return RAW_PYTHON def NumShapes(self): """Return the number of shapes in the shape store""" @@ -167,7 +188,7 @@ form (minx, miny, maxx, maxy) in the coordinate system of the shape store. - The method GetFID() returns feature IDs starting from 0. In Thuban feature IDs start with 1. + The method GetFID() returns feature IDs starting from 0. """ # Bind a few globals to locals to make it a bit faster cls = OGRShape @@ -175,21 +196,23 @@ left, bottom, right, top = bbox - # create a geometry which can be passed to the layer as spatial filter - bboxpolygon = ogr.CreateGeometryFromWkt('Polygon((%s %s, %s %s, %s %s, %s %s, %s %s))' - %(left, bottom, left, top, right, top, right, bottom, left, bottom)) + # create a geometry which can be passed to the layer as spatial filter + bboxpolygon = ogr.CreateGeometryFromWkt( + ('Polygon((%s %s, %s %s, %s %s,%s %s, %s %s))' + %(left, bottom, left, top, right, top, + right, bottom, left, bottom))) - if ogrlayer.GetSpatialRef(): - bboxpolygon.AssignSpatialReference(ogrlayer.GetSpatialRef()) + if ogrlayer.GetSpatialRef(): + bboxpolygon.AssignSpatialReference(ogrlayer.GetSpatialRef()) - ogrlayer.ResetReading() - ogrlayer.SetSpatialFilter(bboxpolygon) - numFeatures = ogrlayer.GetFeatureCount() - for feature in range(numFeatures): - nextFeature = ogrlayer.GetNextFeature() - yield cls(ogrlayer, nextFeature.GetFID()) - ogrlayer.SetSpatialFilter(None) - bboxpolygon.Destroy() + ogrlayer.ResetReading() + ogrlayer.SetSpatialFilter(bboxpolygon) + numFeatures = ogrlayer.GetFeatureCount() + for feature in range(numFeatures): + nextFeature = ogrlayer.GetNextFeature() + yield cls(ogrlayer, nextFeature.GetFID()) + ogrlayer.SetSpatialFilter(None) + bboxpolygon.Destroy() def AllShapes(self): """Return an iterable over the shapes in the shape store.""" @@ -221,13 +244,13 @@ def __init__(self, ds, layer): """Initialize the OGRTable. - ds should be an instance of OGRDatasource. - layer should be an instance of OGRLayer. + ds should be an instance of OGRDatasource. + layer should be an instance of OGRLayer. """ self.datasource = ds self.layer = layer - self.tablename = layer.GetName() + self.tablename = layer.GetName() # Map column names and indices to column objects. self.column_map = {} @@ -238,15 +261,15 @@ """Internal: Update information about the table""" self.columns = [] - layerdefn = self.layer.GetLayerDefn() - for i in range(layerdefn.GetFieldCount()): - fielddef = layerdefn.GetFieldDefn(i) - fieldname = fielddef.GetName() - fieldtype = fieldtype_map[fielddef.GetType()] - fieldindex = layerdefn.GetFieldIndex(fieldname) - col = OGRColumn(fieldname, fieldtype, fieldindex) - if col is not None: - self.columns.append(col) + layerdefn = self.layer.GetLayerDefn() + for i in range(layerdefn.GetFieldCount()): + fielddef = layerdefn.GetFieldDefn(i) + fieldname = fielddef.GetName() + fieldtype = fieldtype_map[fielddef.GetType()] + fieldindex = layerdefn.GetFieldIndex(fieldname) + col = OGRColumn(fieldname, fieldtype, fieldindex) + if col is not None: + self.columns.append(col) for col in self.columns: self.column_map[col.name] = col @@ -268,82 +291,89 @@ return () def NumColumns(self): - """Return the number of columns.""" + """Return the number of columns.""" return len(self.columns) def Columns(self): - """Return all columns.""" + """Return all columns.""" return self.columns def Column(self, col): - """Return the column col. col can be either a string or an integer.""" + """Return the column col. col can be either a string or an integer.""" return self.column_map[col] def HasColumn(self, col): - """Return if column col exists. col can be either a string or an integer.""" + """Return if column col exists. col can be either a string or an + integer. + """ return self.column_map.has_key(col) def NumRows(self): - """Return the number of rows in the table, which equals the number of features in the layer.""" - return self.layer.GetFeatureCount() + """Return the number of rows in the table, which equals the number of + features in the layer. + """ + return self.layer.GetFeatureCount() def RowIdToOrdinal(self, gid): """Return the row ordinal given its id""" - return self.layer.GetFeature(gid).GetFID() + return self.layer.GetFeature(gid).GetFID() def RowOrdinalToId(self, num): """Return the rowid for given its ordinal""" - return self.layer.GetFeature(num).GetFID() + return self.layer.GetFeature(num).GetFID() def ReadRowAsDict(self, row, row_is_ordinal = 0): - """Return a dictionary which contains all the fields.""" - layerdef = self.layer.GetLayerDefn() - feature = self.layer.GetFeature(row) - result = {} - for i in range(feature.GetFieldCount()): - fielddef = layerdef.GetFieldDefn(i) - result[fielddef.GetName()] = feature.GetField(i) + """Return a dictionary which contains all the fields.""" + layerdef = self.layer.GetLayerDefn() + feature = self.layer.GetFeature(row) + result = {} + for i in range(feature.GetFieldCount()): + fielddef = layerdef.GetFieldDefn(i) + result[fielddef.GetName()] = feature.GetField(i) return result def ReadValue(self, row, col, row_is_ordinal = 0): - """Return the requested value.""" - if col is None: - return None - else: - feature = self.layer.GetFeature(row) - return feature.GetField(col) + """Return the requested value.""" + if col is None: + return None + else: + feature = self.layer.GetFeature(row) + return feature.GetField(col) def ValueRange(self, col): - """Return the value range of the given column (given as string).""" - result = self.datasource.ExecuteSQL("SELECT min(%s), max(%s) FROM %s" - %(col, col, self.layer.GetName())) - result.ResetReading() - feature = result.GetNextFeature() - try: - min = feature.GetField(0) - max = feature.GetField(1) - except: - min = 0 - max = 0 - self.datasource.ReleaseResultSet(result) + """Return the value range of the given column (given as string).""" + result = self.datasource.ExecuteSQL("SELECT min(%s), max(%s) FROM %s" + %(col, col, self.layer.GetName())) + result.ResetReading() + feature = result.GetNextFeature() + try: + min = feature.GetField(0) + max = feature.GetField(1) + except: + min = 0 + max = 0 + self.datasource.ReleaseResultSet(result) return (min, max) def UniqueValues(self, col): - """Return all the values being found in the column (given as string).""" - result = self.datasource.ExecuteSQL("SELECT DISTINCT %s FROM %s ORDER BY %s" %(col, self.layer.GetName(),col)) - values = [] - while 1: - feature = result.GetNextFeature() - if feature is None: - break - values.append(feature.GetField(0)) - self.datasource.ReleaseResultSet(result) + """Return all the values being found in the column (given as string). + """ + result = self.datasource.ExecuteSQL(( + "SELECT DISTINCT %s FROM %s ORDER BY %s" + %(col,self.layer.GetName(),col))) + values = [] + while 1: + feature = result.GetNextFeature() + if feature is None: + break + values.append(feature.GetField(0)) + self.datasource.ReleaseResultSet(result) return values def SimpleQuery(self, left, comparison, right): - """Return the FIDs resulting from the given query.""" + """Return the FIDs resulting from the given query.""" if comparison not in ("==", "!=", "<", "<=", ">=", ">"): - raise ValueError("Comparison operator %r not allowed" % comparison) + raise ValueError("Comparison operator %r not allowed" %comparison) if comparison == "==": comparison = "=" @@ -353,16 +383,17 @@ else: right_template = right - query = "SELECT FID FROM %s WHERE '%s' %s %s ORDER BY FID" %(self.tablename, left.name, comparison, right_template) + query = ("SELECT FID FROM %s WHERE '%s' %s %s ORDER BY FID" + % (self.tablename,left.name, comparison, right_template)) lay = self.datasource.ExecuteSQL(query) - result = [] - while 1: + result = [] + while lay is not None: feature = lay.GetNextFeature() if feature is None: break result.append(feature.GetField(0)) - self.datasource.ReleaseResultSet(lay) + self.datasource.ReleaseResultSet(lay) return result Index: ogrstart.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/ogr/ogrstart.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ogrstart.py 7 Dec 2004 16:44:51 -0000 1.1 +++ ogrstart.py 20 Dec 2004 14:13:57 -0000 1.2 @@ -22,50 +22,46 @@ from Thuban.Model.layer import Layer # Import ogr related classes -from Extensions.ogr import ogrshapes +from Extensions.ogr import ogrshapes, ogrdialog def open_with_ogr(context): - '''Export data depending on the set properties. + '''Export data depending on the set properties. - This is the main export funcation. - ''' - canvas = context.mainwindow.canvas - file = None - map = canvas.Map() + This is the main export funcation. + ''' + canvas = context.mainwindow.canvas + file = None + map = canvas.Map() - if hasattr(canvas, "export_path"): - export_path = canvas.export_path - else: - export_path="." - # Get the file to be opened - dlg = wxFileDialog(canvas, _("Select a data file"), - export_path, "", + # Get the file to be opened + dlg = wxFileDialog(canvas, _("Select a data file"), + ".", "", _("Shapefiles (*.shp)") + "|*.shp;*.SHP|" + _("All Files (*.*)") + "|*.*", wxOPEN | wxMULTIPLE) - if dlg.ShowModal() == wxID_OK: - filenames = dlg.GetPaths() - for filename in filenames: - title = os.path.splitext(os.path.basename(filename))[0] - has_layers = map.HasLayers() - layername = title - try: - session = context.application.Session() - store = ogrshapes.OGRShapeStore(session, filename, layername) - session.AddShapeStore(store) - except IOError: - # the layer couldn't be opened - self.RunMessageBox(_("Add Layer"), - _("Can't open the file '%s'.")%filename) - else: - layer = Layer(title, store) - map.AddLayer(layer) - if not has_layers: - # if we're adding a layer to an empty map, fit the - # new map to the window - canvas.FitMapToWindow() - context.application.SetPath("data",filename) + if dlg.ShowModal() == wxID_OK: + filenames = dlg.GetPaths() + for filename in filenames: + title = os.path.splitext(os.path.basename(filename))[0] + has_layers = map.HasLayers() + layername = title + try: + session = context.application.Session() + store = ogrshapes.OGRShapeStore(session, filename, layername) + session.AddShapeStore(store) + except IOError: + # the layer couldn't be opened + self.RunMessageBox(("Add Layer"), + ("Can't open the file '%s'.")%filename) + else: + layer = Layer(title, store) + map.AddLayer(layer) + if not has_layers: + # if we're adding a layer to an empty map, fit the + # new map to the window + canvas.FitMapToWindow() + context.application.SetPath("data",filename) dlg.Destroy() @@ -78,12 +74,13 @@ # See Thuban/UI/menu.py for the API of the Menu class from Thuban.UI.mainwindow import main_menu -# create a new command and register it -registry.Add(Command('open_ogr_files', _('Open an ogr-file'), open_with_ogr, - helptext = _('Open a file supported from ogr'))) +# create new commands and register them +registry.Add(Command('open_ogr_files', 'Open an ogr-file', open_with_ogr, + helptext = 'Open a file supported from ogr')) # find the ogr menu (create it a new if not found) ogr_menu = main_menu.FindOrInsertMenu('ogr', _('OGR')) # finally bind the new command with an entry in the extensions menu ogr_menu.InsertItem('open_ogr_files') + From cvs at intevation.de Mon Dec 20 15:13:59 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 15:13:59 +0100 (CET) Subject: nhueffme: thuban/Extensions/ogr/test test_OGRShapestore.py, 1.1, 1.2 Message-ID: <20041220141359.65FA0102C25@lists.intevation.de> Author: nhueffme Update of /thubanrepository/thuban/Extensions/ogr/test In directory doto:/tmp/cvs-serv29961/Extensions/ogr/test Modified Files: test_OGRShapestore.py Log Message: Fixed some issues from Bernhard. Index: test_OGRShapestore.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/ogr/test/test_OGRShapestore.py,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test_OGRShapestore.py 7 Dec 2004 16:44:51 -0000 1.1 +++ test_OGRShapestore.py 20 Dec 2004 14:13:57 -0000 1.2 @@ -35,15 +35,23 @@ support.initthuban() from Extensions.ogr.ogrshapes import OGRShapeStore, OGRShape, \ - SHAPETYPE_ARC, RAW_OGRSHAPES + SHAPETYPE_ARC +from Thuban.Model.data import RAW_PYTHON from Thuban.Model.table import FIELDTYPE_INT from Thuban.Model.session import Session +def skip_if_no_ogr(): + if ogr is None: + raise support.SkipTest("Can't run ogr tests because ogr counldn't be imported.") + class TestOGRShapeStore(unittest.TestCase, support.FloatComparisonMixin): def setUp(self): - """Initialize self.session""" + """Initialize self.session and open shapefile, if ogr could be + imported. + """ + skip_if_no_ogr() self.session = Session("Test Session") self.filename = os.path.join("..", "Data", "iceland","roads-line.shp") self.store = OGRShapeStore(self.session, self.filename, "roads-line") @@ -52,6 +60,7 @@ """Call self.session.Destroy() and reset self.session to None""" self.session.Destroy() self.session = None + self.store = None def test_shape_type(self): """Test OGRShapeStore.ShapeType() with arc shapes""" @@ -59,13 +68,13 @@ def test_raw_format(self): """Test OGRShapeStore.RawShapeFormat() with ogr file""" - self.assertEquals(self.store.RawShapeFormat(), RAW_OGRSHAPES) + self.assertEquals(self.store.RawShapeFormat(), RAW_PYTHON) def test_boundingbox(self): """Test OGRShapeStore.BoundingBox() with arc shapes""" self.assertFloatSeqEqual(self.store.BoundingBox(), - [-24.450359344482422, 63.426830291748047, - -13.55668830871582, 66.520111083984375]) + [-24.450359344482422, 63.426830291748047, + -13.55668830871582, 66.520111083984375]) def test_num_shapes(self): """Test OGRShapeStore.NumShapes() with arc shapes""" @@ -74,28 +83,28 @@ def test_shapes_in_region(self): """Test OGRShapeStore.ShapesInRegion() with arc shapes""" shapes = self.store.ShapesInRegion((-22.78, 63.96, -22.72, 64.0)) - self.assertEquals([s.ShapeID() for s in shapes], - [769, 771]) + self.assertEquals([s.ShapeID() for s in shapes], [769, 771]) def test_all_shapes(self): """Test OGRShapeStore.AllShapes()""" self.assertEquals([s.ShapeID() for s in self.store.AllShapes()], - range(self.store.NumShapes())) + range(self.store.NumShapes())) def test_shape_Points(self): """Test OGRShapeStore.Shape() with arc shapes""" self.assertPointListEquals(self.store.Shape(32).Points(), - [[(-15.08217430114746, 66.2773818969726), - (-15.02635002136230, 66.2733917236328)]]) + [[(-15.08217430114746, 66.2773818969726), + (-15.02635002136230, 66.2733917236328)]]) def test_shape_shapeid(self): """Test OGRShapeStore.Shape(i).ShapeID()""" self.assertEquals(self.store.Shape(5).ShapeID(), 5) def test_shape_compute_bbox(self): - """Test bbox of one shape""" - self.assertFloatSeqEqual(self.store.Shape(32).compute_bbox(), - (-15.08217430114746, 66.2733917236328,-15.02635002136230, 66.2773818969726)) + """Test bbox of one shape""" + self.assertFloatSeqEqual(self.store.Shape(32).compute_bbox(), + (-15.08217430114746, 66.2733917236328, + -15.02635002136230, 66.2773818969726)) class TestOGRTable(unittest.TestCase, support.FloatComparisonMixin): @@ -105,7 +114,7 @@ self.session = Session("Test Session") self.filename = os.path.join("..","Data", "iceland","roads-line.shp") self.store = OGRShapeStore(self.session, self.filename, "roads-line") - self.table = self.store.Table() + self.table = self.store.Table() def tearDown(self): """Call self.session.Destroy() and reset self.session to None""" @@ -113,73 +122,75 @@ self.session = None def test_Dependencies(self): - """Test dependencies, which is always ()""" - self.assertEquals(self.table.Dependencies(), ()) + """Test dependencies, which is always ()""" + self.assertEquals(self.table.Dependencies(), ()) def test_NumColumns(self): - """Test number of columns""" - self.assertEquals(self.table.NumColumns(), 9) + """Test number of columns""" + self.assertEquals(self.table.NumColumns(), 9) def test_Columns(self): - """Test columns, which are instances of OGRColumn""" - self.assertEquals(len(self.table.Columns()), 9) + """Test columns, which are instances of OGRColumn""" + self.assertEquals(len(self.table.Columns()), 9) self.assertEquals(self.table.Columns()[0].name, "FNODE_") self.assertEquals(self.table.Columns()[0].type, FIELDTYPE_INT) self.assertEquals(self.table.Columns()[0].index, 0) def test_Column(self): - """Test column, which is instance of OGRColumn""" - self.assertEquals(self.table.Column(0).name, "FNODE_") - self.assertEquals(self.table.Column(0).type, FIELDTYPE_INT) - self.assertEquals(self.table.Column(0).index, 0) - self.assertEquals(self.table.Column("FNODE_").type, FIELDTYPE_INT) - self.assertEquals(self.table.Column("FNODE_").index, 0) + """Test column, which is instance of OGRColumn""" + self.assertEquals(self.table.Column(0).name, "FNODE_") + self.assertEquals(self.table.Column(0).type, FIELDTYPE_INT) + self.assertEquals(self.table.Column(0).index, 0) + self.assertEquals(self.table.Column("FNODE_").type, FIELDTYPE_INT) + self.assertEquals(self.table.Column("FNODE_").index, 0) def test_HasColumn(self): - """Test HasColumn(), which can be called either with an integer or a string""" - self.assert_(self.table.HasColumn(0)) - self.assert_(self.table.HasColumn("FNODE_")) + """Test HasColumn(), which can be called either with an integer or + a string""" + self.assert_(self.table.HasColumn(0)) + self.assert_(self.table.HasColumn("FNODE_")) def test_NumRows(self): - """Test number of rows, which equals the number of features""" - self.assertEquals(self.table.NumRows(), 839) + """Test number of rows, which equals the number of features""" + self.assertEquals(self.table.NumRows(), 839) def test_RowIdToOrdinal(self): - self.assertEqual(self.table.RowIdToOrdinal(5),5) + self.assertEqual(self.table.RowIdToOrdinal(5),5) def test_RowOrdinalToId(self): - self.assertEqual(self.table.RowOrdinalToId(5),5) + self.assertEqual(self.table.RowOrdinalToId(5),5) def test_ReadRowAsDict(self): - """Test ReadRowAsDict()""" - self.assertEquals(len(self.table.ReadRowAsDict(0)), 9) - self.assertEquals(self.table.ReadRowAsDict(0, row_is_ordinal = 1), - {"FNODE_": 3, - "TNODE_": 1, - "LPOLY_": 146, - "RPOLY_": 146, - "LENGTH": 0.156, - "RDLINE_": 1, - "RDLINE_ID": 879, - "RDLNTYPE": 3, - "RDLNSTAT": 1}) + """Test ReadRowAsDict()""" + self.assertEquals(len(self.table.ReadRowAsDict(0)), 9) + self.assertEquals(self.table.ReadRowAsDict(0, row_is_ordinal = 1), + {"FNODE_": 3, + "TNODE_": 1, + "LPOLY_": 146, + "RPOLY_": 146, + "LENGTH": 0.156, + "RDLINE_": 1, + "RDLINE_ID": 879, + "RDLNTYPE": 3, + "RDLNSTAT": 1}) def test_ReadValue(self): - """Test ReadValue()""" - self.assertEquals(self.table.ReadValue(0,0,0), 3) - self.assertEquals(self.table.ReadValue(0,"FNODE_",0),3) + """Test ReadValue()""" + self.assertEquals(self.table.ReadValue(0,0,0), 3) + self.assertEquals(self.table.ReadValue(0,"FNODE_",0),3) def test_ValueRange(self): - """Test ValueRange()""" - self.assertEquals(self.table.ValueRange("FNODE_"), (1, 733)) + """Test ValueRange()""" + self.assertEquals(self.table.ValueRange("FNODE_"), (1, 733)) def test_UniqueValues(self): - """Test UniqueValues()""" - self.assertFloatSeqEqual(self.table.UniqueValues("RDLNTYPE"), [2,3,8]) + """Test UniqueValues()""" + self.assertFloatSeqEqual(self.table.UniqueValues("RDLNTYPE"), [2,3,8]) def test_SimpleQuery(self): - """Test SimpleQuery()""" - self.assertEquals(self.table.SimpleQuery(self.table.Column("LENGTH"), "==", 0.156),[0, 24, 317]) + """Test SimpleQuery()""" + self.assertEquals(self.table.SimpleQuery(self.table.Column("LENGTH"), + "==", 0.156),[0, 24, 317]) From bh at intevation.de Mon Dec 20 15:29:37 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 20 Dec 2004 15:29:37 +0100 Subject: nhueffme: thuban ChangeLog,1.746,1.747 In-Reply-To: <20041220141359.52AAB102C10@lists.intevation.de> (cvs@intevation.de's message of "Mon, 20 Dec 2004 15:13:59 +0100 (CET)") References: <20041220141359.52AAB102C10@lists.intevation.de> Message-ID: cvs at intevation.de writes: > +2004-12-20 Nina Hueffmeyer > + > + * Extensions/ogr/ogrshapes.py: Fixed some issues from > + Bernhard (coding guidelines etc.). Additionally it is now possible to > + display shapefiles containing feature collections (e.g.polygons > + with holes). Works with gdal 1.2.1 now. It's much better now, but there are still three lines that are indented with tabs. Also, could you please commit cosmetic changes and functional changes separately in the future? If they're committed together it's hard to tell which parts of a commit actually are for the new feature and which are purely cosmetic. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From nelson at crynwr.com Mon Dec 20 15:43:23 2004 From: nelson at crynwr.com (Russell Nelson) Date: Mon, 20 Dec 2004 09:43:23 -0500 Subject: moving LatLongBoundingBox? In-Reply-To: References: <16837.47325.159089.849147@desk.crynwr.com> Message-ID: <16838.58635.37938.810690@desk.crynwr.com> Bernhard Herzog writes: > Russell Nelson writes: > > They both do the same thing, and both classes are derived from > > BaseLayer, so shouldn't it be defined in BaseLayer? > > That would probably be better. What do we do about BoundingBox()? > Implement it in BaseLayer too with the default implementation simply > returning None? Sure. I can conceive of a layer which wouldn't have a BoundingBox, e.g. a 1:20000 map of an entire UTM zone. You wouldn't want it counted in the Extents calculation, so returning None would be the right thing to do. Either that, or make BoundingBox a pure base class and raise NotImplemented. But returning None makes more sense and gets handled properly down the road. > - Comparisons to singletons like None should always be done with > 'is' or 'is not'. Also, beware of writing "if x" when you > really mean "if x is not None" -- e.g. when testing whether a > variable or argument that defaults to None was set to some other > value. The other value might be a value that's false in a > Boolean context! Hrm. Well, I guess I was wrong! Learn Something New Every Day (LSNED). -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bh at intevation.de Mon Dec 20 15:57:31 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 20 Dec 2004 15:57:31 +0100 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041217080219.M32302@minag.gob.pe> (Daniel Calvelo Aros's message of "Fri, 17 Dec 2004 03:04:00 -0500") References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> Message-ID: "Daniel Calvelo Aros" writes: > Attached are fr and es. Shorter than I thought. Thanks. AFAIK, you started out from the HEAD branch, though, not thuban-1-0-branch. It's not much of a problem as the strings aren't that much different. After the msgmerge with a current thuban.pot from thuban-1-0-branch there were only three fuzzy entries which I could copy over from the old po files. Here's a list of the entries I copied over so that you can check them: fr.po: #: ../Thuban/UI/proj4dialog.py:157 msgid "Projection: UTM Parameters" msgstr "Projection: Param??tres UTM" #: ../Thuban/UI/proj4dialog.py:172 msgid "UTM Zone" msgstr "Zone UTM" #: ../Thuban/UI/proj4dialog.py:185 msgid "Ellipsoid" msgstr "Ellipso??de" es.po: #: ../Thuban/UI/proj4dialog.py:157 msgid "Projection: UTM Parameters" msgstr "Proyecci??n: Par??metros UTM" #: ../Thuban/UI/proj4dialog.py:172 msgid "UTM Zone" msgstr "Zona UTM" #: ../Thuban/UI/proj4dialog.py:185 msgid "Ellipsoid" msgstr "Elipsoide" Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 20 16:00:33 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 16:00:33 +0100 (CET) Subject: bh: thuban/po fr.po,1.3,1.3.2.1 es.po,1.4,1.4.2.1 Message-ID: <20041220150033.3FBA3102C2D@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/po In directory doto:/tmp/cvs-serv30813/po Modified Files: Tag: thuban-1-0-branch fr.po es.po Log Message: * po/fr.po, po/es.po: Updates from Daniel Calvelo Aros. The updates were done for HEAD so I backported them to thuban-1-0-branch. Index: fr.po =================================================================== RCS file: /thubanrepository/thuban/po/fr.po,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- fr.po 19 Dec 2003 14:35:13 -0000 1.3 +++ fr.po 20 Dec 2004 15:00:31 -0000 1.3.2.1 @@ -1,27 +1,34 @@ # French translation for Thuban # Traduction française de Thuban -# Copyright (C) 2003 +# Copyright (C) 2003-2004 # This file is distributed under the same license as the Thuban package. # Ce fichier est distribué sous la même licence que Thuban -# Daniel Calvelo Aros , 2003 +# Daniel Calvelo Aros , 2003-2004 # msgid "" msgstr "" [...1251 lines suppressed...] msgstr "Fichiers DBF (*.dbf)|*.dbf|" -#: ../Thuban/UI/tableview.py:523 +#: ../Thuban/UI/tableview.py:528 msgid "CSV Files (*.csv)|*.csv|" msgstr "Fichiers CSV (*.csv)|*.csv|" -#: ../Thuban/UI/tableview.py:524 +#: ../Thuban/UI/tableview.py:529 msgid "All Files (*.*)|*.*" msgstr "Tous (*.*)|*.*" @@ -1596,6 +1657,6 @@ msgid "Session" msgstr "Session" -#: ../Thuban/UI/view.py:288 +#: ../Thuban/UI/view.py:289 msgid "Export Map" msgstr "Exporter la carte" Index: es.po =================================================================== RCS file: /thubanrepository/thuban/po/es.po,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- es.po 19 Dec 2003 14:35:13 -0000 1.4 +++ es.po 20 Dec 2004 15:00:31 -0000 1.4.2.1 @@ -1,27 +1,35 @@ # Thuban Translation File for Spanish # Archivo de Traducción al Castellano de Thuban -# Copyright (C) 2003 +# Copyright (C) 2003-2004 # This file is distributed under the same license as the Thuban package. -# Daniel Calvelo (dcalvelo at minag.gob.pe), 2003 +# Daniel Calvelo (dcalvelo at gmail.com), 2003-2004 # # msgid "" msgstr "" [...1312 lines suppressed...] msgstr "Archivos DBF (*.dbf)|*.dbf|" -#: ../Thuban/UI/tableview.py:523 +#: ../Thuban/UI/tableview.py:528 msgid "CSV Files (*.csv)|*.csv|" msgstr "Archivos CSV (*.csv)|*.csv|" -#: ../Thuban/UI/tableview.py:524 +#: ../Thuban/UI/tableview.py:529 msgid "All Files (*.*)|*.*" msgstr "Todos los archivos (*.*)|*.*" @@ -1597,6 +1656,6 @@ msgid "Session" msgstr "Sesión" -#: ../Thuban/UI/view.py:288 +#: ../Thuban/UI/view.py:289 msgid "Export Map" msgstr "Exportar Mapa" From cvs at intevation.de Mon Dec 20 16:00:33 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 16:00:33 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.23,1.624.2.24 Message-ID: <20041220150033.5D27E102C32@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv30813 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: * po/fr.po, po/es.po: Updates from Daniel Calvelo Aros. The updates were done for HEAD so I backported them to thuban-1-0-branch. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.23 retrieving revision 1.624.2.24 diff -u -d -r1.624.2.23 -r1.624.2.24 --- ChangeLog 20 Dec 2004 11:34:14 -0000 1.624.2.23 +++ ChangeLog 20 Dec 2004 15:00:31 -0000 1.624.2.24 @@ -1,5 +1,11 @@ 2004-12-20 Bernhard Herzog + * po/fr.po, po/es.po: Updates from Daniel Calvelo Aros. The + updates were done for HEAD so I backported them to + thuban-1-0-branch. + +2004-12-20 Bernhard Herzog + Prepare for a 1.0.1 release * Thuban/version.py (thuban_release): Set to "1" From cvs at intevation.de Mon Dec 20 16:09:33 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 16:09:33 +0100 (CET) Subject: jan: thuban/Thuban/UI about.py,1.11.2.3,1.11.2.4 Message-ID: <20041220150933.E78E0102C2D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv31011 Modified Files: Tag: thuban-1-0-branch about.py Log Message: (About.__init__): Added years of contribution for each contributor. Index: about.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/about.py,v retrieving revision 1.11.2.3 retrieving revision 1.11.2.4 diff -u -d -r1.11.2.3 -r1.11.2.4 --- about.py 17 Dec 2004 15:54:23 -0000 1.11.2.3 +++ about.py 20 Dec 2004 15:09:31 -0000 1.11.2.4 @@ -1,6 +1,6 @@ # Copyright (c) 2001-2004 by Intevation GmbH # Authors: -# Jonathan Coles +# Jonathan Coles (2003) # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with Thuban for details. @@ -32,19 +32,23 @@ # Note: The source code is in ASCII, so we escape some # characters to get byte strings in latin1. - lead_developer = 'Bernhard Herzog' - developers = [ 'Jonathan Coles', 'Frank Koormann', - unicodeToLocale(u'Martin M\xfcller'), - 'Jan-Oliver Wagner' ] - translators = [ ( _('French'), 'Daniel Calvelo Aros' ), - ( _('German'), unicodeToLocale(u'Bj\xf6rn Broscheit')), - ( _('Hungarian'), 'Norbert Solymosi'), - ( _('Italian'), 'Maurizio Napolitano'), - ( _('Portuguese (Brazilian)'), 'Eduardo Patto Kanegae'), - ( _('Russian'), 'Alex Shevlakov'), - ( _('Spanish'), 'Daniel Calvelo Aros') ] - other_contributors = [ 'Jonathan Byron', 'Silke Reimer', - 'Bernhard Reiter' ] + lead_developer = 'Bernhard Herzog (2001-2004)' + developers = [ 'Jonathan Coles (2003)', + 'Frank Koormann (2002-2004)', + unicodeToLocale(u'Martin M\xfcller (2003)'), + 'Jan-Oliver Wagner (2002-2004)' ] + translators = [ ( _('French'), 'Daniel Calvelo Aros (2003-2004)' ), + ( _('German'), + unicodeToLocale(u'Bj\xf6rn Broscheit (2003-2004)')), + ( _('Hungarian'), 'Norbert Solymosi (2004)'), + ( _('Italian'), 'Maurizio Napolitano (2003)'), + ( _('Portuguese (Brazilian)'), + 'Eduardo Patto Kanegae (2004)'), + ( _('Russian'), 'Alex Shevlakov (2003-2004)'), + ( _('Spanish'), 'Daniel Calvelo Aros (2003-2004)') ] + other_contributors = [ 'Jonathan Byron (2002)', + 'Silke Reimer (2003-2004)', + 'Bernhard Reiter (2001-2004)' ] dyn_modules = [ ('wxPython', versions['wxPython']), ('Python', versions['python']), ('PySQLite', versions['pysqlite']), From cvs at intevation.de Mon Dec 20 16:10:19 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 16:10:19 +0100 (CET) Subject: jan: thuban ChangeLog,1.624.2.24,1.624.2.25 Message-ID: <20041220151019.EAF87102C2D@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv31050 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: small improvement of about information Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.24 retrieving revision 1.624.2.25 diff -u -d -r1.624.2.24 -r1.624.2.25 --- ChangeLog 20 Dec 2004 15:00:31 -0000 1.624.2.24 +++ ChangeLog 20 Dec 2004 15:10:17 -0000 1.624.2.25 @@ -1,3 +1,8 @@ +2004-12-20 Jan-Oliver Wagner + + * Thuban/UI/about.py (About.__init__): Added years of contribution + for each contributor. + 2004-12-20 Bernhard Herzog * po/fr.po, po/es.po: Updates from Daniel Calvelo Aros. The From cvs at intevation.de Mon Dec 20 16:14:26 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 16:14:26 +0100 (CET) Subject: bh: thuban/po de.po,1.5,1.5.2.1 Message-ID: <20041220151426.010DC10016B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/po In directory doto:/tmp/cvs-serv31149/po Modified Files: Tag: thuban-1-0-branch de.po Log Message: *po/de.po: Updated. Index: de.po =================================================================== RCS file: /thubanrepository/thuban/po/de.po,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -d -r1.5 -r1.5.2.1 --- de.po 23 Dec 2003 11:37:04 -0000 1.5 +++ de.po 20 Dec 2004 15:14:23 -0000 1.5.2.1 @@ -1,25 +1,30 @@ # German Translation for Thuban. # Copyright (C) 2003 Bjoern Broscheit -# Copyright (C) 2003 Intevation GmbH +# Copyright (C) 2004 Intevation GmbH # This file is distributed under the same license as the Thuban package. # Bjoern Broscheit , 2003. # msgid "" msgstr "" "Project-Id-Version: Thuban 1.0.0\n" -"POT-Creation-Date: 2003-12-23 12:27+0100\n" [...1116 lines suppressed...] msgstr "Grade" -#: ../Thuban/UI/projdialog.py:948 +#: ../Thuban/UI/projdialog.py:958 msgid "Radians" msgstr "Radiant" -#: ../Thuban/UI/projdialog.py:981 +#: ../Thuban/UI/projdialog.py:991 msgid "Source Data is in: " msgstr "Quelldaten sind in:" @@ -1626,6 +1655,6 @@ msgid "Session" msgstr "Sitzung" -#: ../Thuban/UI/view.py:288 +#: ../Thuban/UI/view.py:289 msgid "Export Map" msgstr "Exportiere Karte" From cvs at intevation.de Mon Dec 20 16:14:26 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 16:14:26 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.25,1.624.2.26 Message-ID: <20041220151426.1AFB6102BDB@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv31149 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: *po/de.po: Updated. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.25 retrieving revision 1.624.2.26 diff -u -d -r1.624.2.25 -r1.624.2.26 --- ChangeLog 20 Dec 2004 15:10:17 -0000 1.624.2.25 +++ ChangeLog 20 Dec 2004 15:14:23 -0000 1.624.2.26 @@ -1,3 +1,7 @@ +2004-12-20 Bernhard Herzog + + * po/de.po: Updated. + 2004-12-20 Jan-Oliver Wagner * Thuban/UI/about.py (About.__init__): Added years of contribution From bh at intevation.de Mon Dec 20 17:28:37 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 20 Dec 2004 17:28:37 +0100 Subject: svgexport 1.0.0! In-Reply-To: <20041218024334.GB1412@intevation.de> (Bernhard Reiter's message of "Sat, 18 Dec 2004 03:43:34 +0100") References: <20041218023701.ED2C1100160@lists.intevation.de> <20041218024334.GB1412@intevation.de> Message-ID: Bernhard Reiter writes: > Should be backport to Thuban 1.0.1 and release it with it? Since this won't be done for 1.0.1 (maybe 1.0.2): How usable is the svgexport version in thuban-1-0-branch? The last change there was on 2004-02-20. Should that be included in 1.0.1? If it should be included, should we encourage users to actually use it? Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From cvs at intevation.de Mon Dec 20 17:32:00 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 17:32:00 +0100 (CET) Subject: bh: thuban NEWS, 1.4, 1.4.2.1 MANIFEST.in, 1.13, 1.13.2.1 ChangeLog, 1.624.2.26, 1.624.2.27 Message-ID: <20041220163200.103A210016B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv32251 Modified Files: Tag: thuban-1-0-branch NEWS MANIFEST.in ChangeLog Log Message: * NEWS: Update for 1.0.1 * MANIFEST.in: Add some missing files Index: NEWS =================================================================== RCS file: /thubanrepository/thuban/NEWS,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- NEWS 23 Dec 2003 13:53:47 -0000 1.4 +++ NEWS 20 Dec 2004 16:31:57 -0000 1.4.2.1 @@ -1,5 +1,47 @@ -Changes in Thuban 1.0.0 +Changes in Thuban 1.0.1 ======================= + + - Updated translations + + Spanish and French by Daniel Calvelo Aros + Hungarian by Norbert Solymosi. + German by Bernhard Herzog + + - Updated gns2shp extension. Changes include a fix for RT#2453 + + - Thuban now remembers directories during a session. E.g. if you open + a shape file Thuban remembers the directory it was loaded from and + the next time you open a shapefile the dialog will start in the same + directory. This also works for projections. + + - The PostGIS interface was improved substantially compared to 1.0.0. + However, there are some limitations in Thuban's PostGIS support that + can't be fixed in the 1.0.x series without introducing incompatible + file format changes (one such limitation is the requirement for a + column called "gid"). + + The changes in more detail: + + - Added support for LINESTRING geometries + + - Added some support for tables with an explicit SRID. + + - Thuban 1.0.0 used to allow tables with multiple geometry columns + in some cases. Those cases worked only by accident. 1.0.1 gives + an error message when such tables are opened. Real support for + tables with multiple geometry columns is available in 1.1.x + (currently only in CVS). + + - Fix a printing bug. The region of the map to be printed was a bit off + so that some parts were not drawn sometimes. RT#2692 + + - Oher fixed issues: + RT#2237, RT#2239 (partly), RT#2245, RT#2482 (partly), RT#2549 + + + +Changes in Thuban 1.0.0 (2003-12-23) +==================================== - Updated translations: Index: MANIFEST.in =================================================================== RCS file: /thubanrepository/thuban/MANIFEST.in,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -d -r1.13 -r1.13.2.1 --- MANIFEST.in 5 Dec 2003 16:45:19 -0000 1.13 +++ MANIFEST.in 20 Dec 2004 16:31:57 -0000 1.13.2.1 @@ -1,4 +1,4 @@ -include README MANIFEST.in COPYING NEWS +include README MANIFEST.in COPYING NEWS ChangeLog HOWTO-Release recursive-include libraries README COPYING LICENSE ChangeLog NEWS MANIFEST.in recursive-include libraries *.h *.c *.i *.py *.txt recursive-include test README *.py @@ -14,4 +14,5 @@ include Resources/Projections/*.proj recursive-include Doc Makefile README *.xml *.png *.xcf *.sk *.ps include debian/changelog debian/control debian/copyright debian/docs -include debian/menu debian/rules debian/thuban.1 debian/watch \ No newline at end of file +include debian/menu debian/rules debian/thuban.1 debian/watch +include debian/*.patch debian/patches/*.patch Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.26 retrieving revision 1.624.2.27 diff -u -d -r1.624.2.26 -r1.624.2.27 --- ChangeLog 20 Dec 2004 15:14:23 -0000 1.624.2.26 +++ ChangeLog 20 Dec 2004 16:31:57 -0000 1.624.2.27 @@ -1,5 +1,11 @@ 2004-12-20 Bernhard Herzog + * NEWS: Update for 1.0.1 + + * MANIFEST.in: Add some missing files + +2004-12-20 Bernhard Herzog + * po/de.po: Updated. 2004-12-20 Jan-Oliver Wagner From bernhard at intevation.de Mon Dec 20 17:35:48 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 20 Dec 2004 17:35:48 +0100 Subject: svgexport 1.0.0! In-Reply-To: References: <20041218023701.ED2C1100160@lists.intevation.de> <20041218024334.GB1412@intevation.de> Message-ID: <20041220163548.GA25444@intevation.de> On Mon, Dec 20, 2004 at 05:28:37PM +0100, Bernhard Herzog wrote: > Bernhard Reiter writes: > > > Should be backport to Thuban 1.0.1 and release it with it? > > Since this won't be done for 1.0.1 (maybe 1.0.2): How usable is the > svgexport version in thuban-1-0-branch? The last change there was on > 2004-02-20. Should that be included in 1.0.1? If it should be > included, should we encourage users to actually use it? It can be used for useful things, so an inclusion as experimental seems fine to me. Actually if you would remove it, you could almost port it. - remove point size support - use the other registration -------------- 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/20041220/3d96f8dc/attachment.bin From jan at intevation.de Mon Dec 20 17:37:45 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 20 Dec 2004 17:37:45 +0100 Subject: [Thuban-devel] svgexport 1.0.0! In-Reply-To: <20041218024334.GB1412@intevation.de> References: <20041218023701.ED2C1100160@lists.intevation.de> <20041218024334.GB1412@intevation.de> Message-ID: <20041220163745.GB8622@intevation.de> On Sat, Dec 18, 2004 at 03:43:34AM +0100, Bernhard Reiter wrote: > With this commit svgexport is ready for prime time. > > Does it warrant a news? > Shall I write to thuban-list, too? A announcement news would be could. This can go to the web site and to thuban-announce (it will go to thuban-list automatically then). -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From bernhard at intevation.de Mon Dec 20 17:38:04 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 20 Dec 2004 17:38:04 +0100 Subject: bernhard: thuban/Extensions/svgexport TODO, 1.3, 1.4 svgmapwriter.py, 1.14, 1.15 In-Reply-To: References: <20041220100900.84543102BCD@lists.intevation.de> Message-ID: <20041220163804.GB25444@intevation.de> On Mon, Dec 20, 2004 at 01:21:30PM +0100, Bernhard Herzog wrote: > cvs at intevation.de writes: > > > +For 1.0.1: > > + > > +* Enable label export. > > +* Enable Raster file export. > > Do you really meant to get that into 1.0.1? We're almost done with it. No this is svgexport 1.0.1 not Thuban's version, sorry for the confusion. > > > --- svgmapwriter.py 19 Dec 2004 10:14:38 -0000 1.14 > > +++ svgmapwriter.py 20 Dec 2004 10:08:58 -0000 1.15 > > @@ -336,12 +336,13 @@ > > > > def draw_raster_layer(self, layer): > > """Draw the raster layer""" > > - # For now we cannot draw raster layers onto our VirtualDC > > - pass > > + # TODO: For now we cannot draw raster layers onto our VirtualDC > > + log(_("Warning: Raster layer not written as " + > > + "svgexport does not support this yet!\n")) > > There's no need to concatenate the string with a "+" here. In fact it's > wrong to do that with a translatable string because xgettext will treat > them as two different strings: > > #: ../Extensions/svgexport/svgmapwriter.py:340 > msgid "Warning: Raster layer not written as " > msgstr "" > > #: ../Extensions/svgexport/svgmapwriter.py:341 > msgid "svgexport does not support this yet!\n" > msgstr "" > > > xgettext does know about automatic string concatenation so omitting the + > works fine with xgettext too. Nice, if you feel like, it do the correction. -------------- 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/20041220/7a21dddd/attachment.bin From bernhard at intevation.de Mon Dec 20 17:42:37 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 20 Dec 2004 17:42:37 +0100 Subject: bh: thuban NEWS, 1.4, 1.4.2.1 In-Reply-To: <20041220163200.103A210016B@lists.intevation.de> References: <20041220163200.103A210016B@lists.intevation.de> Message-ID: <20041220164237.GC25444@intevation.de> On Mon, Dec 20, 2004 at 05:32:00PM +0100, cvs at intevation.de wrote: > +++ NEWS 20 Dec 2004 16:31:57 -0000 1.4.2.1 > + - Oher fixed issues: Typo > + RT#2237, RT#2239 (partly), RT#2245, RT#2482 (partly), RT#2549 We should give at least the headline for each issue, otherwise it is hard to make the connection for a human. -------------- 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/20041220/565062f4/attachment.bin From cvs at intevation.de Mon Dec 20 18:15:04 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 18:15:04 +0100 (CET) Subject: bh: thuban NEWS,1.4.2.1,1.4.2.2 ChangeLog,1.624.2.27,1.624.2.28 Message-ID: <20041220171504.2DF6610016B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv385 Modified Files: Tag: thuban-1-0-branch NEWS ChangeLog Log Message: More updates for 1.0.1: Mention the svgexport plugin. Add more details to the list of other fixes Index: NEWS =================================================================== RCS file: /thubanrepository/thuban/NEWS,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -d -r1.4.2.1 -r1.4.2.2 --- NEWS 20 Dec 2004 16:31:57 -0000 1.4.2.1 +++ NEWS 20 Dec 2004 17:15:02 -0000 1.4.2.2 @@ -14,6 +14,8 @@ the next time you open a shapefile the dialog will start in the same directory. This also works for projections. + - New experimental extension: svgexport + - The PostGIS interface was improved substantially compared to 1.0.0. However, there are some limitations in Thuban's PostGIS support that can't be fixed in the 1.0.x series without introducing incompatible @@ -35,8 +37,14 @@ - Fix a printing bug. The region of the map to be printed was a bit off so that some parts were not drawn sometimes. RT#2692 - - Oher fixed issues: - RT#2237, RT#2239 (partly), RT#2245, RT#2482 (partly), RT#2549 + - Other fixed issues: + + RT#2237 EPSG projection with unsupported (by the dialog) + parameters causes exception + RT#2239 (only the session tree part) + RT#2245 Thuban don't start, unhandled exception + RT#2482 (partly) NameError: name 'wx' is not defined + RT#2549 exception when trying to generate one class Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.27 retrieving revision 1.624.2.28 diff -u -d -r1.624.2.27 -r1.624.2.28 --- ChangeLog 20 Dec 2004 16:31:57 -0000 1.624.2.27 +++ ChangeLog 20 Dec 2004 17:15:02 -0000 1.624.2.28 @@ -1,5 +1,10 @@ 2004-12-20 Bernhard Herzog + * NEWS: More updates for 1.0.1: Mention the svgexport plugin. Add + more details to the list of other fixes + +2004-12-20 Bernhard Herzog + * NEWS: Update for 1.0.1 * MANIFEST.in: Add some missing files From cvs at intevation.de Mon Dec 20 18:20:26 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 18:20:26 +0100 (CET) Subject: bh: thuban NEWS,1.4.2.2,1.4.2.3 ChangeLog,1.624.2.28,1.624.2.29 Message-ID: <20041220172026.8EF8510016B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv498 Modified Files: Tag: thuban-1-0-branch NEWS ChangeLog Log Message: And some more: I forgot some translation updates. Index: NEWS =================================================================== RCS file: /thubanrepository/thuban/NEWS,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -u -d -r1.4.2.2 -r1.4.2.3 --- NEWS 20 Dec 2004 17:15:02 -0000 1.4.2.2 +++ NEWS 20 Dec 2004 17:20:24 -0000 1.4.2.3 @@ -5,6 +5,8 @@ Spanish and French by Daniel Calvelo Aros Hungarian by Norbert Solymosi. + Brazillian Portuguese by Eduardo Patto Kanegae + Russian by Alex Shevlakov German by Bernhard Herzog - Updated gns2shp extension. Changes include a fix for RT#2453 Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.28 retrieving revision 1.624.2.29 diff -u -d -r1.624.2.28 -r1.624.2.29 --- ChangeLog 20 Dec 2004 17:15:02 -0000 1.624.2.28 +++ ChangeLog 20 Dec 2004 17:20:24 -0000 1.624.2.29 @@ -1,5 +1,9 @@ 2004-12-20 Bernhard Herzog + * NEWS: And some more: I forgot some translation updates. + +2004-12-20 Bernhard Herzog + * NEWS: More updates for 1.0.1: Mention the svgexport plugin. Add more details to the list of other fixes From cvs at intevation.de Mon Dec 20 18:22:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 18:22:36 +0100 (CET) Subject: bh: thuban/po ru.po, 1.3, 1.3.2.1 pt_BR.po, 1.3, 1.3.2.1 it.po, 1.3, 1.3.2.1 hu.po, 1.1.2.1, 1.1.2.2 Message-ID: <20041220172236.5FC9510016B@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/po In directory doto:/tmp/cvs-serv568/po Modified Files: Tag: thuban-1-0-branch ru.po pt_BR.po it.po hu.po Log Message: * po/hu.po, po/it.po, po/pt_BR.po, po/ru.po: Simple msgmerge update to bring at least the msgid up to 1.0.1 and make it easier for translators Index: ru.po =================================================================== RCS file: /thubanrepository/thuban/po/ru.po,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- ru.po 5 Jan 2004 16:40:37 -0000 1.3 +++ ru.po 20 Dec 2004 17:22:34 -0000 1.3.2.1 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Thuban 0.9.0 CVS\n" -"POT-Creation-Date: 2003-07-15 15:5+0200\n" +"POT-Creation-Date: 2004-12-20 15:41+0100\n" "PO-Revision-Date: 2003-12-26 12:00+0400\n" "Last-Translator: Alex Shevlakov \n" "Language-Team: RU\n" @@ -13,23 +13,33 @@ "Content-Type: text/plain; charset=koi8-r\n" "Content-Transfer-Encoding: 8bit\n" [...1409 lines suppressed...] msgstr "æÁÊÌÙ DBF (*.dbf)|*.dbf|" -#: ../Thuban/UI/tableview.py:523 +#: ../Thuban/UI/tableview.py:528 msgid "CSV Files (*.csv)|*.csv|" msgstr "æÁÊÌÙ CSV (*.csv)|*.csv|" -#: ../Thuban/UI/tableview.py:524 +#: ../Thuban/UI/tableview.py:529 msgid "All Files (*.*)|*.*" msgstr "÷ÓÅ ÆÁÊÌÙ (*.*)|*.*" @@ -1553,6 +1656,6 @@ msgid "Session" msgstr "óÅÓÓÉÑ" -#: ../Thuban/UI/view.py:288 +#: ../Thuban/UI/view.py:289 msgid "Export Map" msgstr "üËÓÐÏÒÔ ËÁÒÔÙ" Index: pt_BR.po =================================================================== RCS file: /thubanrepository/thuban/po/pt_BR.po,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- pt_BR.po 6 Feb 2004 08:42:03 -0000 1.3 +++ pt_BR.po 20 Dec 2004 17:22:34 -0000 1.3.2.1 @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Thuban 1.0\n" -"POT-Creation-Date: 2004-01-15 16:07+0300\n" +"POT-Creation-Date: 2004-12-20 15:41+0100\n" "PO-Revision-Date: 2004-01-15 16:07+0300\n" "Last-Translator: Eduardo Patto Kanegae \n" "Language-Team: Thuban \n" @@ -16,11 +16,16 @@ "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" [...1150 lines suppressed...] msgstr "Graus" -#: ../Thuban/UI/projdialog.py:948 +#: ../Thuban/UI/projdialog.py:958 msgid "Radians" msgstr "Radianos" -#: ../Thuban/UI/projdialog.py:981 +#: ../Thuban/UI/projdialog.py:991 msgid "Source Data is in: " msgstr "Fonte de dados está em:" @@ -1621,6 +1654,6 @@ msgid "Session" msgstr "Sessão" -#: ../Thuban/UI/view.py:288 +#: ../Thuban/UI/view.py:289 msgid "Export Map" msgstr "Exportar Mapa" Index: it.po =================================================================== RCS file: /thubanrepository/thuban/po/it.po,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- it.po 23 Dec 2003 13:57:10 -0000 1.3 +++ it.po 20 Dec 2004 17:22:34 -0000 1.3.2.1 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: it\n" -"POT-Creation-Date: 2003-12-23 14:41+0100\n" +"POT-Creation-Date: 2004-12-20 15:41+0100\n" "PO-Revision-Date: 2003-12-22 23:09+0100\n" "Last-Translator: Maurizio Napolitano \n" "Language-Team: \n" @@ -14,11 +14,16 @@ "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.0.2\n" [...1111 lines suppressed...] -#: ../Thuban/UI/projdialog.py:948 +#: ../Thuban/UI/projdialog.py:958 msgid "Radians" msgstr "Radianti" -#: ../Thuban/UI/projdialog.py:981 +#: ../Thuban/UI/projdialog.py:991 msgid "Source Data is in: " msgstr "La sorgente dati è in: " @@ -1632,7 +1662,7 @@ msgid "Session" msgstr "Sessione" -#: ../Thuban/UI/view.py:288 +#: ../Thuban/UI/view.py:289 msgid "Export Map" msgstr "Esporta mappa" Index: hu.po =================================================================== RCS file: /thubanrepository/thuban/po/hu.po,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- hu.po 27 Nov 2004 12:59:51 -0000 1.1.2.1 +++ hu.po 20 Dec 2004 17:22:34 -0000 1.1.2.2 @@ -6,14 +6,14 @@ msgid "" msgstr "" "Project-Id-Version: Thuban 1.0.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-11-27 13:56+0100\n" +"POT-Creation-Date: 2004-12-20 15:41+0100\n" "PO-Revision-Date: 2004-11-09 11:31+0100\n" "Last-Translator: Solymosi Norbert \n" "Language-Team: hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: \n" #: ../Thuban/version.py:180 #, python-format @@ -233,71 +233,67 @@ msgid "unnamed map" msgstr "elnevezendõ térkép" -#: ../Thuban/UI/about.py:29 +#: ../Thuban/UI/about.py:25 msgid "About Thuban" msgstr "Thuban névjegye" -#: ../Thuban/UI/about.py:42 +#: ../Thuban/UI/about.py:39 msgid "French" msgstr "Francia" -#: ../Thuban/UI/about.py:43 +#: ../Thuban/UI/about.py:40 msgid "German" msgstr "Német" -#: ../Thuban/UI/about.py:44 +#: ../Thuban/UI/about.py:41 +msgid "Hungarian" +msgstr "" + +#: ../Thuban/UI/about.py:42 msgid "Italian" msgstr "Olasz" -#: ../Thuban/UI/about.py:45 +#: ../Thuban/UI/about.py:43 msgid "Portuguese (Brazilian)" msgstr "Portugál (Brazil)" -#: ../Thuban/UI/about.py:46 +#: ../Thuban/UI/about.py:44 msgid "Russian" msgstr "Orosz" -#: ../Thuban/UI/about.py:47 +#: ../Thuban/UI/about.py:45 msgid "Spanish" msgstr "Spanyol" -#: ../Thuban/UI/about.py:54 ../Thuban/UI/about.py:56 ../Thuban/UI/about.py:58 +#: ../Thuban/UI/about.py:52 ../Thuban/UI/about.py:54 ../Thuban/UI/about.py:56 msgid "- not available" msgstr "- nem elérhetõ" -#: ../Thuban/UI/about.py:63 +#: ../Thuban/UI/about.py:61 msgid "Currently using:\n" msgstr "Jelenleg használt:\n" -#: ../Thuban/UI/about.py:72 +#: ../Thuban/UI/about.py:70 msgid "Compiled for:\n" msgstr "A fordításhoz alapul szolgált:\n" -#: ../Thuban/UI/about.py:78 -msgid "Extensions:\n" -msgstr "Kiterjesztések:\n" - -#: ../Thuban/UI/about.py:83 ../Thuban/UI/about.py:125 -msgid "\tNone registered.\n" -msgstr "\tNincs regisztrálva.\n" - -#: ../Thuban/UI/about.py:86 +#: ../Thuban/UI/about.py:76 msgid "Lead Developer:\n" msgstr "Vezetõ fejlesztõ:\n" -#: ../Thuban/UI/about.py:89 +#: ../Thuban/UI/about.py:79 msgid "Developers:\n" msgstr "Fejlesztõk:\n" -#: ../Thuban/UI/about.py:94 +#: ../Thuban/UI/about.py:84 msgid "Translators:\n" msgstr "Fordítók:\n" -#: ../Thuban/UI/about.py:99 +#: ../Thuban/UI/about.py:89 msgid "Other Contributors:\n" msgstr "Egyéb közremûködõk:\n" -#: ../Thuban/UI/about.py:105 +#: ../Thuban/UI/about.py:95 msgid "" "Questions and comments can be sent to the following addresses:\n" "\tGeneral list (public):\n" @@ -315,24 +311,7 @@ "\tIntevation Thuban csoportja:\n" "\t\t\n" -#: ../Thuban/UI/about.py:113 -msgid "" -"Details on the registered extensions:\n" -"\n" -msgstr "" -"A regisztrált kiterjesztések részletei:\n" -"\n" - -#: ../Thuban/UI/about.py:118 -#, python-format -msgid "Copyright %s\n" -msgstr "Copyright: %s\n" - -#: ../Thuban/UI/about.py:119 -msgid "Authors:\n" -msgstr "Szerzõk:\n" - -#: ../Thuban/UI/about.py:130 +#: ../Thuban/UI/about.py:103 msgid "" "Thuban is a program for exploring geographic data.\n" "\n" @@ -340,11 +319,11 @@ "A Thuban földrajzi adatok elemzését szolgáló szoftver.\n" "\n" -#: ../Thuban/UI/about.py:132 +#: ../Thuban/UI/about.py:105 msgid "Thuban is licensed under the GNU GPL" msgstr "A Thuban-ra a GNU GPL liszensz feltételei vonatkoznak" -#: ../Thuban/UI/about.py:141 ../Thuban/UI/classgen.py:91 +#: ../Thuban/UI/about.py:114 ../Thuban/UI/classgen.py:91 #: ../Thuban/UI/classifier.py:774 ../Thuban/UI/dbdialog.py:230 #: ../Thuban/UI/dock.py:371 ../Thuban/UI/join.py:66 #: ../Thuban/UI/projdialog.py:209 ../Thuban/UI/tableview.py:379 @@ -678,7 +657,7 @@ #: ../Thuban/UI/classifier.py:1263 ../Thuban/UI/dbdialog.py:54 #: ../Thuban/UI/dbdialog.py:177 ../Thuban/UI/labeldialog.py:42 #: ../Thuban/UI/proj4dialog.py:90 ../Thuban/UI/proj4dialog.py:197 -#: ../Thuban/UI/proj4dialog.py:256 ../Thuban/UI/projdialog.py:1027 +#: ../Thuban/UI/proj4dialog.py:256 ../Thuban/UI/projdialog.py:1032 msgid "Cancel" msgstr "Mégsem" @@ -764,9 +743,9 @@ msgid "Proceed" msgstr "Tovább" -#: ../Thuban/UI/exceptiondialog.py:44 ../Thuban/UI/mainwindow.py:365 -msgid "Exit" -msgstr "Kilép" +#: ../Thuban/UI/exceptiondialog.py:44 +msgid "Exit Thuban now" +msgstr "Kilépés a Thubanból most" #: ../Thuban/UI/identifyview.py:44 msgid "Identify Shape" @@ -895,6 +874,10 @@ msgid "The Dialog named %s is already open" msgstr "A %s ablak már nyitva van" +#: ../Thuban/UI/mainwindow.py:365 +msgid "Exit" +msgstr "Kilép" + #: ../Thuban/UI/mainwindow.py:366 msgid "The session has been modified. Do you want to save it?" msgstr "A munkafolymat neve megváltozott. Mentsük?" @@ -1374,7 +1357,7 @@ msgid "UTM Zone" msgstr "Zóna:" -#: ../Thuban/UI/proj4dialog.py:178 ../Thuban/UI/projdialog.py:815 +#: ../Thuban/UI/proj4dialog.py:178 ../Thuban/UI/projdialog.py:820 msgid "Propose" msgstr "Ajánlat" @@ -1383,33 +1366,33 @@ msgid "Ellipsoid" msgstr "Ellipszoid:" -#: ../Thuban/UI/proj4dialog.py:230 ../Thuban/UI/projdialog.py:865 -#: ../Thuban/UI/projdialog.py:1002 +#: ../Thuban/UI/proj4dialog.py:230 ../Thuban/UI/projdialog.py:870 +#: ../Thuban/UI/projdialog.py:1007 msgid "Projection: Propose UTM Zone" msgstr "Vetület: javasolt UTM Zóna" -#: ../Thuban/UI/proj4dialog.py:244 ../Thuban/UI/projdialog.py:1015 +#: ../Thuban/UI/proj4dialog.py:244 ../Thuban/UI/projdialog.py:1020 msgid "The current map extent center lies in UTM Zone" msgstr "Az aktuális térkép kiterjedésének közepe UTM Zónába esik" -#: ../Thuban/UI/proj4dialog.py:254 ../Thuban/UI/projdialog.py:1025 +#: ../Thuban/UI/proj4dialog.py:254 ../Thuban/UI/projdialog.py:1030 msgid "Take" msgstr "Vidd" -#: ../Thuban/UI/projdialog.py:62 ../Thuban/UI/projdialog.py:770 +#: ../Thuban/UI/projdialog.py:62 ../Thuban/UI/projdialog.py:775 msgid "Transverse Mercator" msgstr "Transverse Mercator" -#: ../Thuban/UI/projdialog.py:63 ../Thuban/UI/projdialog.py:836 +#: ../Thuban/UI/projdialog.py:63 ../Thuban/UI/projdialog.py:841 msgid "Universal Transverse Mercator" msgstr "Universal Transverse Mercator" -#: ../Thuban/UI/projdialog.py:64 ../Thuban/UI/projdialog.py:912 +#: ../Thuban/UI/projdialog.py:64 ../Thuban/UI/projdialog.py:917 msgid "Lambert Conic Conformal" msgstr "Lambert féle kúpszeletes" #: ../Thuban/UI/projdialog.py:65 ../Thuban/UI/projdialog.py:66 -#: ../Thuban/UI/projdialog.py:962 +#: ../Thuban/UI/projdialog.py:967 msgid "Geographic" msgstr "Földrajzi" @@ -1441,7 +1424,7 @@ msgid "Projection:" msgstr "Vetület:" -#: ../Thuban/UI/projdialog.py:167 ../Thuban/UI/projdialog.py:642 +#: ../Thuban/UI/projdialog.py:167 ../Thuban/UI/projdialog.py:647 msgid "" msgstr "" @@ -1472,7 +1455,7 @@ msgid "Import" msgstr "Importálás" -#: ../Thuban/UI/projdialog.py:319 ../Thuban/UI/projdialog.py:611 +#: ../Thuban/UI/projdialog.py:319 ../Thuban/UI/projdialog.py:616 msgid "Warnings" msgstr "Figyelmeztetések" @@ -1501,39 +1484,39 @@ msgid "Multiple Projections selected" msgstr "Több vetülett lett kiválasztva" -#: ../Thuban/UI/projdialog.py:643 +#: ../Thuban/UI/projdialog.py:648 msgid "Airy" msgstr "Airy" -#: ../Thuban/UI/projdialog.py:644 +#: ../Thuban/UI/projdialog.py:649 msgid "Bessel 1841" msgstr "Bessel 1841" -#: ../Thuban/UI/projdialog.py:645 +#: ../Thuban/UI/projdialog.py:650 msgid "Clarke 1866" msgstr "Clarke 1866" -#: ../Thuban/UI/projdialog.py:646 +#: ../Thuban/UI/projdialog.py:651 msgid "Clarke 1880" msgstr "Clarke 1880" -#: ../Thuban/UI/projdialog.py:647 +#: ../Thuban/UI/projdialog.py:652 msgid "GRS 1980 (IUGG, 1980)" msgstr "GRS 1980 (IUGG, 1980)" -#: ../Thuban/UI/projdialog.py:648 +#: ../Thuban/UI/projdialog.py:653 msgid "International 1909 (Hayford)" msgstr "International 1909 (Hayford)" -#: ../Thuban/UI/projdialog.py:649 +#: ../Thuban/UI/projdialog.py:654 msgid "WGS 84" msgstr "WGS 84" -#: ../Thuban/UI/projdialog.py:661 +#: ../Thuban/UI/projdialog.py:666 msgid "Ellipsoid:" msgstr "Ellipszoid:" -#: ../Thuban/UI/projdialog.py:710 +#: ../Thuban/UI/projdialog.py:715 msgid "" "Thuban does not know the parameters\n" "for the current projection and cannot\n" @@ -1549,63 +1532,63 @@ "A paraméterek nem azonosított készlete:\n" "\n" -#: ../Thuban/UI/projdialog.py:756 +#: ../Thuban/UI/projdialog.py:761 msgid "Latitude:" msgstr "Szélesség:" -#: ../Thuban/UI/projdialog.py:758 +#: ../Thuban/UI/projdialog.py:763 msgid "Longitude:" msgstr "Hosszúság:" -#: ../Thuban/UI/projdialog.py:760 ../Thuban/UI/projdialog.py:904 +#: ../Thuban/UI/projdialog.py:765 ../Thuban/UI/projdialog.py:909 msgid "False Easting:" msgstr "A középpont keleti irányú koordinátája:" -#: ../Thuban/UI/projdialog.py:762 ../Thuban/UI/projdialog.py:906 +#: ../Thuban/UI/projdialog.py:767 ../Thuban/UI/projdialog.py:911 msgid "False Northing:" msgstr "A középpont északi irányú koordinátája:" -#: ../Thuban/UI/projdialog.py:764 +#: ../Thuban/UI/projdialog.py:769 msgid "Scale Factor:" msgstr "Skála tényezõ:" -#: ../Thuban/UI/projdialog.py:817 +#: ../Thuban/UI/projdialog.py:822 msgid "Southern Hemisphere" msgstr "Déli félteke" -#: ../Thuban/UI/projdialog.py:827 +#: ../Thuban/UI/projdialog.py:832 msgid "Zone:" msgstr "Zóna:" -#: ../Thuban/UI/projdialog.py:864 +#: ../Thuban/UI/projdialog.py:869 msgid "Can not propose: No bounding box found." msgstr "Nincs ajánlat: Nem található határoló doboz." -#: ../Thuban/UI/projdialog.py:895 +#: ../Thuban/UI/projdialog.py:900 msgid "Latitude of first standard parallel:" msgstr "Az elsõ standard párhuzamos szélessége:" -#: ../Thuban/UI/projdialog.py:898 +#: ../Thuban/UI/projdialog.py:903 msgid "Latitude of second standard parallel:" msgstr "A második standard párhuzamos szélessége:" -#: ../Thuban/UI/projdialog.py:900 +#: ../Thuban/UI/projdialog.py:905 msgid "Central Meridian:" msgstr "Centralis Meridián:" -#: ../Thuban/UI/projdialog.py:902 +#: ../Thuban/UI/projdialog.py:907 msgid "Latitude of origin:" msgstr "Szélesség:" -#: ../Thuban/UI/projdialog.py:952 +#: ../Thuban/UI/projdialog.py:957 msgid "Degrees" msgstr "Fok" -#: ../Thuban/UI/projdialog.py:953 +#: ../Thuban/UI/projdialog.py:958 msgid "Radians" msgstr "Radián" -#: ../Thuban/UI/projdialog.py:986 +#: ../Thuban/UI/projdialog.py:991 msgid "Source Data is in: " msgstr "A forrásadat:" @@ -1675,6 +1658,25 @@ msgid "Export Map" msgstr "Térkép exportálása" +#~ msgid "Extensions:\n" +#~ msgstr "Kiterjesztések:\n" + +#~ msgid "\tNone registered.\n" +#~ msgstr "\tNincs regisztrálva.\n" + +#~ msgid "" +#~ "Details on the registered extensions:\n" +#~ "\n" +#~ msgstr "" +#~ "A regisztrált kiterjesztések részletei:\n" +#~ "\n" + +#~ msgid "Copyright %s\n" +#~ msgstr "Copyright: %s\n" + +#~ msgid "Authors:\n" +#~ msgstr "Szerzõk:\n" + #~ msgid "size < 1" #~ msgstr "méret < 1" @@ -1689,9 +1691,6 @@ #~ msgid "Geometry Column" #~ msgstr "Geometrikus oszlop" - -#~ msgid "Exit Thuban now" -#~ msgstr "Kilépés a Thubanból most" #~ msgid "&Top" #~ msgstr "&Legfelsõ" From cvs at intevation.de Mon Dec 20 18:22:36 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 20 Dec 2004 18:22:36 +0100 (CET) Subject: bh: thuban ChangeLog,1.624.2.29,1.624.2.30 Message-ID: <20041220172236.77E4C102BDB@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv568 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: * po/hu.po, po/it.po, po/pt_BR.po, po/ru.po: Simple msgmerge update to bring at least the msgid up to 1.0.1 and make it easier for translators Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.29 retrieving revision 1.624.2.30 diff -u -d -r1.624.2.29 -r1.624.2.30 --- ChangeLog 20 Dec 2004 17:20:24 -0000 1.624.2.29 +++ ChangeLog 20 Dec 2004 17:22:34 -0000 1.624.2.30 @@ -1,5 +1,11 @@ 2004-12-20 Bernhard Herzog + * po/hu.po, po/it.po, po/pt_BR.po, po/ru.po: Simple msgmerge + update to bring at least the msgid up to 1.0.1 and make it easier + for translators + +2004-12-20 Bernhard Herzog + * NEWS: And some more: I forgot some translation updates. 2004-12-20 Bernhard Herzog From bh at intevation.de Mon Dec 20 19:17:41 2004 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 20 Dec 2004 19:17:41 +0100 Subject: Thuban 1.0.1 about to be released Message-ID: Hi all, as you could see from the recent mails on this list, we are preparing Thuban 1.0.1, a new release of the 1.0 branch. That release is practically finished now. It's tagged in CVS as THUBAN_1_0_1. I've just uploaded the source packages (tarball and zip file) as well as a windows installer to http://ftp.intevation.de/thuban/. The windows installer has been built with Python 2.3 (the one for 1.0.0 was built with 2.2). Contributions of binary packages for other systems would be very welcome. Left to do: - update the web-site - write a proper announcement Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From jan at intevation.de Tue Dec 21 08:49:40 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Tue, 21 Dec 2004 08:49:40 +0100 Subject: [Thuban-devel] Thuban 1.0.1 about to be released In-Reply-To: References: Message-ID: <20041221074940.GA16452@intevation.de> On Mon, Dec 20, 2004 at 07:17:41PM +0100, Bernhard Herzog wrote: > Left to do: > > - update the web-site I will take of the web site. > - write a proper announcement who is doing this? -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From jan at intevation.de Tue Dec 21 17:34:03 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Tue, 21 Dec 2004 17:34:03 +0100 Subject: Thuban 1.0.1 about to be released In-Reply-To: <20041221074940.GA16452@intevation.de> References: <20041221074940.GA16452@intevation.de> Message-ID: <20041221163403.GA16054@intevation.de> On Tue, Dec 21, 2004 at 08:49:40AM +0100, Jan-Oliver Wagner wrote: > On Mon, Dec 20, 2004 at 07:17:41PM +0100, Bernhard Herzog wrote: > > Left to do: > > > > - update the web-site > > I will take of the web site. done. > > - write a proper announcement > > who is doing this? alas, will do this as well ;-) Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From nelson at crynwr.com Wed Dec 22 01:32:14 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 21 Dec 2004 19:32:14 -0500 Subject: LatLongBoundingBox? Message-ID: <16840.49294.945142.290714@desk.crynwr.com> Hmmm.... It seems to me, from grovelling through the code, that LatLongBoundingBox should always return sensible values; that is, values less than 90 to -90 and 180 to -180. If it doesn't, then by definition the projection is incorrect. Oughtn't Thuban to tell a user that on of their layers is not projected correctly? -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Wed Dec 22 04:53:17 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 21 Dec 2004 22:53:17 -0500 Subject: incremental rendering? Message-ID: <16840.61357.976057.37793@desk.crynwr.com> I wonder if panning wouldn't look nicer if 1) the renderer noticed that it had a background bitmap, and if so, 2) drew the bitmap and cleared everything else. I'm just noticing that the current behavior clears the screen before it draws the bitmap. Is this in _do_redraw()? I'm having trouble finding that code. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From thuban-bugs at intevation.de Thu Dec 23 11:19:10 2004 From: thuban-bugs at intevation.de (Request Tracker) Date: Thu, 23 Dec 2004 11:19:10 +0100 (CET) Subject: [bug #2866] (thuban) Do optional libraries work on Windows 98 ? Message-ID: <20041223101910.D69A8102BF3@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=2866 ------------------------------------------------------------------------- Subject: Do optional libraries work on Windows 98 ? Operating System: MS Windows, 98 Thuban version: 1.0.1 wxPython version: 2.4.2.4 Python version: other, 2.3.4 PySQLite version: 0.4.3 SQLite version: other, 2.8.2 GDAL version: other, gdal-1.1.8-w2k-py23 proj version: 4.4.7 Just downloaded Thuban 1.0.1 on my Windows 98 computer. I try to use GDAL and Psycopg functionnalities. My PYTHONPATH is properly set (well... I think) : SET PYTHONPATH=C:\progra~1\Thuban\GDAL-1~1.8-W;C:\progra~1\Thuban\GDAL-1~1.8-W\pymod SET PYTHONPATH=%PYTHONPATH%;C:\progra~1\Thuban\WIN-PS~1 Unfortunately, Thuban can't use those 2 modules. For GDAL, I get : GDAL - non disponible and GDAL n'est pas disponible parce que le module 'gdalwarp' n'a pas pu être importé. L'exception déclenchée par Python est: 'DLL load failed: Une des bibliothèques nécessaires à l'exécution de cette application n'a pu être trouvée.' Since, there is no gdalwarp in the distribution provided by Intevation (whereas there is one in the official one), I suspect a inaccurate test. For Psycopg, I simply get : psycopg - non disponible Even a copy of libpq.dll and psycopg.pyd to the $(PYTHONDIR)\DLLs directory doesn't help. Is my problem tied to Windows 98 or did I miss something in the docs ? BTW : would it make sense to provide a "full distribution" with all the optional libraries ? Cheers, p.b. -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Thu Dec 23 16:07:40 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 23 Dec 2004 16:07:40 +0100 (CET) Subject: jan: thuban/Thuban/UI projdialog.py,1.39.2.1,1.39.2.2 Message-ID: <20041223150740.63B3C102BD8@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv22341 Modified Files: Tag: thuban-1-0-branch projdialog.py Log Message: (ProjFrame.load_user_proj): Added a \n to stderr after the warnings. Thanks to Russell Nelson. Index: projdialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/projdialog.py,v retrieving revision 1.39.2.1 retrieving revision 1.39.2.2 diff -u -d -r1.39.2.1 -r1.39.2.2 --- projdialog.py 16 Dec 2004 10:56:17 -0000 1.39.2.1 +++ projdialog.py 23 Dec 2004 15:07:38 -0000 1.39.2.2 @@ -586,7 +586,7 @@ with get_user_proj_file and cache it in self.__usrProjFile. Show a busy cursor while loading the file. - + If the file is not available, leave a note to the console. """ if self.__usrProjFile is None: @@ -595,6 +595,7 @@ projfile, warnings = get_user_proj_file() if warnings: sys.stderr.write("".join(warnings)) + sys.stderr.write("\n") self.__usrProjFile = projfile finally: ThubanEndBusyCursor() From cvs at intevation.de Thu Dec 23 16:07:58 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 23 Dec 2004 16:07:58 +0100 (CET) Subject: jan: thuban ChangeLog,1.624.2.30,1.624.2.31 Message-ID: <20041223150758.EF286102BD8@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv22365 Modified Files: Tag: thuban-1-0-branch ChangeLog Log Message: Tiny fix. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.624.2.30 retrieving revision 1.624.2.31 diff -u -d -r1.624.2.30 -r1.624.2.31 --- ChangeLog 20 Dec 2004 17:22:34 -0000 1.624.2.30 +++ ChangeLog 23 Dec 2004 15:07:56 -0000 1.624.2.31 @@ -1,3 +1,8 @@ +2004-12-23 Jan-Oliver Wagner + + * Thuban/UI/projdialog.py (ProjFrame.load_user_proj): Added a + \n to stderr after the warnings. Thanks to Russell Nelson. + 2004-12-20 Bernhard Herzog * po/hu.po, po/it.po, po/pt_BR.po, po/ru.po: Simple msgmerge From cvs at intevation.de Thu Dec 23 16:10:43 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 23 Dec 2004 16:10:43 +0100 (CET) Subject: jan: thuban/Thuban/UI projdialog.py,1.40,1.41 Message-ID: <20041223151043.CC08A102BD8@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv22403 Modified Files: projdialog.py Log Message: (ProjFrame.load_user_proj): Added a \n to stderr after the warnings. Thanks to Russell Nelson. Index: projdialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/projdialog.py,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- projdialog.py 16 Dec 2004 11:00:10 -0000 1.40 +++ projdialog.py 23 Dec 2004 15:10:41 -0000 1.41 @@ -586,7 +586,7 @@ with get_user_proj_file and cache it in self.__usrProjFile. Show a busy cursor while loading the file. - + If the file is not available, leave a note to the console. """ if self.__usrProjFile is None: @@ -595,6 +595,7 @@ projfile, warnings = get_user_proj_file() if warnings: sys.stderr.write("".join(warnings)) + sys.stderr.write("\n") self.__usrProjFile = projfile finally: ThubanEndBusyCursor() From cvs at intevation.de Thu Dec 23 16:11:00 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 23 Dec 2004 16:11:00 +0100 (CET) Subject: jan: thuban ChangeLog,1.747,1.748 Message-ID: <20041223151100.722DE102BD8@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv22433 Modified Files: ChangeLog Log Message: Tiny fix Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.747 retrieving revision 1.748 diff -u -d -r1.747 -r1.748 --- ChangeLog 20 Dec 2004 14:13:57 -0000 1.747 +++ ChangeLog 23 Dec 2004 15:10:58 -0000 1.748 @@ -1,3 +1,8 @@ +2004-12-23 Jan-Oliver Wagner + + * Thuban/UI/projdialog.py (ProjFrame.load_user_proj): Added a + \n to stderr after the warnings. Thanks to Russell Nelson. + 2004-12-20 Nina Hueffmeyer * Extensions/ogr/ogrshapes.py: Fixed some issues from From jan at intevation.de Thu Dec 23 16:49:42 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 23 Dec 2004 16:49:42 +0100 Subject: Middle button pans In-Reply-To: <16833.44680.370317.77203@desk.crynwr.com> References: <16831.5424.130392.525341@desk.crynwr.com> <20041216012247.GA32454@intevation.de> <16833.11583.389518.600030@desk.crynwr.com> <20041216091029.GA17622@intevation.de> <16833.40517.421052.681358@desk.crynwr.com> <16833.44680.370317.77203@desk.crynwr.com> Message-ID: <20041223154942.GC22011@intevation.de> On Thu, Dec 16, 2004 at 10:49:28AM -0500, Russell Nelson wrote: > Bernhard Herzog writes: > > Russell Nelson writes: > > > > > Frank Koormann writes: > > > > I like this feature also very much. However, it chrashes Thuban, if you > > > > click the middle mouse button over a view without a session loaded. > > > > > > Hahahaha! Indeed it does. Patch against CVS HEAD, > > > > It's better now, but I have to activate a tool before I can pan with the > > middle mouse button. > > True. Maybe thuban should activate one of the tools when a layer is added? I'd prefer a solution where this is not necessary. Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From daniel.calvelo at minag.gob.pe Mon Dec 20 19:21:47 2004 From: daniel.calvelo at minag.gob.pe (Daniel Calvelo) Date: Mon, 20 Dec 2004 13:21:47 -0500 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> Message-ID: <20041220181736.M74336@minag.gob.pe> Bernhard Herzog writes: > > "Daniel Calvelo Aros" writes: > > > Attached are fr and es. Shorter than I thought. > > Thanks. AFAIK, you started out from the HEAD branch, though, not > thuban-1-0-branch. It's not much of a problem as the strings aren't > that much different. After the msgmerge with a current thuban.pot from > thuban-1-0-branch there were only three fuzzy entries which I could copy > over from the old po files. Here's a list of the entries I copied over > so that you can check them: Yes, I took the fast and easy way: downloaded the tarball from cvsweb. The three entries you mention are deleted in HEAD. The corresponding translations (reproduced below) are OK. Thanks. Daniel. > fr.po: > > #: ../Thuban/UI/proj4dialog.py:157 > msgid "Projection: UTM Parameters" > msgstr "Projection: Param??tres UTM" > > #: ../Thuban/UI/proj4dialog.py:172 > msgid "UTM Zone" > msgstr "Zone UTM" > > #: ../Thuban/UI/proj4dialog.py:185 > msgid "Ellipsoid" > msgstr "Ellipso??de" > > es.po: > > #: ../Thuban/UI/proj4dialog.py:157 > msgid "Projection: UTM Parameters" > msgstr "Proyecci??n: Par??metros UTM" > > #: ../Thuban/UI/proj4dialog.py:172 > msgid "UTM Zone" > msgstr "Zona UTM" > > #: ../Thuban/UI/proj4dialog.py:185 > msgid "Ellipsoid" > msgstr "Elipsoide" > > Bernhard > > -- > Intevation GmbH http://intevation.de/ > Skencil http://skencil.org/ > Thuban http://thuban.intevation.org/ > > _______________________________________________ > Thuban-devel mailing list > Thuban-devel at intevation.de > https://intevation.de/mailman/listinfo/thuban-devel ------- End of Original Message ------- From nelson at crynwr.com Thu Dec 23 17:43:51 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 23 Dec 2004 11:43:51 -0500 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041220181736.M74336@minag.gob.pe> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041220181736.M74336@minag.gob.pe> Message-ID: <16842.62919.325251.324489@desk.crynwr.com> Daniel Calvelo writes: > Yes, I took the fast and easy way: downloaded the tarball from > cvsweb. I have a few years of experience with software releases, but don't have any experience with translations, so this may actually be a STOOPID suggestion: Wouldn't it be easier for translators to create translations against released code? So you'd have a program release of X.Y, and translation releases of -trans.X.Y.Z. First, there would be no time pressure ("We have the strings frozen! Quick, translate them!"), because translations could be added easily. Second, you could even create an automated system for translating. Make a web form out of the string dictionary, with a pulldown box for the language being translated. Let the user enter the translation strings, and automagically rebuild the -trans package. Hmmmm..... Actually, you could create a meta-translation package, which has translations for every program. Collect all the _("x") strings from every program that has them, and have one package which has translations for everything. It may be that the same phrase could need different translations in context, but that's a minor difficulty. But maybe this is STOOPID? You've heard the joke: What's the name for someone who speaks three languages? Trilingual. What's the name for someone who speaks two languages? Bilingual. What's the name for someone who speaks one language? American. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bernhard at intevation.de Thu Dec 23 19:03:33 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Thu, 23 Dec 2004 19:03:33 +0100 Subject: LatLongBoundingBox? In-Reply-To: <16840.49294.945142.290714@desk.crynwr.com> References: <16840.49294.945142.290714@desk.crynwr.com> Message-ID: <20041223180333.GC21008@intevation.de> On Tue, Dec 21, 2004 at 07:32:14PM -0500, Russell Nelson wrote: > Hmmm.... It seems to me, from grovelling through the code, that > LatLongBoundingBox should always return sensible values; that is, > values less than 90 to -90 and 180 to -180. If it doesn't, then by > definition the projection is incorrect. Oughtn't Thuban to tell a > user that on of their layers is not projected correctly? Yes, Thuban should. You are completely on target to note these usability problems. The thuban development often happens in burst mode as we sometimes are occupied by insense projects. So noting these issues is very important as we will take this up when we are next to this code next time. Thanks again for supporting Thuban and helping us to improve it! Bernhard R. -------------- 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/20041223/3f8b6ded/attachment.bin From nelson at crynwr.com Thu Dec 23 22:55:06 2004 From: nelson at crynwr.com (Russell Nelson) Date: Thu, 23 Dec 2004 16:55:06 -0500 Subject: LatLongBoundingBox? In-Reply-To: <20041223180333.GC21008@intevation.de> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> Message-ID: <16843.16058.801955.127358@desk.crynwr.com> Bernhard Reiter writes: > You are completely on target to note these usability problems. Thanks for agreeing with me that they are problems! That gives me encouragement and license to fix them. In this particular case, I think that the status line at the bottom should say "Use Layer/Projection... to correct the projection for layer %s" % layer.Labels()[0].text. I'll propose a patch once I figure out how to make it happen. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From dcalvelo at minag.gob.pe Fri Dec 24 00:41:29 2004 From: dcalvelo at minag.gob.pe (Daniel Calvelo Aros) Date: Thu, 23 Dec 2004 18:41:29 -0500 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <16842.62919.325251.324489@desk.crynwr.com> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041220181736.M74336@minag.gob.pe> <16842.62919.325251.324489@desk.crynwr.com> Message-ID: <20041223232209.M35034@minag.gob.pe> Hi Russel. Not a stupid idea at all. Actually, it's the general scheme for translations using GNU gettext (which Python uses, after a very interesting discussion on a SIG, maybe four years ago). If you haven't used it, check it out in your spare time. The system is very powerful. For us unix-bred people, the mixture of the CLI tools with emacs and po-mode is very straightforward. Gettext is very unixish: have shell tools to generate text files, edit those and compile appropriate files for a library to use, linked to your application. Usually you install all the compiled translations (they don't take much space) and are able to switch between them based on environment variables. Since it's all text-based and the compilations may be handled by the global application compile, it's very appropriate for CVS work. So yes, you can have versioned translations in the same way you can have versioned releases: it all boils down to properly handling CVS. Since I don't have CVS access, I resort to web-grabbing and mail; the nice folks at Intevation handle CVS from that. There are problems, mind you: often the string-marking (using _) must be made with translation in mind. Handling plurals, ordinals, dates may be very different between languages. For instance, in english, the language ambiguity allows you to use imperative in lieu of infinitive; there are no genres; there are no declinations; phrases are always short; technical terms become standard very quickly. Sometimes you must resort to anglicisms in translations for space reasons, and so on. A well-done translation is very hard to do. I don't claim five stars for mine: I should be doing user-testing, systematic verification of tenses and maybe specialisation of some strings ("query": is it an imperative, a title, a noun?)... What's very interesting in what you said is the idea of a web-based po-file editor. I'm not aware of such a tool, but it would be a great addition to systems like cvsweb, maven and so on. For me, having a modem connection, downloading and uploading po files is the most effective way to go. PS. Loved the joke! -- Daniel Calvelo Aros ---------- Original Message ----------- From: Russell Nelson To: Thuban Developer Mailing List Sent: Thu, 23 Dec 2004 11:43:51 -0500 Subject: Re: Translators: Translation updates soon needed for upcoming release 1.0.1 > Daniel Calvelo writes: > > Yes, I took the fast and easy way: downloaded the tarball from > > cvsweb. > > I have a few years of experience with software releases, but don't > have any experience with translations, so this may actually be a > STOOPID suggestion: Wouldn't it be easier for translators to create > translations against released code? So you'd have a program release > of X.Y, and translation releases of -trans.X.Y.Z. First, there would > be no time pressure ("We have the strings frozen! Quick, translate > them!"), because translations could be added easily. Second, you > could even create an automated system for translating. Make a web > form out of the string dictionary, with a pulldown box for the > language being translated. Let the user enter the translation > strings, and automagically rebuild the -trans package. > > Hmmmm..... Actually, you could create a meta-translation package, > which has translations for every program. Collect all the _("x") > strings from every program that has them, and have one package which > has translations for everything. It may be that the same phrase > could need different translations in context, but that's a minor difficulty. > > But maybe this is STOOPID? You've heard the joke: > > What's the name for someone who speaks three languages? Trilingual. > What's the name for someone who speaks two languages? Bilingual. > What's the name for someone who speaks one language? American. > > -- > --My blog is at angry-economist.russnelson.com | Freedom means allowing > Crynwr sells support for free software | PGPok | people to do > things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | > majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP > | stupid, e.g. take drugs. > > _______________________________________________ > Thuban-devel mailing list > Thuban-devel at intevation.de > https://intevation.de/mailman/listinfo/thuban-devel ------- End of Original Message ------- From nelson at crynwr.com Fri Dec 24 06:49:51 2004 From: nelson at crynwr.com (Russell Nelson) Date: Fri, 24 Dec 2004 00:49:51 -0500 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041223232209.M35034@minag.gob.pe> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041220181736.M74336@minag.gob.pe> <16842.62919.325251.324489@desk.crynwr.com> <20041223232209.M35034@minag.gob.pe> Message-ID: <16843.44543.445628.31765@desk.crynwr.com> Daniel Calvelo Aros writes: > Not a stupid idea at all. Actually, it's the general scheme for > translations using GNU gettext Actually, I know all about gettext. I was talking about the way in which software releases interact with the po-files. What if you had a Wiki-like interface to po files? So that anybody could say, for any program, "give me the French translation", and if there wasn't one, they could write it, and install it on their computer. And of course, anybody else could install it. I'm assuming that 1) it's hard to get translators, and 2) that if people could trivially create a translation, more translations would be available. If those assumptions are wrong, then I am speaking doo-doo. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Fri Dec 24 07:56:18 2004 From: nelson at crynwr.com (Russell Nelson) Date: Fri, 24 Dec 2004 01:56:18 -0500 Subject: an oopsie? Message-ID: <16843.48530.709140.712526@desk.crynwr.com> Hmmmmm. Thuban/Model/map.py says this: def Layers(self): """Return the list of layers contained in the map. The list does not include the label layer""" return self.layers and yet later does this in BoundingBox: for layer in self.layers: if layer is self.label_layer: continue I can't see how both of those can be correct. If the first is wrong, there might be a bug hiding. If the second is wrong, it's just a few wasted cycles. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Fri Dec 24 08:17:42 2004 From: nelson at crynwr.com (Russell Nelson) Date: Fri, 24 Dec 2004 02:17:42 -0500 Subject: LatLongBoundingBox? In-Reply-To: <20041223180333.GC21008@intevation.de> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> Message-ID: <16843.49814.623147.688998@desk.crynwr.com> Bernhard Reiter writes: > On Tue, Dec 21, 2004 at 07:32:14PM -0500, Russell Nelson wrote: > > Hmmm.... It seems to me, from grovelling through the code, that > > LatLongBoundingBox should always return sensible values; that is, > > values less than 90 to -90 and 180 to -180. If it doesn't, then by > > definition the projection is incorrect. Oughtn't Thuban to tell a > > user that on of their layers is not projected correctly? > > Yes, Thuban should. Unfortunately, that's not enough to fix the "view from 20 miles" effect of a map misprojection, just a layer misprojection. I added the chunk of code given below. If you load the UTM raster first, it catches the misprojection. If you then fix the layer's projection, and load a shapefile, you get a view from 20 miles high; that is, a blank screen. If you set the Map/Projection to UTM, it displays properly. If you load the shapefile first, there is no misprojection. If you then load the UTM raster, it catches the misprojection. You then get a view from 20 miles high again, but since there is no misprojection, the code below doesn't catch it. So, it looks like the code below is working just fine, but it's not sufficient to catch a map misprojection. I'm not proposing it as a patch yet, because I want to catch the map misprojection as well. Something along the lines of "These layers don't overlap; perhaps the map projection is wrong?" Also, something is clearing the Status line when you go up to the button bar. I can't find any calls to SetStatusText or set_position_text which might do this. Could it be something built into wxWindows? -- chunk of code inserted before last line of view_position_changed() text = "" map = self.canvas.Map() for layer in map.layers: bbox = layer.LatLongBoundingBox() if bbox: left, bottom, right, top = bbox if not (-180 < left < 180 and -180 < right < 180 and -90 < top < 90 and -90 < bottom < 90): text = ("Select "+layer.title+" and pick a " + "projection using Layer/Projection...") break -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From frank.koormann at intevation.de Sun Dec 26 12:21:32 2004 From: frank.koormann at intevation.de (Frank Koormann) Date: Sun, 26 Dec 2004 12:21:32 +0100 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <16843.44543.445628.31765@desk.crynwr.com> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041220181736.M74336@minag.gob.pe> <16842.62919.325251.324489@desk.crynwr.com> <20041223232209.M35034@minag.gob.pe> <16843.44543.445628.31765@desk.crynwr.com> Message-ID: <20041226112132.GA32472@intevation.de> * Russell Nelson [041224 06:50]: > Daniel Calvelo Aros writes: > > > Not a stupid idea at all. Actually, it's the general scheme for > > translations using GNU gettext > > Actually, I know all about gettext. I was talking about the way in > which software releases interact with the po-files. What if you had a > Wiki-like interface to po files? So that anybody could say, for any > program, "give me the French translation", and if there wasn't one, > they could write it, and install it on their computer. And of course, > anybody else could install it. So you have in mind something like the Rosetta Translation Portal recently started by the Ubuntu project: https://www.ubuntulinux.org/wiki/RosettaReleaseAnnouncement I havn't had a look at the software so far. Cheers, Frank -- Frank Koormann Professional Service around Free Software (http://intevation.net/) FreeGIS Project (http://freegis.org/) From jan at intevation.de Sun Dec 26 15:03:31 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Sun, 26 Dec 2004 15:03:31 +0100 Subject: [Thuban-devel] Re: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041223232209.M35034@minag.gob.pe> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041220181736.M74336@minag.gob.pe> <16842.62919.325251.324489@desk.crynwr.com> <20041223232209.M35034@minag.gob.pe> Message-ID: <20041226140331.GA2658@intevation.de> On Thu, Dec 23, 2004 at 06:41:29PM -0500, Daniel Calvelo Aros wrote: > What's very interesting in what you said is the idea of a web-based po-file > editor. I'm not aware of such a tool, but it would be a great addition to > systems like cvsweb, maven and so on. There is a product for Zope that supports handling web site multilinigual. It even allows for po file export. However, the context is very important. The gettext utils help a lot to find the right translation, ie. you can jump into the code where a string is used. I have the impression that a web site approach would not greatly enhance the number or quality of translations. But I might be wrong. However, for Thuban we have a number of other important issues to work on and the translations work fine with the current method (thanks to the volunteer translators!). So unless I have plenty of time or the pressure gets high, I hesitate to install a tool like the Zope product. A general babelfish like automated translator will result in very bad translations. Even the current manual KDE translations are sometimes horible because non-experts do translations and have e.g. no idea about OpenPGP and S/MIME; the user interface may get unusable. A case study may be interesting though. Maybe there is already one out there. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From cvs at intevation.de Mon Dec 27 10:02:03 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 10:02:03 +0100 (CET) Subject: jan: thuban/Doc/manual thuban-manual-de.xml,1.4,1.5 Message-ID: <20041227090203.0C381102C04@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Doc/manual In directory doto:/tmp/cvs-serv4755 Modified Files: thuban-manual-de.xml Log Message: More translations. Index: thuban-manual-de.xml =================================================================== RCS file: /thubanrepository/thuban/Doc/manual/thuban-manual-de.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- thuban-manual-de.xml 18 Dec 2004 02:36:59 -0000 1.4 +++ thuban-manual-de.xml 27 Dec 2004 09:02:00 -0000 1.5 @@ -690,7 +690,7 @@ - The Pan tool + Das Verschieben Werkzeug @@ -698,14 +698,15 @@ - Pan Tool + Verschieben Werkzeug - allows the user to move the map around by clicking and dragging. + gestattet es dem Benutzer die Karte durch klicken und + ziehen mit gedrückter Maustaste zu verschieben. - The Full Extent tool + Das Volle Ausdehnung Werkzeug @@ -713,14 +714,15 @@ - Full Extent Tool + Volle Ausdehnung Werkzeug - rescales the viewable region so that the entire map is visible. + skaliert die Zoom-Stufe so, dass die gesamte sichtbare Karte im + Fenster dargestellt wird. - The Full Layer Extent tool + Das Voll Ebenen-Ausdehnung Werkzeug @@ -728,16 +730,16 @@ - Full Layer Extent Tool + Volle Ebenen-Ausdehnung Werkzeug - rescales the viewable region so that the currently selected - layer fits within the window. If no layer is selected this button - will be disabled. + skaliert die Zoom-Stufe so, dass die akutelle Ebene vollständig + im Fenster dargestellt wird. Ist keine Ebene ausgewählt, so + ist dieser Knopf ausgegraut und damit nicht verfügbar. - The Full Shape Extent tool + Das Volle Shape-Ausdehnung Werkzeug @@ -745,15 +747,18 @@ - Full Shape Extent Tool + Volle Shape-Ausdehnung Werkzeug - rescales the viewable region so that the currently selected - shape fits within the window. If the shape is a point, it is - centered and the map is zoomed all the way in. If no shape is - selected this button will be disabled. This feature is especially - helpful when identifying an object related to a selected record - in a tableview (see below). - + skaliert die Zoom-Stufe so, dass die aktuell ausgewählten Shapes + vollständig in das Fenster eingepasst sind. + Handelt es sich bei der Auswahl nur um einen einzelnen Punkt + so wird dieser zentriert dargestellt und bis zu einem gewissen + grad gezoomed. + Ist kein Shape selektiert, so ist dieser Knopf ausgegraut und damit + nicht verfügbar. + Dieses Werkzeug ist besonders für den Fall hilfreich wenn man Objekte + in einer Ebenen-Tabelle auswählt und sie auf der Karte schnell + anspringen machen möchte. From cvs at intevation.de Mon Dec 27 10:05:45 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 10:05:45 +0100 (CET) Subject: jan: thuban/Doc/manual thuban-manual-de.xml,1.5,1.6 Message-ID: <20041227090545.A9F94102C04@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/Doc/manual In directory doto:/tmp/cvs-serv4910 Modified Files: thuban-manual-de.xml Log Message: More translations. Index: thuban-manual-de.xml =================================================================== RCS file: /thubanrepository/thuban/Doc/manual/thuban-manual-de.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- thuban-manual-de.xml 27 Dec 2004 09:02:00 -0000 1.5 +++ thuban-manual-de.xml 27 Dec 2004 09:05:43 -0000 1.6 @@ -1403,18 +1403,20 @@
- Table Management + Tabellen-Management - Thuban distinguishes two different types of tables: Attribute tables - (which belong to a layer) and normal data tables. Both provide - the same general functionality with the difference that actions on an - attribute table might also effect the map display. + Thuban unterscheidet zwei unterschiedliche Tabellen-Typen: + Attributtabellen (welche zu einer Ebene gehört) sowie normale + Datentabellen. + Beide bieten die gleiche allgemeine Funktionalität mit dem + einzigen Unterschied, dass Aktionen auf einer Attributtabelle + die Kartendarstellung ändern können. -
Table View +
Tabellen-Ansicht
- Table View + Tabellen-Ansicht @@ -1422,119 +1424,131 @@
- Thuban provides a standard dialog to display table contents, the - Table View. The view has five sections: The title, selections, - the table grid, export functions, and the status bar. + Thuban stellt einen Standard-Dialog für die Anzeige einer Tabelle + zur Verfügung. Diese Aansicht hat 5 Elemente:Titel, Selektion, + das Tabellenraster, Exportfunktionen und die Statuszeile. - The title bar identifies the table with its name. + Die Titelzeile identifiziert die Tabelle mit ihrem Namen. - The selections box let the user perform simple analysis on the data - based on comparisons: The first choice must be a field identifier of - the table, the second choice determines the type of comparison. The - third choice can be either a specific value (interpreted as numerical - or string depending on the type of the first field) or a second field - identifier. Thus you can perform analysis like selecting all - records where population > 10000 or - cars_per_inhabitant < bikes_per_inhabitant - (note that the field names are only explanatory, the dBase files - allow only 11 character field names). + Die Selektionsbox erlaubt es dem Benutzer einfache Analysen auf den Daten + durch Vergleiche durchzuführen: Die erste Auswahl ist ein Feldbezeichner + der Tabelle, die zweite Auswahl bestimmt den Typ des Vergleichs. + Die dritte Auswahl kann entweder ein bestimmter Wert (interpretiert + als Zahl oder als Zeichenkette abhängig vom Typ des ersten Feldes) + oder ein zweiter Feldbezeichner sein. + D.h. man kann Analysen durchführen wie alle Einträge auswählen bei + denen bevoelkerung > 10000 oder + pkw_pro_einwohner < fahrraeder_pro_einwohner + (beachten Sie, dass die Namen nur exemplarisch sind, dBase Dateien + erlauben nur Bezeichner mit einer maximalen Länge von 11 Zeichen). - Selections can be combined either by applying a selection only on - a previously selected set of records or by adding the results of a - selection to a previous set. The default is that a selection replaces - earlier results. + Selektionen können kombiniert werden. Entweder bezieht sich + die Selektion auf die zuvor selektierten Einträge oder man kann + eine bestehende Selektion erweitern. Voreingestellt ist + einersetzen der bisherigen Selektion. - The table grid shows the contents of the table (one record per row), - with highlighted selection results. Columns and rows can be resized. + Das Tabellenraster zeigt den Inhalt der Tabelle (pro Zeile ein Eintrag). + Selektionen sind hervorgehoben. Die Grösse der Zeiken und Spalten kann + verändert werden. - The contents of a table can be exported into a file, either dBase - format (DBF) or comma separated values (CSV). The - Export button - raises a file dialog to specify a path and file name, the export type - is determined by the file extension (either .dbf or .csv). + Der Inhalt einer Tabelle kann in eine Datei exportiert werden, + entweder im dBase format (DBF) oder als kommaseparierte Werte + (CSV). Der. + Export Knopf startet einen Dialog + zur Angabe des Pfades und des Namens der Datei. + Der Export-Typ wird durch die Namenserwiterung spezifiziert + (entweder .dbf oder .csv). - The Export Selection button works similarly - but exports only the selected records. + Der Knopf Exportiere Selektion funktioniert + ähnlich, exportiert aber nur die aktuelle Selektion. - The Close button closes the table view window. - This is different from the menu item + Der Schliessen Knopf schliesst das + Fenster mit der Tabellenansicht. Dies ist nicht zu verwechseln mit + dem Menüpunkt - Table - Close - which unloads the table from Thuban. + Tabelle + Schliessen + welcher die Tabelle aus Thuban entfernt. - The status bar displays some statistics about the table and optional - selection results. + Die Statuszeile zeigt einige statistische Informationen zu + der Tabelle sowie zu Selektionsergebnisse an.
-
General Functionality (Menu Table) +
Allgemeine Funktionalität (Menü Tabelle) - The general functions affect all tables open in Thuban. Attribute - tables are considered here as normal data tables (with the exception - that they cannot be closed). + Die allgemeinen Funktionen wirken sich auf alle geöffneten Tabellen + aus. Attributtabellen werden wie normale Tabellen behandelt (mit der + Ausnahme dass diese nicht geschlossen werden können). -
Open +
Öffnen - The + Der Menüpunkt - Table - Open - - item raises a file dialog to let you select a - dBase file from the file system to be loaded into Thuban read-only. - On OK the selected file is loaded and a - table view is opened. + Tabelle + Öffnen + + startet einen Dateiselektionsdialog für die Auswahl + einer dBase-Datei. Diese wird als nur-lesbar in Thuban + geladen. + Mit OK wird die ausgewählte Datei + geladen und eine entsprechende Tabellenansicht geöffnet.
-
Close +
Schliessen - The - - Table - Close - - item raises a dialog listing the currently open - data tables - (loaded via + Der Menüpunkt + + Tabelle + Schliessen + + startet einen Dialog welcher alle derzeit geöffneten Datentabellen + (die geladen wurden über - Table - Open - ). Selected tables are dereferenced on confirmation. - Since tables are opened read-only the contents of the tables are - not affected. + Tabelle + Öffnen + ). + Die gewählten Tabellen werden nach Bestätigung aus Thuban + entfernt. + Da die Tabellen als nur-lesend geöffnet wurden, wird + der Inhalt der Tabellen nicht verändert. - Any open views of the tables are closed as well. + Sämtliche offenen Tabellenansichten für diese + Tabellen werden ebenfalls geschlossen. - Tables used in a join cannot be closed. + Tabellen die bei Verknüpfungen verwendet werden + können nicht geschlossen werden.
-
Rename +
Umbenennen - Table - Rename - changes the table title. + Tabelle + Umbenennen + ändert den Tabellentitel.
-
Show +
Anzeigen - The + Der Menüpunkt - Table - Show + Tabelle + Anzeigen - item raises a list of available tables (explicitly - loaded, attribute tables, results of a join). Selected tables are - show in tables views on OK. + öffnet einen Dialog mit der Liste der verfügbaren + Tabellen (explizit geladene Tabellen, Attributtabellen, + Ergebnisse aus Verknüpfungen). + Die ausgewählten Tabellen werden nach der + Bestätigung mit + OK in Tabellenansichten dargestellt..
From cvs at intevation.de Mon Dec 27 10:09:03 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 10:09:03 +0100 (CET) Subject: jan: thuban ChangeLog,1.748,1.749 Message-ID: <20041227090903.79544102C04@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv4967 Modified Files: ChangeLog Log Message: continued translation of german manual Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.748 retrieving revision 1.749 diff -u -d -r1.748 -r1.749 --- ChangeLog 23 Dec 2004 15:10:58 -0000 1.748 +++ ChangeLog 27 Dec 2004 09:09:01 -0000 1.749 @@ -1,3 +1,7 @@ +2004-12-27 Jan-Oliver Wagner + + * Doc/manual/thuban-manual-de.xml: More translations. + 2004-12-23 Jan-Oliver Wagner * Thuban/UI/projdialog.py (ProjFrame.load_user_proj): Added a @@ -80,7 +84,7 @@ * Doc/manual/thuban-manual-de.xml: Copied English section about svexport over. - * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. + * Extensions/svgexport/__init__.py: Bumped version number to 1.0.0. * Extensions/svgexport/svgsaver.py,maplegend.py: Moved from experimental to stable extension menu. From jan at intevation.de Mon Dec 27 15:01:50 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 27 Dec 2004 15:01:50 +0100 Subject: [Thuban-devel] an oopsie? In-Reply-To: <16843.48530.709140.712526@desk.crynwr.com> References: <16843.48530.709140.712526@desk.crynwr.com> Message-ID: <20041227140150.GB26155@intevation.de> On Fri, Dec 24, 2004 at 01:56:18AM -0500, Russell Nelson wrote: > Hmmmmm. Thuban/Model/map.py says this: > > def Layers(self): > """Return the list of layers contained in the map. > > The list does not include the label layer""" > return self.layers > > and yet later does this in BoundingBox: > > for layer in self.layers: > if layer is self.label_layer: > continue > > I can't see how both of those can be correct. If the first is wrong, > there might be a bug hiding. If the second is wrong, it's just a few > wasted cycles. I think it is the second. Attached is a patch that primarily adds/extends doc strings and removes the above mentioned lines as well as adds LabelLayer to the TreeInfo output. Bernhard Herzog: OK to commit? If so, OK to backport to 1_0? Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ -------------- next part -------------- Index: Thuban/Model/map.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/map.py,v retrieving revision 1.18 diff -u -3 -p -r1.18 map.py --- Thuban/Model/map.py 10 Jul 2003 14:53:15 -0000 1.18 +++ Thuban/Model/map.py 27 Dec 2004 13:58:37 -0000 @@ -21,7 +21,9 @@ from label import LabelLayer class Map(TitledObject, Modifiable): - """Represent a map. A map is simply a list of layers. + """Represent a map. A map is a list of layers. Additionally + there is a special label layer containing all labels that + are defined for the map. Map objects send the following message types: @@ -50,10 +52,14 @@ class Map(TitledObject, Modifiable): self.projection = projection def Destroy(self): - # call Modifiable.Destroy first since it will call - # Publisher.Destroy which removes all subscriptions. Otherwise - # clearing the layers results in messages to be sent which can - # cause problems. + """Destroys the map object with all layers including + the label layer. + + Calls Modifiable.Destroy first since it will call + Publisher.Destroy which removes all subscriptions. Otherwise + clearing the layers results in messages to be sent which can + cause problems. + """ Modifiable.Destroy(self) self.ClearLayers() self.label_layer.Unsubscribe(CHANGED, self.forward, MAP_LAYERS_CHANGED) @@ -67,7 +73,9 @@ class Map(TitledObject, Modifiable): self.changed(MAP_LAYERS_ADDED, self) def RemoveLayer(self, layer): - """Remove layer from the map.""" + """Remove layer from the map. + This can not be applied for the label layer of the map. + """ self.unsubscribe_layer_channels(layer) self.layers.remove(layer) self.changed(MAP_LAYERS_CHANGED, self) @@ -84,7 +92,9 @@ class Map(TitledObject, Modifiable): return 1 def ClearLayers(self): - """Delete all layers.""" + """Delete all layers and also remove all labels from the + label layer. + """ for layer in self.layers: self.unsubscribe_layer_channels(layer) layer.Destroy() @@ -110,15 +120,18 @@ class Map(TitledObject, Modifiable): def Layers(self): """Return the list of layers contained in the map. - The list does not include the label layer""" + The list does not include the label layer which + can be retrieved by a separate method.""" return self.layers def HasLayers(self): - """Return true if the map has at least one shape layer""" + """Return true if the map has at least one layer other + than the label layer.""" return len(self.layers) > 0 def MoveLayerToTop(self, layer): - """Put the layer on top of the layer stack. + """Put the layer on top of the layer stack. This can not + be applied to the label layer. If the layer is already at the top do nothing. If the stacking order has been changed, issue a MAP_LAYERS_CHANGED message. @@ -130,9 +143,9 @@ class Map(TitledObject, Modifiable): self.changed(MAP_LAYERS_CHANGED, self) self.changed(MAP_STACKING_CHANGED, self) - def RaiseLayer(self, layer): - """Swap the layer with the one above it. + """Swap the layer with the one above it. This does + not apply to the label layer. If the layer is already at the top do nothing. If the stacking order has been changed, issue a MAP_LAYERS_CHANGED message. @@ -145,7 +158,8 @@ class Map(TitledObject, Modifiable): self.changed(MAP_STACKING_CHANGED, self) def LowerLayer(self, layer): - """Swap the layer with the one below it. + """Swap the layer with the one below it. This does + not apply to the label layer. If the layer is already at the bottom do nothing. If the stacking order has been changed, issue a MAP_LAYERS_CHANGED message. @@ -158,7 +172,8 @@ class Map(TitledObject, Modifiable): self.changed(MAP_STACKING_CHANGED, self) def MoveLayerToBottom(self, layer): - """Put the layer at the bottom of the stack. + """Put the layer at the bottom of the stack. This does + not apply to the label layer. If the layer is already at the bottom do nothing. If the stacking order has been changed, issue a MAP_LAYERS_CHANGED message. @@ -172,8 +187,11 @@ class Map(TitledObject, Modifiable): def BoundingBox(self): """Return the bounding box of the map in Lat/Lon coordinates. + The label layer is not considered for the computation of the + bounding box. - Return None if there are no layers or no layer contains any shapes. + Return None if there are no layers (except the label layer) or + no layer contains any shapes. """ if not self.layers: return None @@ -182,8 +200,6 @@ class Map(TitledObject, Modifiable): urx = [] ury = [] for layer in self.layers: - if layer is self.label_layer: - continue # the layer's bbox may be None if it doesn't have any shapes bbox = layer.LatLongBoundingBox() if bbox is not None: @@ -201,8 +217,11 @@ class Map(TitledObject, Modifiable): def ProjectedBoundingBox(self): """Return the bounding box of the map in projected coordinates. + The label layer is not considered for the computation of the + bounding box. - Return None if there are no layers or no layer contains any shapes. + Return None if there are no layers (except the label layer) or + no layer contains any shapes. """ # This simply returns the rectangle given by the projected # corners of the non-projected bbox. @@ -212,6 +231,7 @@ class Map(TitledObject, Modifiable): return bbox def GetProjection(self): + """Return the projection of the map.""" return self.projection def SetProjection(self, projection): @@ -246,6 +266,9 @@ class Map(TitledObject, Modifiable): self.label_layer.UnsetModified() def TreeInfo(self): + """Return a tuple of (title, tupel) describing the contents + of the object in a tree-structure. + """ items = [] if self.BoundingBox() != None: items.append(_("Extent (lat-lon): (%g, %g, %g, %g)") @@ -260,6 +283,6 @@ class Map(TitledObject, Modifiable): layers = self.layers[:] layers.reverse() items.extend(layers) + items.append(self.label_layer) return (_("Map: %s") % self.title, items) - Index: Thuban/Model/label.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/label.py,v retrieving revision 1.2 diff -u -3 -p -r1.2 label.py --- Thuban/Model/label.py 30 Jul 2002 14:15:39 -0000 1.2 +++ Thuban/Model/label.py 27 Dec 2004 13:58:37 -0000 @@ -7,6 +7,8 @@ __version__ = "$Revision: 1.2 $" +from Thuban import _ + from messages import CHANGED from base import TitledObject, Modifiable @@ -20,7 +22,13 @@ ALIGN_BASELINE = "baseline" class Label: + """This class repesents a single label that is + defined by its coordinate, the text as well + as vertical and horizontal alignment concerning + the coordinate.""" + def __init__(self, x, y, text, halign, valign): + """Initialize the label with the given parameters.""" self.x = x self.y = y self.text = text @@ -30,23 +38,49 @@ class Label: class LabelLayer(TitledObject, Modifiable): + """This represent a layer holding a number of labels.""" + def __init__(self, title): + """Initialize the LabeleLayer with an empty + list of labels and set the title to "title". + """ TitledObject.__init__(self, title) Modifiable.__init__(self) self.labels = [] def Labels(self): + """Return a list of all labels.""" return self.labels - def AddLabel(self, x, y, text, halign = "left", valign="center"): + def AddLabel(self, x, y, text, halign = ALIGN_LEFT, + valign = ALIGN_CENTER): + """Add a label at position (x,y) with contents "text". + + This will emit a CHANGED signal. + """ self.labels.append(Label(x, y, text, halign, valign)) self.changed(CHANGED) def RemoveLabel(self, index): + """Remove the label specified by index. + + This will emit a CHANGED signal. + """ del self.labels[index] self.changed(CHANGED) def ClearLabels(self): - """Remove all labels""" + """Remove all labels. + + This will emit a CHANGED signal. + """ del self.labels[:] self.changed(CHANGED) + + def TreeInfo(self): + """Return a tuple of (title, tupel) describing the contents + of the object in a tree-structure. + """ + items = [] + items.append(_("Number of labels: %d") % len(self.labels)) + return (_("Label Layer: %s") % self.title, items) From cvs at intevation.de Mon Dec 27 15:27:55 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 15:27:55 +0100 (CET) Subject: bernhard: thuban/libraries/pyshapelib ChangeLog, 1.7, 1.8 README, 1.3, 1.4 Message-ID: <20041227142755.5F2A6100160@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/libraries/pyshapelib In directory doto:/tmp/cvs-serv8915 Modified Files: ChangeLog README Log Message: Refering to the new homepage shapelib.maptools.org now. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/libraries/pyshapelib/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ChangeLog 13 Dec 2004 17:57:04 -0000 1.7 +++ ChangeLog 27 Dec 2004 14:27:53 -0000 1.8 @@ -1,3 +1,7 @@ +2004-12-27 Bernhard Reiter + + * README: Refering to the new homepage shapelib.maptools.org now. + 2004-12-13 Bernhard Herzog * dbflib.py: Updated from difflib.i with SWIG. Index: README =================================================================== RCS file: /thubanrepository/thuban/libraries/pyshapelib/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- README 28 May 2004 19:07:18 -0000 1.3 +++ README 27 Dec 2004 14:27:53 -0000 1.4 @@ -11,7 +11,7 @@ shptree quadtree for shapes Shapelib is a free software library for reading and writing ESRI shape -files and can be found at http://gdal.velocet.ca/projects/shapelib. +files and can be found at http://shapelib.maptools.org/. The bindings were partly created with SWIG, a tool that can generate wrappers of C and C++ libraries for a variety of scripting languages. From bernhard at intevation.de Mon Dec 27 15:42:20 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 27 Dec 2004 15:42:20 +0100 Subject: Translators: Translation updates soon needed for upcoming release 1.0.1 In-Reply-To: <20041223232209.M35034@minag.gob.pe> References: <20041215213937.GA29934@intevation.de> <20041217080219.M32302@minag.gob.pe> <20041220181736.M74336@minag.gob.pe> <16842.62919.325251.324489@desk.crynwr.com> <20041223232209.M35034@minag.gob.pe> Message-ID: <20041227144220.GJ1497@intevation.de> On Thu, Dec 23, 2004 at 06:41:29PM -0500, Daniel Calvelo Aros wrote: > it all boils down to properly handling CVS. Since I don't have CVS > access, I resort to web-grabbing and mail; the nice folks at Intevation handle > CVS from that. Just a side note: Of course grabbing the contents from the viewcvs is fine, but you could also use the annonymous CVS read access, if you like. -------------- 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/20041227/2a00f8b5/attachment.bin From bernhard at intevation.de Mon Dec 27 15:46:45 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 27 Dec 2004 15:46:45 +0100 Subject: LatLongBoundingBox? In-Reply-To: <16843.16058.801955.127358@desk.crynwr.com> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> <16843.16058.801955.127358@desk.crynwr.com> Message-ID: <20041227144645.GK1497@intevation.de> On Thu, Dec 23, 2004 at 04:55:06PM -0500, Russell Nelson wrote: > Bernhard Reiter writes: > > You are completely on target to note these usability problems. > > Thanks for agreeing with me that they are problems! That gives me > encouragement and license to fix them. Great! > In this particular case, I > think that the status line at the bottom should say "Use > Layer/Projection... to correct the projection for layer %s" % > layer.Labels()[0].text. I'll propose a patch once I figure out how to > make it happen. I am not sure that Thuban can find out precisely what is wrong, but a warning if it finds out that something is wrong seems the right way to me. We could even pop a dialog up which has a longer explanation. Another idea to work around the problems would to be to have an outline mode that always makes at least one red dot when a layer is outside the current view being to small or so. Otherwise it mark the bounding box. (Hmm just an idea.) Bernhard -------------- 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/20041227/3f850c05/attachment.bin From nelson at crynwr.com Mon Dec 27 17:10:58 2004 From: nelson at crynwr.com (Russell Nelson) Date: Mon, 27 Dec 2004 11:10:58 -0500 Subject: LatLongBoundingBox? In-Reply-To: <20041227144645.GK1497@intevation.de> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> <16843.16058.801955.127358@desk.crynwr.com> <20041227144645.GK1497@intevation.de> Message-ID: <16848.13330.621698.451830@desk.crynwr.com> Bernhard Reiter writes: > I am not sure that Thuban can find out precisely what is wrong, but > a warning if it finds out that something is wrong seems the right > way to me. We could even pop a dialog up which has a longer > explanation. > > Another idea to work around the problems would to be to have an > outline mode that always makes at least one red dot when a layer is > outside the current view being to small or so. > Otherwise it mark the bounding box. Well, part of the problem of having an unprojected or misprojected layer is that "zoom to the full map extent" does the wrong thing **from the user's point of view**. For example, if you have data in one UTM zone, and select a map projection in a different zone, zooming to the full map extent causes your data to disappear. Disappearing data is very disconcerting to a user! IMHO, if you have a layer which has been selected to be visible, and its LatLonBoundingBox does not overlap the current map view, the corner or edge closest to the data should say "LAYERNAME is over there" with an arrow. If you don't want to see that, and you *meant* for the layer to be off the map, turn off its visibility. Does anybody else think that's a good thing to have? -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From cvs at intevation.de Mon Dec 27 17:31:34 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 17:31:34 +0100 (CET) Subject: russell: thuban ChangeLog,1.749,1.750 Message-ID: <20041227163134.F09F6102BFD@lists.intevation.de> Author: russell Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv647 Modified Files: ChangeLog Log Message: The middle button now pans the map view. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.749 retrieving revision 1.750 diff -u -d -r1.749 -r1.750 --- ChangeLog 27 Dec 2004 09:09:01 -0000 1.749 +++ ChangeLog 27 Dec 2004 16:31:32 -0000 1.750 @@ -1,3 +1,7 @@ +2004-12-27 Russell Nelson + + * Middle button pans + 2004-12-27 Jan-Oliver Wagner * Doc/manual/thuban-manual-de.xml: More translations. From cvs at intevation.de Mon Dec 27 17:31:35 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 17:31:35 +0100 (CET) Subject: russell: thuban/Thuban/UI view.py,1.63,1.64 Message-ID: <20041227163135.0694E102C00@lists.intevation.de> Author: russell Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv647/Thuban/UI Modified Files: view.py Log Message: The middle button now pans the map view. Index: view.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/view.py,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- view.py 13 Dec 2004 18:26:11 -0000 1.63 +++ view.py 27 Dec 2004 16:31:32 -0000 1.64 @@ -24,6 +24,7 @@ wxPaintDC, wxColour, wxClientDC, wxINVERT, wxTRANSPARENT_BRUSH, wxFont,\ EVT_PAINT, EVT_LEFT_DOWN, EVT_LEFT_UP, EVT_MOTION, EVT_LEAVE_WINDOW, \ wxPlatform, wxBeginBusyCursor, wxEndBusyCursor, wxFileDialog, wxSAVE, \ + EVT_MIDDLE_DOWN, EVT_MIDDLE_UP, \ wxOVERWRITE_PROMPT, wxID_OK # Export related stuff @@ -128,6 +129,8 @@ EVT_PAINT(self, self.OnPaint) EVT_LEFT_DOWN(self, self.OnLeftDown) EVT_LEFT_UP(self, self.OnLeftUp) + EVT_MIDDLE_DOWN(self, self.OnMiddleDown) + EVT_MIDDLE_UP(self, self.OnMiddleUp) EVT_MOTION(self, self.OnMotion) EVT_LEAVE_WINDOW(self, self.OnLeaveWindow) wx.EVT_SIZE(self, self.OnSize) @@ -352,6 +355,17 @@ def GetPortSizeTuple(self): return self.GetSizeTuple() + + def OnMiddleDown(self, event): + self.remembertool = self.tool + if self.tool: + self.PanTool() + self.OnLeftDown(event) + + def OnMiddleUp(self, event): + self.OnLeftUp(event) + if self.remembertool: + self.SelectTool(self.remembertool) def OnLeftDown(self, event): self.MouseLeftDown(event) From bernhard at intevation.de Mon Dec 27 17:44:38 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 27 Dec 2004 17:44:38 +0100 Subject: LatLongBoundingBox? In-Reply-To: <16848.13330.621698.451830@desk.crynwr.com> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> <16843.16058.801955.127358@desk.crynwr.com> <20041227144645.GK1497@intevation.de> <16848.13330.621698.451830@desk.crynwr.com> Message-ID: <20041227164438.GN1497@intevation.de> On Mon, Dec 27, 2004 at 11:10:58AM -0500, Russell Nelson wrote: > Bernhard Reiter writes: > > I am not sure that Thuban can find out precisely what is wrong, but > > a warning if it finds out that something is wrong seems the right > > way to me. We could even pop a dialog up which has a longer > > explanation. > > > > Another idea to work around the problems would to be to have an > > outline mode that always makes at least one red dot when a layer is > > outside the current view being to small or so. > > Otherwise it mark the bounding box. > > Well, part of the problem of having an unprojected or misprojected > layer is that "zoom to the full map extent" does the wrong thing > **from the user's point of view**. For example, if you have data in > one UTM zone, and select a map projection in a different zone, zooming > to the full map extent causes your data to disappear. Disappearing > data is very disconcerting to a user! I agree. > IMHO, if you have a layer which has been selected to be visible, and > its LatLonBoundingBox does not overlap the current map view, the > corner or edge closest to the data should say "LAYERNAME is over > there" with an arrow. If you don't want to see that, and you *meant* > for the layer to be off the map, turn off its visibility. > > Does anybody else think that's a good thing to have? This is something similiar to the red dot idea I outlined above. I think it is a good idea to have such a target tracking mode in one or the other way. Using a red color in a frame could help us to signal the other potential situations, too. Like when you are too much into a layer to actually see a feature, then the hole frame could be red. -------------- 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/20041227/6698547a/attachment.bin From cvs at intevation.de Mon Dec 27 17:47:53 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 17:47:53 +0100 (CET) Subject: jan: thuban ChangeLog,1.750,1.751 Message-ID: <20041227164753.60323102BFD@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv847 Modified Files: ChangeLog Log Message: Fixing russells loginfo. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.750 retrieving revision 1.751 diff -u -d -r1.750 -r1.751 --- ChangeLog 27 Dec 2004 16:31:32 -0000 1.750 +++ ChangeLog 27 Dec 2004 16:47:51 -0000 1.751 @@ -1,6 +1,13 @@ 2004-12-27 Russell Nelson - * Middle button pans + Middle mouse button pans. + + * Thuban/UI/view.py (MapCanvas.__init__): Subscribe also + OnMiddleDown and OnMiddleUp events. + (MapCanvas.OnMiddleDown): New. Activate the pan tool and remember the + previously used tool. + (MapCanvas.OnMiddleUp): New. Reactivate the remebered tool used before + pressing the middle mouse button. 2004-12-27 Jan-Oliver Wagner From jan at intevation.de Mon Dec 27 17:50:47 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 27 Dec 2004 17:50:47 +0100 Subject: [Thuban-devel] russell: thuban ChangeLog,1.749,1.750 In-Reply-To: <20041227163134.F09F6102BFD@lists.intevation.de> References: <20041227163134.F09F6102BFD@lists.intevation.de> Message-ID: <20041227165047.GA19254@intevation.de> Hi Russell, On Mon, Dec 27, 2004 at 05:31:34PM +0100, cvs at intevation.de wrote: > Index: ChangeLog > =================================================================== > RCS file: /thubanrepository/thuban/ChangeLog,v > retrieving revision 1.749 > retrieving revision 1.750 > diff -u -d -r1.749 -r1.750 > --- ChangeLog 27 Dec 2004 09:09:01 -0000 1.749 > +++ ChangeLog 27 Dec 2004 16:31:32 -0000 1.750 > @@ -1,3 +1,7 @@ > +2004-12-27 Russell Nelson > + > + * Middle button pans > + it would be nice to have a more verbose ChangeLog entry. As an example I just committed a change for this. The idea is to have ChangeLog be a nice first choice to scan for changes in e.g. a certain method. Also it makes ourself think very well about a change when forced to write down details :-) Usually we also then add the text added in Changelog as CVS commit log for the actual committed files. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From nelson at crynwr.com Mon Dec 27 17:54:28 2004 From: nelson at crynwr.com (Russell Nelson) Date: Mon, 27 Dec 2004 11:54:28 -0500 Subject: [Thuban-devel] russell: thuban ChangeLog,1.749,1.750 In-Reply-To: <20041227165047.GA19254@intevation.de> References: <20041227163134.F09F6102BFD@lists.intevation.de> <20041227165047.GA19254@intevation.de> Message-ID: <16848.15940.929769.294883@desk.crynwr.com> Jan-Oliver Wagner writes: > it would be nice to have a more verbose ChangeLog entry. > As an example I just committed a change for this. Thanks! > The idea is to have ChangeLog be a nice first choice to scan > for changes in e.g. a certain method. Ahhh, I see. Okay, will do. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From cvs at intevation.de Mon Dec 27 18:00:17 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 18:00:17 +0100 (CET) Subject: bernhard: thuban ChangeLog,1.751,1.752 Message-ID: <20041227170017.04A68102BFD@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv1044 Modified Files: ChangeLog Log Message: svgexport 1.0.0cvs: Fixed label export. * Extensions/svgexport/test/test_svgmapwriter.py: class TestSVGRenderer(): New class; new test test_label_font(). * Extensions/svgexport/svgmapwriter.py (SVGRenderer.label_font()): initialised Font size with self.factor now, makes test_label_font happy. * Extensions/svgexport/TODO: crossed out fixed label export item. Added item for options. * Extensions/svgexport/__init__.py: Bumped version to 1.0.0cvs. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.751 retrieving revision 1.752 diff -u -d -r1.751 -r1.752 --- ChangeLog 27 Dec 2004 16:47:51 -0000 1.751 +++ ChangeLog 27 Dec 2004 17:00:14 -0000 1.752 @@ -1,3 +1,19 @@ +2004-12-27 Bernhard Reiter + + svgexport 1.0.0cvs: Fixed label export. + + * Extensions/svgexport/test/test_svgmapwriter.py: + class TestSVGRenderer(): New class; new test test_label_font(). + + * Extensions/svgexport/svgmapwriter.py + (SVGRenderer.label_font()): initialised Font size with self.factor now, + makes test_label_font happy. + + * Extensions/svgexport/TODO: crossed out fixed label export item. + Added item for options. + + * Extensions/svgexport/__init__.py: Bumped version to 1.0.0cvs. + 2004-12-27 Russell Nelson Middle mouse button pans. From cvs at intevation.de Mon Dec 27 18:00:17 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 18:00:17 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport TODO, 1.4, 1.5 __init__.py, 1.7, 1.8 svgmapwriter.py, 1.15, 1.16 Message-ID: <20041227170017.0DF4D102C00@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport In directory doto:/tmp/cvs-serv1044/Extensions/svgexport Modified Files: TODO __init__.py svgmapwriter.py Log Message: svgexport 1.0.0cvs: Fixed label export. * Extensions/svgexport/test/test_svgmapwriter.py: class TestSVGRenderer(): New class; new test test_label_font(). * Extensions/svgexport/svgmapwriter.py (SVGRenderer.label_font()): initialised Font size with self.factor now, makes test_label_font happy. * Extensions/svgexport/TODO: crossed out fixed label export item. Added item for options. * Extensions/svgexport/__init__.py: Bumped version to 1.0.0cvs. Index: TODO =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/TODO,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TODO 20 Dec 2004 10:08:58 -0000 1.4 +++ TODO 27 Dec 2004 17:00:14 -0000 1.5 @@ -2,7 +2,6 @@ For 1.0.1: -* Enable label export. * Enable Raster file export. For 1.0.x, x>1: @@ -30,3 +29,5 @@ which also asks for a command line to run after each "save". The command line can be used to run something like "skencil-remote --updated-thubanmapsvgfile %s" + +* Think about adding preferences or options , e.g.: ignore the line Width. Index: __init__.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/__init__.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- __init__.py 18 Dec 2004 02:36:59 -0000 1.7 +++ __init__.py 27 Dec 2004 17:00:14 -0000 1.8 @@ -24,7 +24,7 @@ ext_registry.add(ExtensionDesc( name = 'SVG Export', - version = '1.0.0', + version = '1.0.0cvs', authors= [ 'Markus Rechtien', 'Bernhard Reiter' ], copyright = '2004 Intevation GmbH', desc = _("Export the current map and legend in Thuban-map-SVG format."))) Index: svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- svgmapwriter.py 20 Dec 2004 10:08:58 -0000 1.15 +++ svgmapwriter.py 27 Dec 2004 17:00:15 -0000 1.16 @@ -189,8 +189,12 @@ return Point(x, y) def label_font(self): - """Return the font object for the label layer""" - return Font() + """Return the font object for the label layer. + + As we scale stuff, the fontsize also needs to be scaled.""" + if verbose>1: + log("label_font() called.\n") + return Font(fsize=12*self.factor) def tools_for_property(self, prop): """Return a pen/brush tuple build from a property object.""" From cvs at intevation.de Mon Dec 27 18:00:17 2004 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 27 Dec 2004 18:00:17 +0100 (CET) Subject: bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.18, 1.19 Message-ID: <20041227170017.15AB7102C02@lists.intevation.de> Author: bernhard Update of /thubanrepository/thuban/Extensions/svgexport/test In directory doto:/tmp/cvs-serv1044/Extensions/svgexport/test Modified Files: test_svgmapwriter.py Log Message: svgexport 1.0.0cvs: Fixed label export. * Extensions/svgexport/test/test_svgmapwriter.py: class TestSVGRenderer(): New class; new test test_label_font(). * Extensions/svgexport/svgmapwriter.py (SVGRenderer.label_font()): initialised Font size with self.factor now, makes test_label_font happy. * Extensions/svgexport/TODO: crossed out fixed label export item. Added item for options. * Extensions/svgexport/__init__.py: Bumped version to 1.0.0cvs. Index: test_svgmapwriter.py =================================================================== RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- test_svgmapwriter.py 19 Dec 2004 10:14:38 -0000 1.18 +++ test_svgmapwriter.py 27 Dec 2004 17:00:15 -0000 1.19 @@ -354,10 +354,24 @@ self.assertRaises(SVGMapWriterError, renderer.RenderMap, None, None) +class TestSVGRenderer(BaseTestWithDC): + """Test methods of SVGRenderer.""" + + def test_label_font(self): + """Test that label_font used the self.factor.""" + mockmap = Map("mock title") + self.to_destroy.append(mockmap) + renderer = SVGRenderer(self.dc, mockmap, + scale=1.0, offset=(0,0), region=(0,0,30000,30000)) + #print renderer.factor + self.assertEqual( renderer.label_font().GetPointSize(), + 12*renderer.factor + ) + class Testobjectexport(BaseTestWithDC): def test_transparent_polygon(self): - """ Create layer with non-filled polygon and test svg rendering.""" + """Create layer with non-filled polygon and test svg rendering.""" data = ('\n' ' \n' From nelson at crynwr.com Mon Dec 27 19:34:26 2004 From: nelson at crynwr.com (Russell Nelson) Date: Mon, 27 Dec 2004 13:34:26 -0500 Subject: LatLongBoundingBox? In-Reply-To: <20041227164438.GN1497@intevation.de> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> <16843.16058.801955.127358@desk.crynwr.com> <20041227144645.GK1497@intevation.de> <16848.13330.621698.451830@desk.crynwr.com> <20041227164438.GN1497@intevation.de> Message-ID: <16848.21938.224824.88473@desk.crynwr.com> Bernhard Reiter writes: > > > Another idea to work around the problems would to be to have an > > > outline mode that always makes at least one red dot when a layer is > > > outside the current view being to small or so. > > > Otherwise it mark the bounding box. > > > > IMHO, if you have a layer which has been selected to be visible, and > > its LatLonBoundingBox does not overlap the current map view, the > > corner or edge closest to the data should say "LAYERNAME is over > > there" with an arrow. If you don't want to see that, and you *meant* > > for the layer to be off the map, turn off its visibility. > > This is something similiar to the red dot idea I outlined above. I didn't quite understand the details of it. Where is this red dot drawn? I have another question: I can see how this would be good for a GIS newbie (that would be ... me). How often does a GIS professional run into the "lost layer" problem? I'm trying to figure out if this is a feature that is useful for everyone, or only useful for beginners. Useful for beginners is good, but if it's not useful for experts, then it's just wasted cycles and a cluttered display. > I think it is a good idea to have such a target tracking mode > in one or the other way. Using a red color in a frame could help us > to signal the other potential situations, too. > Like when you are too much into a layer to actually see a feature, > then the hole frame could be red. How about using a set of "location" icons in the layer list, then? You could have a square box indicating the view. You could have a squiggle indicating the layer data. The icons would show where each layer data is relative to the view. Argh, I can't draw this in ASCII. I'll quick whip up a set of pictures: http://russnelson.com/thuban-icons/ It would be relatively simple to throw one of these icons into the list of layers, indicating the location of the layer extents relative to the current view. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bernhard at intevation.de Mon Dec 27 19:51:38 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 27 Dec 2004 19:51:38 +0100 Subject: LatLongBoundingBox? In-Reply-To: <16848.21938.224824.88473@desk.crynwr.com> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> <16843.16058.801955.127358@desk.crynwr.com> <20041227144645.GK1497@intevation.de> <16848.13330.621698.451830@desk.crynwr.com> <20041227164438.GN1497@intevation.de> <16848.21938.224824.88473@desk.crynwr.com> Message-ID: <20041227185138.GS1497@intevation.de> On Mon, Dec 27, 2004 at 01:34:26PM -0500, Russell Nelson wrote: > Bernhard Reiter writes: > > > > Another idea to work around the problems would to be to have an > > > > outline mode that always makes at least one red dot when a layer is > > > > outside the current view being to small or so. > > > > Otherwise it mark the bounding box. > > > > > > IMHO, if you have a layer which has been selected to be visible, and > > > its LatLonBoundingBox does not overlap the current map view, the > > > corner or edge closest to the data should say "LAYERNAME is over > > > there" with an arrow. If you don't want to see that, and you *meant* > > > for the layer to be off the map, turn off its visibility. > > > > This is something similiar to the red dot idea I outlined above. > > I didn't quite understand the details of it. Where is this red dot > drawn? It is not always a "dot", but red color. Ascii art, indicating red color as "r" ______ | | | | | | ------ layer inside the view ______ | | | rrr | | r r | | rrr | | | ------ a few layers very very small only give dots: ______ | r | | r | | r | ------ a layer to the east and one to the north: __rr__ | | r | | | ------ too deep inside of one layer: rrrrrr r r r r r r rrrrrr > I have another question: I can see how this would be good for a GIS > newbie (that would be ... me). How often does a GIS professional run > into the "lost layer" problem? I'm trying to figure out if this is a > feature that is useful for everyone, or only useful for beginners. > Useful for beginners is good, but if it's not useful for experts, then > it's just wasted cycles and a cluttered display. I guess a GIS professional will run into it less often as usually the working area is known well and set up nicely so you cannot go wrong. On the other hand, we do want to make this tool easy to use as it is targeted as towards occasional users and power users alike. > > I think it is a good idea to have such a target tracking mode > > in one or the other way. Using a red color in a frame could help us > > to signal the other potential situations, too. > > Like when you are too much into a layer to actually see a feature, > > then the hole frame could be red. > > How about using a set of "location" icons in the layer list, then? A very good idea, to. > You could have a square box indicating the view. You could have a > squiggle indicating the layer data. The icons would show where each > layer data is relative to the view. Argh, I can't draw this in > ASCII. I'll quick whip up a set of pictures: > > http://russnelson.com/thuban-icons/ Nice. > It would be relatively simple to throw one of these icons into the > list of layers, indicating the location of the layer extents relative > to the current view. Yes it might be less intrusive then the color idea but also giving less information when you see two layers which are close to each other. -------------- 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/20041227/73b8dbbb/attachment.bin From nelson at crynwr.com Mon Dec 27 20:11:14 2004 From: nelson at crynwr.com (Russell Nelson) Date: Mon, 27 Dec 2004 14:11:14 -0500 Subject: a question about my mapviewer program Message-ID: <16848.24146.258982.334379@desk.crynwr.com> I've been working on a nifty neato GIS application called 'mapviewer'. Its main purpose is to let you view Terraserver-usa.com map tiles. Terraserver has a documented interface that lets you fetch 200x200 pixel tiles of UTM maps at varying resolutionas and themes: .25 meters per pixel for the most detailed color photographs (only in selected areas), doubling up to 256 meters per pixel. mapviewer presents those tiles to you as a seamless scrollable UTM map. It fetches tiles from a cache or from Terraserver on-demand. The net effect is a base raster layer which covers an entire UTM zone. If you're running Fedora, everything you need is already installed. If anybody wants to give it a try, I'll do a release of the current code. Right now, it mostly just displays maps. However, I'm starting to add code to edit shapefiles. I have it displaying a line, which you can save to a file and load from a file. You can add a point to the end of it, and delete that point. Here's my question: Before I run off a create my own shapefile viewer and editor, would I do better to 1) create a Terraserver layer for Thuban, and 2) improve Thuban's layer editor extension? The reasons why I might not want to are 1) Thuban depends on a bunch of libraries whereas mapviewer runs on Fedora without any dependencies, 2) Thuban uses wxWindows whereas mapviewer uses (and I am more familiar with) GTK2, and 3) I'm not sure that the Thuban maintainers are interested in being able to edit layers. Is ANYBODY else besides myself interested in using Terraserver maps? In being able to edit layers? -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bernhard at intevation.de Mon Dec 27 20:37:38 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 27 Dec 2004 20:37:38 +0100 Subject: a question about my mapviewer program In-Reply-To: <16848.24146.258982.334379@desk.crynwr.com> References: <16848.24146.258982.334379@desk.crynwr.com> Message-ID: <20041227193738.GT1497@intevation.de> On Mon, Dec 27, 2004 at 02:11:14PM -0500, Russell Nelson wrote: > mapviewer presents those tiles to you as a seamless scrollable UTM > map. It fetches tiles from a cache or from Terraserver on-demand. > The net effect is a base raster layer which covers an entire UTM zone. > > If you're running Fedora, everything you need is already installed. > If anybody wants to give it a try, I'll do a release of the current > code. For the sake of the FreeGIS community, a release certainly is nice or is there CVS access? ;) > Right now, it mostly just displays maps. However, I'm starting to add > code to edit shapefiles. I have it displaying a line, which you can > save to a file and load from a file. You can add a point to the end > of it, and delete that point. > > > Here's my question: Before I run off a create my own shapefile viewer > and editor, would I do better to 1) create a Terraserver layer for > Thuban, and 2) improve Thuban's layer editor extension? The reasons > why I might not want to are 1) Thuban depends on a bunch of libraries > whereas mapviewer runs on Fedora without any dependencies, 2) Thuban > uses wxWindows whereas mapviewer uses (and I am more familiar with) > GTK2, and 3) I'm not sure that the Thuban maintainers are interested > in being able to edit layers. > > Is ANYBODY else besides myself interested in using Terraserver maps? > In being able to edit layers? 3) The Thuban maintainer are interested in editing layers. We even have an experimental drawshape extension, also see the road map: http://thuban.intevation.org/roadmap.html 2) I do not think that wxWidgets gets too much in the way, the big advantage is its use of native widget sets on Mac OS and Windows. Personally I believe in components that only need to be learned once by the user but can be taken to each platform that the user wants. 1) Usually dependencies are handled by packaging system, I have heard fedora has a nice one. We made Thuban available on it, so usually this is not a hassle for users. On the technological point of view: depending on well developed libraries makes your application more robust. I would do it with a Thuban layer. The speed on how you can do an implementation depends a bit on how fast Thuban is getting a buffering concept and a nice editing concept. Currently Thuban's raster capabilities are not that developed. Bernhard R. -------------- 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/20041227/d71f9a1c/attachment.bin From Chris.Barker at noaa.gov Mon Dec 27 20:46:01 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Mon, 27 Dec 2004 11:46:01 -0800 Subject: a question about my mapviewer program In-Reply-To: <16848.24146.258982.334379@desk.crynwr.com> References: <16848.24146.258982.334379@desk.crynwr.com> Message-ID: <41D06679.2080109@noaa.gov> Russel, Russell Nelson wrote: > I've been working on a nifty neato GIS application called 'mapviewer'. Very cool! > Is ANYBODY else besides myself interested in using Terraserver maps? Maybe. > In being able to edit layers? Absolutely! I would love to see you do this as an extension to Thuban, rather than a separate app. One reason is that I personally prefer wxPython to GTK anyway (as I need Windows and OS-X support, which I think is better with wxPython), but the main issue is that I want to do something similar anyway. I'm hoping to be able to use Thuban as the basis for a special purpose mapping program. What I need to do is be able to load various base maps, generally either topos or nautical charts, and be able to draw stuff on top of them, like lines and polygons, etc. I also need to be able to load geo-data in custom vector formats. It looks like Thuban is already well set up for loading the various data I need, so now I need a way to create and edit vector data in it, and that sounds like just what you want to do to. I suppose I could take what you've done and work from that, (wxPython vs., GTK aside), but it seems to me that Thuban already has solved a lot of problems with file formats, projections, fast rendering of vector data, etc, so why not use it? By the way, I have written a little mapping engine myself, for wxPython, but it doesn't support raster data. Rather than adding that support, I'm hoping to adapt Thuban to my needs. Mine is called FloatCanvas (I use it for other data that aren't maps as well) it is now part of the wxPython demo/lib, or you can get it here: http://home.comcast.net/~chrishbarker/FloatCanvas -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nelson at crynwr.com Tue Dec 28 00:03:52 2004 From: nelson at crynwr.com (Russell Nelson) Date: Mon, 27 Dec 2004 18:03:52 -0500 Subject: legend size?? Message-ID: <16848.38104.909172.908035@desk.crynwr.com> Could somebody run this test program for me? #!/usr/bin/python from wxPython.wx import * dc = wxMemoryDC() font = wxFont(10, wxSWISS, wxNORMAL, wxNORMAL) dc.SetFont(font) textwidth, textheight = dc.GetTextExtent("%d"%0) print textwidth, textheight I'm getting this: ** (t.py:19052): CRITICAL **: file pango-layout.c: line 268 (pango_layout_new): assertion `context != NULL' failed ** (t.py:19052): CRITICAL **: file pango-layout.c: line 544 (pango_layout_set_font_description): assertion `layout != NULL' failed ** (t.py:19052): CRITICAL **: file pango-layout.c: line 787 (pango_layout_set_text): assertion `layout != NULL' failed ** (t.py:19052): CRITICAL **: file pango-layout.c: line 2124 (pango_layout_get_extents): assertion `layout != NULL' failed (t.py:19052): GLib-GObject-CRITICAL **: file gobject.c: line 1579 (g_object_unref): assertion `G_IS_OBJECT (object)' failed 7160 7159 These are the same asserts that Marcin noted: http://www.intevation.de/pipermail/thuban-list/2004-August/000490.html I think there's a problem with wxGTK and/or wxGTK2 on Fedora Core 2. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From jan at intevation.de Tue Dec 28 01:01:59 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Tue, 28 Dec 2004 01:01:59 +0100 Subject: [Thuban-devel] legend size?? In-Reply-To: <16848.38104.909172.908035@desk.crynwr.com> References: <16848.38104.909172.908035@desk.crynwr.com> Message-ID: <20041228000159.GA20721@intevation.de> On Mon, Dec 27, 2004 at 06:03:52PM -0500, Russell Nelson wrote: > Could somebody run this test program for me? the result here (Debian Sarge) with wxPython 2.4 is: 8 16 which looks quite OK. > I think there's a problem with wxGTK and/or wxGTK2 on Fedora Core 2. I do not have a Fedora at hand. But maybe I can test after new year. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From nelson at crynwr.com Tue Dec 28 06:57:15 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 28 Dec 2004 00:57:15 -0500 Subject: [Thuban-devel] legend size?? In-Reply-To: <20041228000159.GA20721@intevation.de> References: <16848.38104.909172.908035@desk.crynwr.com> <20041228000159.GA20721@intevation.de> Message-ID: <16848.62907.465500.652213@desk.crynwr.com> Jan-Oliver Wagner writes: > I do not have a Fedora at hand. But maybe I can test after new year. Thanks. I was looking at changing the map scale to say "No map projection" if there is no map projection. More helpful than leaving it blank. But I couldn't render fonts there because the fontextents is really really wrong. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From bernhard at intevation.de Tue Dec 28 11:44:14 2004 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 28 Dec 2004 11:44:14 +0100 Subject: a question about my mapviewer program In-Reply-To: <41D06679.2080109@noaa.gov> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> Message-ID: <20041228104414.GB3637@intevation.de> On Mon, Dec 27, 2004 at 11:46:01AM -0800, Chris Barker wrote: > Russell Nelson wrote: > >In being able to edit layers? > Absolutely! > I'm hoping to be able to use Thuban as the basis for a special purpose > mapping program. What I need to do is be able to load various base maps, > generally either topos or nautical charts, and be able to draw stuff on > top of them, like lines and polygons, etc. I also need to be able to > load geo-data in custom vector formats. It looks like Thuban is already > well set up for loading the various data I need, so now I need a way to > create and edit vector data in it, and that sounds like just what you > want to do to. The recent work to support ogr layers by Nina opens up many formats for Thuban. > I suppose I could take what you've done and work from that, (wxPython > vs., GTK aside), but it seems to me that Thuban already has solved a lot > of problems with file formats, projections, fast rendering of vector > data, etc, so why not use it? Especially if projection come into the game, a simple GIS application is getting much more complicated. > By the way, I have written a little mapping engine myself, for wxPython, > but it doesn't support raster data. Rather than adding that support, I'm > hoping to adapt Thuban to my needs. Mine is called FloatCanvas (I use it > for other data that aren't maps as well) it is now part of the wxPython > demo/lib, or you can get it here: > > http://home.comcast.net/~chrishbarker/FloatCanvas Is it Free SoftwarE? I did not find any statements on the page or in the file in the archive. If not I suggest to make it Free Software and also submit it to www.freegis.org. Another wish: add a screenshot to the page. ;) Best, Bernhard -------------- 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/20041228/b715938f/attachment.bin From Chris.Barker at noaa.gov Tue Dec 28 19:17:19 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Tue, 28 Dec 2004 10:17:19 -0800 Subject: a question about my mapviewer program In-Reply-To: <20041228104414.GB3637@intevation.de> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> Message-ID: <41D1A32F.5080907@noaa.gov> Bernhard Reiter wrote: > On Mon, Dec 27, 2004 at 11:46:01AM -0800, Chris Barker wrote: > The recent work to support ogr layers by Nina opens up many formats > for Thuban. That sounds great, but what is OGR? I've been following this list for a while, but have not had a chance to really dig into the code yet. Hopefully I can do that starting in February. > Especially if projection come into the game, a simple GIS application > is getting much more complicated. Exactly. I have no need for a variety of projections with vector data, but with raster data, I need to match the projection already used. I'm really hoping I can use Thuban and not have to deal with that myself! >>By the way, I have written a little mapping engine myself, for wxPython, >>but it doesn't support raster data. Rather than adding that support, I'm >>hoping to adapt Thuban to my needs. Mine is called FloatCanvas (I use it >>for other data that aren't maps as well) it is now part of the wxPython >>demo/lib, or you can get it here: >> >>http://home.comcast.net/~chrishbarker/FloatCanvas > > Is it Free Software? I did not find any statements on the page > or in the file in the archive. Yes. In the docstring at the top of floatcanvas/__init__.py, it says: """ Copyright: Christopher Barker License: Same as the version of wxPython you are using it with. """ the wxPython license is the wxWidgets license which is almost the LGPL. I did it that way because it's useless without wxPython, so it made sense for it to have exactly the same restrictions and freedoms. Also, IANAL, so I don't want to try to figure out what other license to pick. Also, it is now distributed with wxPython, so it really should have the same license. Clearly, I need to put that info in a more obvious/standard place. > If not I suggest to make it Free Software > and also submit it to www.freegis.org. hmmm. I wonder if I want the additional users or not. I do, because they'd help make it better, but I don't have much time to work on it. Also, it really is just a component now, it's not useful by itself. > Another wish: add a screenshot to the page. ;) I really should do that, but I'm about to drop that ISP account anyway, so I'm not sure there's much point. Did you check it out enough to have any feedback? Now that I've brought it up, I have a few questions I'd like some feedback on. Not too long after I started developing my FloatCanvas, I discovered Thuban (in its earlier stages). My first thought was that I should dump what I'm doing and just use Thuban. However, my early impression of the code was disappointing, but only because I was hoping to find what I was building, i.e. my own vision, which is really a component, rather than an application. I need a way to easily build small custom applications that view and manipulate geo-referenced data (and other non-geo data in arbitrary floating point coords). That's what FloatCanvas is designed to provide, a component that makes it easy to display and interact with floating point coordinate data, allowing zooming, panning, etc, without having to re-write all that natural-coord to pixel code all the time. It accomplishes this goal pretty well, but for ease of coding and performance considerations, it only does a simple flat-earth projection. You can plug other projections in, but they have to involve only a simple multiplication scaling of point data (the same for all points), so it's not the least bit flexible. What I do have now, however, is a wxWindow that you can simply do things like: Poly = FloatCanvas.AddPolygon(Points, FillColor="Red", LineColor="Blue") and get a polygon on the screen that can be zoomed, panned, etc. You can then do: Poly.Bind(FloatCanvas.EVT_FC_LEFT_DOWN, MyCallback) and MyCallback will get called when the user clicks on the polygon. Where the polygon coordinates came from and how they are stored it files, etc, is all a separate problem, and left to the user. So far, I've used if for a small number of very specialized small data viewers. I do have a need for some more complex apps, so I'm looking at other options again. There's a lot of details, but that's the gist of it. I was hoping that I could pull the drawing and interacting component out of Thuban, and be able to use it in a similar way. What it looked like to me (and this is from looking at the code for only a hour or so) is that Thuban was designed from the beginning as a whole application with a particular set of needs, rather than as a set of individual components. The result is that it looked to me that it would be quite difficult to pull out the components I need and use them to build my own specialized app. For example, it seems very tied to shape files. Am I correct in this analysis? However, I may well have fallen into the common trap that any substantial body of someone else's code always looks more complex then your own, so it seemed easier to just keep working on mine than to figure out Thuban. Perhaps my impression of incompatible design was really just a different design than mine, and therefore would take some effort to figure out. However, as I start to think about adding support for projected raster data, I realize that the learning curve is probably well worth it! So, here's a summary of a couple custom apps I want to build: 1) A custom mapping app that lets me import an existing raster map (most likely a nautical chart), and draw lines, polygons and text boxes on it, then write it out as an image (PNG, JPEG, whatever) and a PDF. I also need to import other vector data (points and polygons) in a custom format. 2) A tool that will let me create and manipulate a finite element grid, on top of a raster image and/or a vector map in a custom format. I have code that does the triangulation and all, I just need a way to manipulate points and display the resulting triangles. This all needs to run on OS-X, Windows, and Linux. Do you think Thuban would be a good basis for building these apps? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nelson at crynwr.com Tue Dec 28 20:37:34 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 28 Dec 2004 14:37:34 -0500 Subject: a question about my mapviewer program In-Reply-To: <41D1A32F.5080907@noaa.gov> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> <41D1A32F.5080907@noaa.gov> Message-ID: <16849.46590.696100.983973@desk.crynwr.com> Chris Barker writes: > 1) A custom mapping app that lets me import an existing raster map (most > likely a nautical chart), and draw lines, polygons and text boxes on it, > then write it out as an image (PNG, JPEG, whatever) and a PDF. I also > need to import other vector data (points and polygons) in a custom format. mapviewer currently does lines on a Terraserver layer. However, since my goal is to produce GIS layers, I'm going to want to create shapefiles. Thuban already uses code (libshapefile) that can do that, and the Python bindings are there. So, if I go ahead with the 'merge' idea, I'll be writing code to edit lines. I suspect that you can write an Extension which removes UI elements to turn Thuban into a mapping app specialized for you. > 2) A tool that will let me create and manipulate a finite element grid, > on top of a raster image and/or a vector map in a custom format. I have > code that does the triangulation and all, I just need a way to > manipulate points and display the resulting triangles. Hmmm.... You'll need a specialized layer renderer for that, not to mention an editor. Still, if you're familiar with wxPython, I'd say it's a no-brainer. > Do you think Thuban would be a good basis for building these apps? From nelson at crynwr.com Tue Dec 28 20:46:47 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 28 Dec 2004 14:46:47 -0500 Subject: a question about my mapviewer program In-Reply-To: <20041227193738.GT1497@intevation.de> References: <16848.24146.258982.334379@desk.crynwr.com> <20041227193738.GT1497@intevation.de> Message-ID: <16849.47143.624926.347698@desk.crynwr.com> Bernhard Reiter writes: > For the sake of the FreeGIS community, a release certainly is nice > or is there CVS access? ;) I'll do a release soonest. > 3) > The Thuban maintainer are interested in editing layers. > We even have an experimental drawshape extension, also see > the road map: http://thuban.intevation.org/roadmap.html Excellent. May I suggest that Extensions/drawshape/patch.diff be applied to HEAD? It looks like a useful patch for any Extension which needs to use the right mouse button. > 1) > Usually dependencies are handled by packaging system, I have heard > fedora has a nice one. We made Thuban available on it, so usually > this is not a hassle for users. On the technological point of view: > depending on well developed libraries makes your application more robust. Yesbut ... those libraries don't come with Fedora by default, and aren't published on fedora.us. > Currently Thuban's raster capabilities are not that developed. Yes, but at least they're there, so I can subclass them. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Tue Dec 28 21:07:19 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 28 Dec 2004 15:07:19 -0500 Subject: LatLongBoundingBox? In-Reply-To: <20041227185138.GS1497@intevation.de> References: <16840.49294.945142.290714@desk.crynwr.com> <20041223180333.GC21008@intevation.de> <16843.16058.801955.127358@desk.crynwr.com> <20041227144645.GK1497@intevation.de> <16848.13330.621698.451830@desk.crynwr.com> <20041227164438.GN1497@intevation.de> <16848.21938.224824.88473@desk.crynwr.com> <20041227185138.GS1497@intevation.de> Message-ID: <16849.48375.744714.758887@desk.crynwr.com> I think we both have good ideas. I think that it's more likely that somebody will get "lost" if they have the wrong projection. So I'm going to put my efforts more into making sure that incompatible projections are made more obvious. Bernhard Reiter writes: > On Mon, Dec 27, 2004 at 01:34:26PM -0500, Russell Nelson wrote: > > Bernhard Reiter writes: > > > > > Another idea to work around the problems would to be to have an > > > > > outline mode that always makes at least one red dot when a layer is > > > > > outside the current view being to small or so. > > > > > Otherwise it mark the bounding box. > > > > > > > > IMHO, if you have a layer which has been selected to be visible, and > > > > its LatLonBoundingBox does not overlap the current map view, the > > > > corner or edge closest to the data should say "LAYERNAME is over > > > > there" with an arrow. If you don't want to see that, and you *meant* > > > > for the layer to be off the map, turn off its visibility. > > > > > > This is something similiar to the red dot idea I outlined above. > > > > I didn't quite understand the details of it. Where is this red dot > > drawn? > > It is not always a "dot", but red color. > > Ascii art, indicating red color as "r" > > ______ > | | > | | > | | > ------ > > > layer inside the view > > ______ > | | > | rrr | > | r r | > | rrr | > | | > ------ > > > > a few layers very very small only give dots: > > > ______ > | r | > | r | > | r | > ------ > > > a layer to the east and one to the north: > > __rr__ > | | > r | > | | > ------ > > > too deep inside of one layer: > > rrrrrr > r r > r r > r r > rrrrrr > > > > I have another question: I can see how this would be good for a GIS > > newbie (that would be ... me). How often does a GIS professional run > > into the "lost layer" problem? I'm trying to figure out if this is a > > feature that is useful for everyone, or only useful for beginners. > > Useful for beginners is good, but if it's not useful for experts, then > > it's just wasted cycles and a cluttered display. > > I guess a GIS professional will run into it less often > as usually the working area is known well and set up nicely so you > cannot go wrong. > > On the other hand, we do want to make this tool easy to use > as it is targeted as towards occasional users and power users alike. > > > > I think it is a good idea to have such a target tracking mode > > > in one or the other way. Using a red color in a frame could help us > > > to signal the other potential situations, too. > > > Like when you are too much into a layer to actually see a feature, > > > then the hole frame could be red. > > > > How about using a set of "location" icons in the layer list, then? > > A very good idea, to. > > > You could have a square box indicating the view. You could have a > > squiggle indicating the layer data. The icons would show where each > > layer data is relative to the view. Argh, I can't draw this in > > ASCII. I'll quick whip up a set of pictures: > > > > http://russnelson.com/thuban-icons/ > > Nice. > > > It would be relatively simple to throw one of these icons into the > > list of layers, indicating the location of the layer extents relative > > to the current view. > > Yes it might be less intrusive then the color idea > but also giving less information when you see two layers which are > close to each other. > _______________________________________________ > Thuban-devel mailing list > Thuban-devel at intevation.de > https://intevation.de/mailman/listinfo/thuban-devel From nelson at crynwr.com Tue Dec 28 21:25:09 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 28 Dec 2004 15:25:09 -0500 Subject: missing projection alert Message-ID: <16849.49445.322919.107611@desk.crynwr.com> I propose two patches here. The first patch (legend.py) uses the map legend to let you know that you have no map, or if you have a map, that the map has no projection. Unfortunately, the code doesn't work for me because of some wxGTK/wxGTK2/pango problem on FC2 that causes Text Extents to blow up into the thousands of pixels. The code is in theory correct (haha), and it would be nice if somebody could try it to see if it's helpful to them. Clearly, a subroutine is called for here, but I want to submit a succinct patch to find out if anybody else finds the code worthwhile. I have more confidence that the second patch (mainwindow.py) is correct. If you have a layer whose LatLonBoundingBox returns values which are not legitimate latitude or longitudes, the status bar gets a message asking you to correct the projection. If you load a UTM map, you'll get this message. Index: Thuban/UI/legend.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/legend.py,v retrieving revision 1.37 diff -u -r1.37 legend.py --- Thuban/UI/legend.py 18 Apr 2004 20:37:45 -0000 1.37 +++ Thuban/UI/legend.py 28 Dec 2004 20:11:45 -0000 @@ -739,8 +739,18 @@ dc.SelectObject(bmp) dc.Clear() - if self.canvas.map is not None \ - and self.canvas.map.projection is not None: + + if self.canvas.map is None: + text = _("No map") + l2width, l2height = dc.GetTextExtent(text) + dc.SetTextForeground(wxBLACK) + dc.DrawText(text, (self.width - l2width)/2, (self.height - l2height)/2) + elif self.canvas.map.projection is None: + text = _("No map projection") + l2width, l2height = dc.GetTextExtent(text) + dc.SetTextForeground(wxBLACK) + dc.DrawText(text, (self.width - l2width)/2, (self.height - l2height)/2) + else: # if we are using a projection with geographics coordinates # we need to change the scale value based on where we are Index: Thuban/UI/mainwindow.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/mainwindow.py,v retrieving revision 1.135 diff -u -r1.135 mainwindow.py --- Thuban/UI/mainwindow.py 1 Oct 2004 18:22:32 -0000 1.135 +++ Thuban/UI/mainwindow.py 28 Dec 2004 20:11:45 -0000 @@ -340,6 +340,19 @@ text = "(%10.10g, %10.10g)" % pos else: text = "" + map = self.canvas.Map() + for layer in map.layers: + bbox = layer.LatLongBoundingBox() + if bbox: + left, bottom, right, top = bbox + if not (-180 < left < 180 and + -180 < right < 180 and + -90 < top < 90 and + -90 < bottom < 90): + text = ("Select "+layer.title+" and pick a " + + "projection using Layer/Projection...") + break + self.set_position_text(text) def set_position_text(self, text): From dcalvelo at minag.gob.pe Tue Dec 28 22:40:45 2004 From: dcalvelo at minag.gob.pe (Daniel Calvelo Aros) Date: Tue, 28 Dec 2004 16:40:45 -0500 Subject: OGR [was Re: a question about my mapviewer program] In-Reply-To: <41D1A32F.5080907@noaa.gov> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> <41D1A32F.5080907@noaa.gov> Message-ID: <20041228213624.M24341@minag.gob.pe> From: "Chris Barker" > That sounds great, but what is OGR? I've been following this list > for a while, but have not had a chance to really dig into the code > yet. Hopefully I can do that starting in February. OGR (standing for nothing in particular) is a library written in C by Frank Warmerdam that uses an internal representation and API to access "simple features" (i.e. vector data). It has importers and exporters for a great number of file formats, and also supports spatial databases (and PostGIS in particular). Its raster counterpart is GDAL. For info on both, see http://www.gdal.org. Currently, GRASS, QuantumGIS use it. > -Chris Daniel. From nelson at crynwr.com Wed Dec 29 04:56:52 2004 From: nelson at crynwr.com (Russell Nelson) Date: 29 Dec 2004 03:56:52 -0000 Subject: Experiment&l ? Message-ID: <20041229035652.30162.qmail@desk.crynwr.com> Why is the Experimental menu keyboard shortcut 'L'? Wouldn't 'E' make more sense? Or if some style guide reserves 'E' for 'Edit', then wouldn't 'X' be a better choice? -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Wed Dec 29 05:14:54 2004 From: nelson at crynwr.com (Russell Nelson) Date: Tue, 28 Dec 2004 23:14:54 -0500 Subject: drawshape "deficiencies" Message-ID: <16850.12094.199486.487977@desk.crynwr.com> Hmmm.... I see no reason why drawshape couldn't be extended to handle points and lines. It just needs to understand whether the selected layer consists of points, lines, or polygons, as opposed to its current assumption of polygons. Also (and this is more serious) there needs to be a way to delete the most recent point. The problem is not giving the user a way to do it. The problem is giving them a way to do it without forcing them to read the documentation. For example, we could let Delete remove the most recent point. How are they going to know that they should resort to the keyboard? Perhaps we could make a sub-menu off Experimental/Shape Draw Tool that gives them a mouseable command, but which also tells them that Delete deletes. Or we could let shift-click delete the most recent point? Or maybe we need a generalized Edit menu, since we're adding editing? What if we had a cursor, which was a little circle around the selected point(s)? You could use the arrow to go from point to line segment (circling both points) to point to line segment. If they clicked when only a point was selected, it would move the point. If they clicked when a line segment was selected, it would split the line in half. I have no idea of what is the best user interface for an editor. All suggestions gladly entertained! I think maybe I should prototype it in mapviewer. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From Chris.Barker at noaa.gov Wed Dec 29 19:22:51 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed, 29 Dec 2004 10:22:51 -0800 Subject: OGR [was Re: a question about my mapviewer program] In-Reply-To: <20041228213624.M24341@minag.gob.pe> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> <41D1A32F.5080907@noaa.gov> <20041228213624.M24341@minag.gob.pe> Message-ID: <41D2F5FB.8040705@noaa.gov> Daniel Calvelo Aros wrote: > OGR (standing for nothing in particular) is a library written in C by Frank > Warmerdam that uses an internal representation and API to access "simple > features" (i.e. vector data). It has importers and exporters for a great > number of file formats, and also supports spatial databases (and PostGIS in > particular). Its raster counterpart is GDAL. For info on both, see > http://www.gdal.org. Thanks. Very handy. Does this mean that Thuban does/will have an internal format for generic data that I could then write a python importer for my custom file formats? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From jan at intevation.de Thu Dec 30 16:52:26 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 30 Dec 2004 16:52:26 +0100 Subject: OGR [was Re: a question about my mapviewer program] In-Reply-To: <41D2F5FB.8040705@noaa.gov> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> <41D1A32F.5080907@noaa.gov> <20041228213624.M24341@minag.gob.pe> <41D2F5FB.8040705@noaa.gov> Message-ID: <20041230155226.GB3348@intevation.de> On Wed, Dec 29, 2004 at 10:22:51AM -0800, Chris Barker wrote: > Daniel Calvelo Aros wrote: > >OGR (standing for nothing in particular) is a library written in C by Frank > >Warmerdam that uses an internal representation and API to access "simple > >features" (i.e. vector data). It has importers and exporters for a great > >number of file formats, and also supports spatial databases (and PostGIS in > >particular). Its raster counterpart is GDAL. For info on both, see > >http://www.gdal.org. > > Thanks. Very handy. Does this mean that Thuban does/will have an > internal format for generic data that I could then write a python > importer for my custom file formats? so far we do not really have an internal format in Thuban. Depending on your custom file format, it might be easy to convert it to a standard one. The extension gns2shp does this for example. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/ From Chris.Barker at noaa.gov Thu Dec 30 22:45:31 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Thu, 30 Dec 2004 13:45:31 -0800 Subject: OGR [was Re: a question about my mapviewer program] In-Reply-To: <20041230155226.GB3348@intevation.de> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> <41D1A32F.5080907@noaa.gov> <20041228213624.M24341@minag.gob.pe> <41D2F5FB.8040705@noaa.gov> <20041230155226.GB3348@intevation.de> Message-ID: <41D476FB.1060404@noaa.gov> Jan-Oliver Wagner wrote: > so far we do not really have an internal format in Thuban. That's what I was afraid of > Depending on your custom file format, it might be easy > to convert it to a standard one. The extension gns2shp does > this for example. Do you mean convert my file to a shape file, then use this in Thuban? If so, yes, this probably wouldn't be too hard. However, my goal is to have a custom Lapp that understands the file formats it needs, without any external translation. Indeed, it will need to create files as well, in a custom format. while I'm at it, is there an easy/efficient way to deal with thousands of points with a value associated with them? Clearly I need to spend some time really delving into the code. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nelson at crynwr.com Fri Dec 31 07:13:45 2004 From: nelson at crynwr.com (Russell Nelson) Date: Fri, 31 Dec 2004 01:13:45 -0500 Subject: Status: Layer organisation In-Reply-To: References: <20040415180842.GF1655@finlandia.infodrom.north.de> Message-ID: <16852.60953.215253.270307@desk.crynwr.com> bh at intevation.de (Bernhard Herzog) writes: > Martin Schulze writes: > > 2. If 1. we should see why transparency is currently not supported by > > Thuban > > The reason is simple: It's not easy to do with a wxDC. It would be > possible and probably not even difficult to do a gif-like transparency > (effecively one bit alpha channel, every pixel is either drawn or not). Actually .... There's a step needed prior to this one. If you have multiple raster layers, Thuban should draw them on top of each other. Currently, if I load a map which is 1000 x 1000 pixels, and and another map which is 200 x 200 pixels and overlaps the first, Thuban only displays one of them. There only seems to be code for drawing one background bitmap. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From nelson at crynwr.com Fri Dec 31 07:27:19 2004 From: nelson at crynwr.com (Russell Nelson) Date: Fri, 31 Dec 2004 01:27:19 -0500 Subject: speed of raster repainting Message-ID: <16852.61767.697338.328880@desk.crynwr.com> I notice that raster repainting is fairly slow. The raster needs to be repainted whenever the layer order is changed or layer visibility changes. The time seems to be evenly split between ProjectRasterFile(), and wxImageFromStream(). There is some room for improvement there, I think. ProjectRasterFile seems to be returning a BMP file, whereas it could return a wxImage. That would make the raster repaint twice as fast. Also, it could keep a cache of projected data, so if all the parameters to ProjectRasterFile are the same, it would return the same projected data. Mapviewer only displays UTM maps, so it doesn't have to deal with changing the projection. Still, keeping an internal cache of tiles as pixmaps, ready for drawing, lets me repaint 16 200x200 pixmaps at least ten times per second. -- --My blog is at angry-economist.russnelson.com | Freedom means allowing Crynwr sells support for free software | PGPok | people to do things the 521 Pleasant Valley Rd. | +1 315-323-1241 cell | majority thinks are Potsdam, NY 13676-3213 | +1 212-202-2318 VOIP | stupid, e.g. take drugs. From jan at intevation.de Fri Dec 31 10:19:21 2004 From: jan at intevation.de (Jan-Oliver Wagner) Date: Fri, 31 Dec 2004 10:19:21 +0100 Subject: OGR [was Re: a question about my mapviewer program] In-Reply-To: <41D476FB.1060404@noaa.gov> References: <16848.24146.258982.334379@desk.crynwr.com> <41D06679.2080109@noaa.gov> <20041228104414.GB3637@intevation.de> <41D1A32F.5080907@noaa.gov> <20041228213624.M24341@minag.gob.pe> <41D2F5FB.8040705@noaa.gov> <20041230155226.GB3348@intevation.de> <41D476FB.1060404@noaa.gov> Message-ID: <20041231091921.GA25396@intevation.de> On Thu, Dec 30, 2004 at 01:45:31PM -0800, Chris Barker wrote: > Jan-Oliver Wagner wrote: > >Depending on your custom file format, it might be easy > >to convert it to a standard one. The extension gns2shp does > >this for example. > > Do you mean convert my file to a shape file, then use this in Thuban? gns2shp does this indeed. > If so, yes, this probably wouldn't be too hard. However, my goal is to > have a custom Lapp that understands the file formats it needs, without > any external translation. Indeed, it will need to create files as well, > in a custom format. We are in the process to demonstrate the addition of other Layer types via Extensions. The demonstrator is the OGR lib. The idea is to keep the Thuban core at a minimum size. (In fact we should eventually try to refactor PostGIS or GDAL out of Thuban core into Extensions :-) > while I'm at it, is there an easy/efficient way to deal with thousands > of points with a value associated with them? Depends on what you are actally doing. The PIROL project (see http://thuban.intevation.org/download.html#contrib) does work a lot with huge numbers of points. > Clearly I need to spend some time really delving into the code. Any contribution is very welcome. We'll try to answer questions as good as possible. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ FreeGIS http://freegis.org/