From joey at infodrom.org Mon May 2 09:41:25 2005 From: joey at infodrom.org (Martin Schulze) Date: Mon, 2 May 2005 09:41:25 +0200 Subject: Transparent raster images Message-ID: <20050502074125.GP7744@finlandia.infodrom.north.de> Moin, Thuban.UI.renderer contains draw_raster_data() which seems to support an alpha channel and is supposed to support some sort of transparency. How is this supposed to work? In the WMS extension I can order the server to create a GIF or PNG image with a transparent background. I'd like to pass this information to the renderer, but don't know how. Any hint or links to explanations would be appreciated. Regards, Joey -- If nothing changes, everything will remain the same. -- Barne's Law From jan at intevation.de Mon May 2 10:33:23 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 2 May 2005 10:33:23 +0200 Subject: Transparent raster images In-Reply-To: <20050502074125.GP7744@finlandia.infodrom.north.de> References: <20050502074125.GP7744@finlandia.infodrom.north.de> Message-ID: <20050502083323.GA4211@intevation.de> On Mon, May 02, 2005 at 09:41:25AM +0200, Martin Schulze wrote: > Thuban.UI.renderer contains draw_raster_data() which seems to support > an alpha channel and is supposed to support some sort of transparency. > > How is this supposed to work? In the WMS extension I can order the > server to create a GIF or PNG image with a transparent background. > I'd like to pass this information to the renderer, but don't know > how. Any hint or links to explanations would be appreciated. Jonathan worked on this. I haven't had a close look at the stuff yet, but maybe you can learn from the GDAL stuff. Else, Jonathan might give a couple of hints. Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From jan at intevation.de Mon May 2 10:37:16 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 2 May 2005 10:37:16 +0200 Subject: still wxproj compilation problems In-Reply-To: <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> Message-ID: <20050502083716.GA4235@intevation.de> On Fri, Apr 29, 2005 at 12:59:06PM +0200, Moritz Lennert wrote: > On Fri, April 29, 2005 12:07, Bernhard Herzog said: > > "Moritz Lennert" writes: > > > >> Using a freshly checkout cvs tree, I have the same problem that Jan reported > >> in http://www.intevation.de/pipermail/thuban-devel/2005-April/001398.html, > >> and > >> that Bernard had apparently fixed: > > [...] > >> Just as Jan I am running Debian sarge, with wx2.4. > > > > Have you run setup.py with the --use-wx-python-swig-hack option? > > I used dpkg-buildpackage without changing anything in the debian directory. then you are using the Thuban 1.0-series original debian source package? The option mentioned above is quite new. You must either change debian/rules or build Thuban directly from CVS. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From mlennert at club.worldonline.be Mon May 2 13:21:31 2005 From: mlennert at club.worldonline.be (Moritz Lennert) Date: Mon, 2 May 2005 13:21:31 +0200 (CEST) Subject: still wxproj compilation problems In-Reply-To: <20050502083716.GA4235@intevation.de> References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> Message-ID: <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> On Mon, May 2, 2005 10:37, Jan-Oliver Wagner said: > On Fri, Apr 29, 2005 at 12:59:06PM +0200, Moritz Lennert wrote: >> On Fri, April 29, 2005 12:07, Bernhard Herzog said: >> > "Moritz Lennert" writes: >> > >> >> Using a freshly checkout cvs tree, I have the same problem that Jan >> reported >> >> in >> http://www.intevation.de/pipermail/thuban-devel/2005-April/001398.html, >> >> and >> >> that Bernard had apparently fixed: >> > [...] >> >> Just as Jan I am running Debian sarge, with wx2.4. >> > >> > Have you run setup.py with the --use-wx-python-swig-hack option? >> >> I used dpkg-buildpackage without changing anything in the debian directory. > > then you are using the Thuban 1.0-series original debian source package? > > The option mentioned above is quite new. You must either change > debian/rules or build Thuban directly from CVS. That means the debian/rules file in the CVS HEAD branch is not up to date ? What do I have to change in the rules file to make it work ? Thank you ! Moritz From joey at infodrom.org Mon May 2 14:34:34 2005 From: joey at infodrom.org (Martin Schulze) Date: Mon, 2 May 2005 14:34:34 +0200 Subject: still wxproj compilation problems In-Reply-To: <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> Message-ID: <20050502123434.GS7744@finlandia.infodrom.north.de> Moritz Lennert wrote: > >> >> Using a freshly checkout cvs tree, I have the same problem that Jan > >> reported > >> >> in > >> http://www.intevation.de/pipermail/thuban-devel/2005-April/001398.html, > >> >> and > >> >> that Bernard had apparently fixed: > >> > [...] > >> >> Just as Jan I am running Debian sarge, with wx2.4. > >> > > >> > Have you run setup.py with the --use-wx-python-swig-hack option? > >> > >> I used dpkg-buildpackage without changing anything in the debian directory. > > > > then you are using the Thuban 1.0-series original debian source package? > > > > The option mentioned above is quite new. You must either change > > debian/rules or build Thuban directly from CVS. > > That means the debian/rules file in the CVS HEAD branch is not up to date ? > What do I have to change in the rules file to make it work ? The attached patch should do (untested, though). Regards, Joey -- If nothing changes, everything will remain the same. -- Barne's Law -------------- next part -------------- Index: rules =================================================================== RCS file: /thubanrepository/thuban/debian/rules,v retrieving revision 1.3 diff -u -p -r1.3 rules --- rules 8 Mar 2004 09:42:50 -0000 1.3 +++ rules 2 May 2005 12:33:53 -0000 @@ -42,7 +42,8 @@ install: build dh_clean dh_installdirs - python setup.py install --prefix=/usr --no-compile --root=`pwd`/debian/thuban + python setup.py install --prefix=/usr --no-compile --root=`pwd`/debian/thuban \ + --use-wx-python-swig-hack ln -fs ../lib/thuban/thuban.py `pwd`/debian/thuban/usr/bin/thuban cd debian/thuban; patch -p1 < ../bitmappath.patch; cd ../../ From jonathan.coles at gmail.com Mon May 2 14:37:36 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Mon, 2 May 2005 08:37:36 -0400 Subject: Transparent raster images In-Reply-To: <20050502074125.GP7744@finlandia.infodrom.north.de> References: <20050502074125.GP7744@finlandia.infodrom.north.de> Message-ID: <39ed160a05050205372ed93a2f@mail.gmail.com> 2005/5/2, Martin Schulze : > Thuban.UI.renderer contains draw_raster_data() which seems to support > an alpha channel and is supposed to support some sort of transparency. > > How is this supposed to work? In the WMS extension I can order the > server to create a GIF or PNG image with a transparent background. > I'd like to pass this information to the renderer, but don't know > how. Any hint or links to explanations would be appreciated. i just tested a hack which used a png image with transparency and it worked. note that wxWidgets only supports transparency in png images. use the following as an example for use where ever you are going to call draw_raster_data(). # get the raw png data (replace this with your preferred method) f = open("sample.png") png_data = f.read(-1) # read whole file # img_data is a tuple of [raw_image_data, mask_data, alpha_data] # mask_data and alpha_data should be None because the alpha data is stored # in the png data img_data = [png_data, None, None] # width and height are the dimensions of the image data = (width, height, img_data) self.draw_raster_data(layer, 0, 0, data, format="PNG") adjusting the opacity of the layer when using a format other than "RAW" will only work if alpha_data is not None. Since the alpha data is stored in the png file the layer's opacity property will not currently affect the drawn opacity. This is simple to fix. i will add a patch soon. in addition, i'm going to replace the layer parameter with just the opacity level. --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From jonathan.coles at gmail.com Mon May 2 14:58:13 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Mon, 2 May 2005 08:58:13 -0400 Subject: Raster layer opacity In-Reply-To: References: <1111592504.14081.14.camel@localhost.localdomain> Message-ID: <39ed160a0505020558ab7ea0c@mail.gmail.com> 2005/4/29, Bernhard Herzog : > > Sorry for getting back to this so late, but I don't have as much time > for Thuban as I would like. > > I don't see why you need to add the layer itself. The opacity value > would have sufficed. So far the draw_raster_data implementations had no > need to know about layers. They only needed to know about raster data > rendering. I think it should stay that way. agreed. i'll make the changes soon. i will add support for saving the opacity level as well. as a seperate item (something to put in after the release of v1.1) i will move the raster layer rendering code into an extension. i had already done this but then my harddrive broke and i didn't have a backup of my recent changes. i had also begun implementing a more rigorous extensions framework. when i have more to write on this, i'll send another email. have you thought about this aspect at all? --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From mlennert at club.worldonline.be Mon May 2 14:57:48 2005 From: mlennert at club.worldonline.be (Moritz Lennert) Date: Mon, 2 May 2005 14:57:48 +0200 (CEST) Subject: still wxproj compilation problems In-Reply-To: <20050502123434.GS7744@finlandia.infodrom.north.de> References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> <20050502123434.GS7744@finlandia.infodrom.north.de> Message-ID: <37696.164.15.134.161.1115038668.squirrel@vivegnulinux.homelinux.org> On Mon, May 2, 2005 14:34, Martin Schulze said: > Moritz Lennert wrote: >> >> >> Using a freshly checkout cvs tree, I have the same problem that Jan >> >> reported >> >> >> in >> >> http://www.intevation.de/pipermail/thuban-devel/2005-April/001398.html, >> >> >> and >> >> >> that Bernard had apparently fixed: >> >> > [...] >> >> >> Just as Jan I am running Debian sarge, with wx2.4. >> >> > >> >> > Have you run setup.py with the --use-wx-python-swig-hack option? >> >> >> >> I used dpkg-buildpackage without changing anything in the debian >> directory. >> > >> > then you are using the Thuban 1.0-series original debian source package? >> > >> > The option mentioned above is quite new. You must either change >> > debian/rules or build Thuban directly from CVS. >> >> That means the debian/rules file in the CVS HEAD branch is not up to date ? >> What do I have to change in the rules file to make it work ? > > The attached patch should do (untested, though). Nope :-(: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPI C -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -Ilibra ries/shapelib -I/usr/include -Ilibraries/pyshapelib/ -I/usr/lib/wx/include/gtk-2 .4 -I/usr/include/python2.3 -c libraries/thuban/wxproj.cpp -o build/temp.linux-i 686-2.3/libraries/thuban/wxproj.o libraries/thuban/wxproj.cpp:40:34: wx/wxPython/wxPython.h : Aucun fichier ou r?p ertoire de ce type libraries/thuban/wxproj.cpp: Dans function ? bool wxPyConvertSwigPtr(PyObject*, void**, char*) ?: libraries/thuban/wxproj.cpp:62: error: `wxPyCoreAPIPtr' undeclared (first use this function) libraries/thuban/wxproj.cpp:62: error: (Each undeclared identifier is reported only once for each function it appears in.) libraries/thuban/wxproj.cpp:63: error: `wxPyCoreAPI_IMPORT' undeclared (first use this function) libraries/thuban/wxproj.cpp:65: error: `SWIG_GetPtrObj' undeclared (first use this function) error: command 'gcc' failed with exit status 1 Just for info, here's what I have installed: libwxgtk2.4 2.4.2.6 libwxgtk2.4-dev 2.4.2.6 libwxgtk2.4-python 2.4.2.6 libwxgtk2.5.3 2.5.3.2 wxwin2.4-headers 2.4.2.6 libswig1.3.22 1.3.22-5 Moritz From bh at intevation.de Mon May 2 15:21:08 2005 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 02 May 2005 15:21:08 +0200 Subject: still wxproj compilation problems In-Reply-To: <20050502123434.GS7744@finlandia.infodrom.north.de> (Martin Schulze's message of "Mon, 2 May 2005 14:34:34 +0200") References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> <20050502123434.GS7744@finlandia.infodrom.north.de> Message-ID: Martin Schulze writes: > --- rules 8 Mar 2004 09:42:50 -0000 1.3 > +++ rules 2 May 2005 12:33:53 -0000 > @@ -42,7 +42,8 @@ install: build > dh_clean > dh_installdirs > > - python setup.py install --prefix=/usr --no-compile --root=`pwd`/debian/thuban > + python setup.py install --prefix=/usr --no-compile --root=`pwd`/debian/thuban \ > + --use-wx-python-swig-hack The following command probably works better: python setup.py build_ext --use-wx-python-swig-hack \ install --prefix=/usr --no-compile --root=`pwd`/debian/thuban The --use-wx-python-swig-hack has to be given to the build_ext command. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From mlennert at club.worldonline.be Mon May 2 15:42:53 2005 From: mlennert at club.worldonline.be (Moritz Lennert) Date: Mon, 2 May 2005 15:42:53 +0200 (CEST) Subject: still wxproj compilation problems In-Reply-To: References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> <20050502123434.GS7744@finlandia.infodrom.north.de> Message-ID: <38411.164.15.134.161.1115041373.squirrel@vivegnulinux.homelinux.org> On Mon, May 2, 2005 15:21, Bernhard Herzog said: > Martin Schulze writes: > >> --- rules 8 Mar 2004 09:42:50 -0000 1.3 >> +++ rules 2 May 2005 12:33:53 -0000 >> @@ -42,7 +42,8 @@ install: build >> dh_clean >> dh_installdirs >> >> - python setup.py install --prefix=/usr --no-compile >> --root=`pwd`/debian/thuban >> + python setup.py install --prefix=/usr --no-compile >> --root=`pwd`/debian/thuban \ >> + --use-wx-python-swig-hack > > The following command probably works better: > > python setup.py build_ext --use-wx-python-swig-hack \ > install --prefix=/usr --no-compile --root=`pwd`/debian/thuban > > The --use-wx-python-swig-hack has to be given to the build_ext command. and it has to be used in the 'build' command line (line 25), not the 'install' command line (line 45) as was suggested by Joey's patch. Now it works ! Thanks a lot to both of you, Moritz > > > 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 > From jan at intevation.de Mon May 2 16:52:18 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 2 May 2005 16:52:18 +0200 Subject: still wxproj compilation problems In-Reply-To: <38411.164.15.134.161.1115041373.squirrel@vivegnulinux.homelinux.org> References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> <20050502123434.GS7744@finlandia.infodrom.north.de> <38411.164.15.134.161.1115041373.squirrel@vivegnulinux.homelinux.org> Message-ID: <20050502145218.GA5054@intevation.de> On Mon, May 02, 2005 at 03:42:53PM +0200, Moritz Lennert wrote: > and it has to be used in the 'build' command line (line 25), not the 'install' > command line (line 45) as was suggested by Joey's patch. > > Now it works ! can you send the diff for debian/rules which finally worked? Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From jan at intevation.de Mon May 2 16:56:09 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 2 May 2005 16:56:09 +0200 Subject: Raster layer opacity In-Reply-To: <39ed160a0505020558ab7ea0c@mail.gmail.com> References: <1111592504.14081.14.camel@localhost.localdomain> <39ed160a0505020558ab7ea0c@mail.gmail.com> Message-ID: <20050502145609.GB5054@intevation.de> On Mon, May 02, 2005 at 08:58:13AM -0400, Jonathan Coles wrote: > as a seperate item (something to put in after the release of v1.1) i > will move the raster layer rendering code into an extension. i had > already done this but then my harddrive broke and i didn't have a > backup of my recent changes. :-( > i had also begun implementing a more rigorous extensions framework. > when i have more to write on this, i'll send another email. have you > thought about this aspect at all? I would welcome such a approach but never was able to sort my mind about it. Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From jan at intevation.de Mon May 2 17:30:10 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Mon, 2 May 2005 17:30:10 +0200 Subject: Thuban project at wald.intevation.org Message-ID: <20050502153010.GA5810@intevation.de> Hi, at Intevation's new GForge server (1) we added the project Thuban (2). We do not intend to quickly move everything over to wald. Actually, nothing is scheduled at all (we have a working infrastructure). However, personally I started to use the task management of wald. If you find it suitable for yourself you might use it as well. Best Jan (1) http://wald.intevation.org (2) http://wald.intevation.org/projects/thuban/ -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From mlennert at club.worldonline.be Mon May 2 17:34:25 2005 From: mlennert at club.worldonline.be (Moritz Lennert) Date: Mon, 2 May 2005 17:34:25 +0200 (CEST) Subject: still wxproj compilation problems In-Reply-To: <20050502145218.GA5054@intevation.de> References: <42469.164.15.134.161.1114685382.squirrel@vivegnulinux.homelinux.org> <33076.212.87.101.40.1114772346.squirrel@vivegnulinux.homelinux.org> <20050502083716.GA4235@intevation.de> <36155.164.15.134.161.1115032891.squirrel@vivegnulinux.homelinux.org> <20050502123434.GS7744@finlandia.infodrom.north.de> <38411.164.15.134.161.1115041373.squirrel@vivegnulinux.homelinux.org> <20050502145218.GA5054@intevation.de> Message-ID: <40345.164.15.134.161.1115048065.squirrel@vivegnulinux.homelinux.org> On Mon, May 2, 2005 16:52, Jan-Oliver Wagner said: > On Mon, May 02, 2005 at 03:42:53PM +0200, Moritz Lennert wrote: >> and it has to be used in the 'build' command line (line 25), not the >> 'install' >> command line (line 45) as was suggested by Joey's patch. >> >> Now it works ! > > can you send the diff for debian/rules which finally worked? Here it is. Moritz -------------- next part -------------- A non-text attachment was scrubbed... Name: debian_swig_hack.patch Type: text/x-patch Size: 311 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20050502/0d4b570b/debian_swig_hack.patch From cvs at intevation.de Mon May 2 18:23:53 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 2 May 2005 18:23:53 +0200 (CEST) Subject: jan: thuban/debian rules,1.3,1.4 Message-ID: <20050502162353.B1DE11006B0@lists.intevation.de> Author: jan Update of /thubanrepository/thuban/debian In directory doto:/tmp/cvs-serv26742 Modified Files: rules Log Message: add --use-wx-python-swig-hack to the build command. Thanks to Moritz Lennert for pointing this out. Index: rules =================================================================== RCS file: /thubanrepository/thuban/debian/rules,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rules 8 Mar 2004 09:42:50 -0000 1.3 +++ rules 2 May 2005 16:23:51 -0000 1.4 @@ -22,7 +22,7 @@ build-stamp: dh_testdir - python setup.py build + python setup.py build_ext --use-wx-python-swig-hack build # Multi-language support: cd po; make mo touch build-stamp From cvs at intevation.de Mon May 2 18:24:21 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 2 May 2005 18:24:21 +0200 (CEST) Subject: jan: thuban ChangeLog,1.807,1.808 Message-ID: <20050502162421.5706F1006B4@lists.intevation.de> Author: jan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv26771 Modified Files: ChangeLog Log Message: fix for debian/rules. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.807 retrieving revision 1.808 diff -u -d -r1.807 -r1.808 --- ChangeLog 28 Apr 2005 09:40:25 -0000 1.807 +++ ChangeLog 2 May 2005 16:24:19 -0000 1.808 @@ -1,3 +1,9 @@ +2005-05-02 Jan-Oliver Wagner + + * debian/rules: add --use-wx-python-swig-hack + to the build command. + Thanks to Moritz Lennert for pointing this out. + 2005-04-28 Jan-Oliver Wagner Introduce OGRFileShapeStore in ogr extension. From cvs at intevation.de Mon May 2 20:59:43 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 2 May 2005 20:59:43 +0200 (CEST) Subject: russell: thuban ChangeLog,1.808,1.809 Message-ID: <20050502185943.A85411005A2@lists.intevation.de> Author: russell Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv29212 Modified Files: ChangeLog Log Message: Oops, neglected to include filename info. Tnx to Bernhard for reminding me. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.808 retrieving revision 1.809 diff -u -d -r1.808 -r1.809 --- ChangeLog 2 May 2005 16:24:19 -0000 1.808 +++ ChangeLog 2 May 2005 18:59:41 -0000 1.809 @@ -63,8 +63,9 @@ 2005-04-23 Russell Nelson - * Changed the way the previous tool is remembered, so that - middle-button panning works even if you haven't selected a tool. + * Thuban/UI/view.py (MapCanvas.OnMiddle{Up,Down}): Changed the + way the previous tool is remembered, so that middle-button + panning works even if you haven't selected a tool. 2005-04-11 Bernhard Herzog From joey at infodrom.org Tue May 3 07:57:59 2005 From: joey at infodrom.org (Martin Schulze) Date: Tue, 3 May 2005 07:57:59 +0200 Subject: Transparent raster images In-Reply-To: <39ed160a05050205372ed93a2f@mail.gmail.com> References: <20050502074125.GP7744@finlandia.infodrom.north.de> <39ed160a05050205372ed93a2f@mail.gmail.com> Message-ID: <20050503055758.GF7744@finlandia.infodrom.north.de> Jonathan Coles wrote: > 2005/5/2, Martin Schulze : > > Thuban.UI.renderer contains draw_raster_data() which seems to support > > an alpha channel and is supposed to support some sort of transparency. > > > > How is this supposed to work? In the WMS extension I can order the > > server to create a GIF or PNG image with a transparent background. > > I'd like to pass this information to the renderer, but don't know > > how. Any hint or links to explanations would be appreciated. > > i just tested a hack which used a png image with transparency and it > worked. note that wxWidgets only supports transparency in png images. Oh, I thought the one-bit transparency from GIF was supported as well. > use the following as an example for use where ever you are going to > call draw_raster_data(). > > # get the raw png data (replace this with your preferred method) > f = open("sample.png") > png_data = f.read(-1) # read whole file > > # img_data is a tuple of [raw_image_data, mask_data, alpha_data] > # mask_data and alpha_data should be None because the alpha data is stored > # in the png data > img_data = [png_data, None, None] > > # width and height are the dimensions of the image > data = (width, height, img_data) > self.draw_raster_data(layer, 0, 0, data, format="PNG") FWIW, this doesn't render the graphic transparent. The WMS code currently has: img, format = layer.GetMapImg(width, height, (xmin, ymin, xmax, ymax)) data = (width, height, (img, None, None)) renderer.draw_raster_data(layer, 0,0, data, format) So basically it's doing what you proposed. However, no two layers are rendered with transparent background but with solid background. I'm attaching an image to "prove" that the Frida server indeed provides transparent PNG files. > adjusting the opacity of the layer when using a format other than > "RAW" will only work if alpha_data is not None. Since the alpha data Which values does alpha_data need? Just True/1? > is stored in the png file the layer's opacity property will not > currently affect the drawn opacity. This is simple to fix. i will add > a patch soon. Hmm. Thenks. Guess I'll have to wait until then then. Regards, Joey -- MIME - broken solution for a broken design. -- Ralf Baechle -------------- next part -------------- A non-text attachment was scrubbed... Name: wms.png Type: image/png Size: 5968 bytes Desc: not available Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20050503/26198330/wms.png From jonathan.coles at gmail.com Tue May 3 13:57:29 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Tue, 3 May 2005 07:57:29 -0400 Subject: Transparent raster images In-Reply-To: <20050503055758.GF7744@finlandia.infodrom.north.de> References: <20050502074125.GP7744@finlandia.infodrom.north.de> <39ed160a05050205372ed93a2f@mail.gmail.com> <20050503055758.GF7744@finlandia.infodrom.north.de> Message-ID: <39ed160a05050304576d7454de@mail.gmail.com> 2005/5/3, Martin Schulze : > Oh, I thought the one-bit transparency from GIF was supported as well. i can't find that in the documentation. do you know where it says that? > FWIW, this doesn't render the graphic transparent. a very important point i just remembered: you need to be using wxWindows 2.5.0 or later. previous versions do not support transparent PNG. maybe this is your problem. > Which values does alpha_data need? Just True/1? alpha_data must be a character array of values between 0 and 255. There must be one alpha value for each image pixel. This array is used if the image data itself does not contain alpha information (PNG is the only supported format that does). --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From thuban-bugs at intevation.de Wed May 4 18:50:12 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Wed, 4 May 2005 18:50:12 +0200 (CEST) Subject: [bug #3199] (thuban) Chose place and time. It will do the rest. Message-ID: <20050504165012.7D1F81005CF@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3199 ------------------------------------------------------------------------- Cialis - the next to the Guiness' book?!.. http://modifications.pilsforyou.info/?multicomputerxtvuyminiaturizationzvpO'Sullivan 36 hours: for all your needs :) --- Headers Follow --- >From paints at cigallery.com Wed May 4 18:50:12 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id 4EB061005A3 for ; Wed, 4 May 2005 18:50:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id A07F036EDC for ; Wed, 4 May 2005 18:50:07 +0200 (CEST) Received: from 12-223-120-192.client.insightbb.com (12-223-120-192.client.insightbb.com [12.223.120.192]) by mail.intevation.de (Postfix) with SMTP id 3A35C3700A for ; Wed, 4 May 2005 18:50:06 +0200 (CEST) Received: from [103.121.225.27] (port=2239 helo=[Kremlin]) by 12-223-120-192.client.insightbb.com with esmtp id 7635109101incomprehension81182 for thuban-bugs at intevation.de; Wed, 4 May 2005 11:50:15 -0500 Mime-Version: 1.0 (Apple Message framework v728) Content-Transfer-Encoding: 7bit Message-Id: <2316399643.50508 at 12-223-120-192.client.insightbb.com> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Alan Subject: Chose place and time. It will do the rest. Date: Wed, 4 May 2005 11:50:14 -0500 X-Mailer: Apple Mail (2.728) X-Spam-Status: No, hits=-0.9 tagged_above=-999.0 required=3.0 tests=BAYES_10 X-Spam-Level: -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Fri May 6 16:16:40 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:16:40 +0200 (CEST) Subject: jonathan: thuban/Thuban/Model layer.py,1.64,1.65 Message-ID: <20050506141640.AC1851005B1@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv30140/Thuban/Model Modified Files: layer.py Log Message: (RasterLayer): Added opacity and masktype parameters to the constructor, and set the appropriate variables to those values. Index: layer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/layer.py,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- layer.py 23 Mar 2005 15:30:27 -0000 1.64 +++ layer.py 6 May 2005 14:16:38 -0000 1.65 @@ -348,7 +348,8 @@ MASK_BIT = 1 MASK_ALPHA = 2 - def __init__(self, title, filename, projection = None, visible = True): + def __init__(self, title, filename, projection = None, + visible = True, opacity = 1, masktype = MASK_BIT): """Initialize the Raster Layer. title -- title for the layer. @@ -371,8 +372,8 @@ self.bbox = -1 - self.mask_type = self.MASK_BIT - self.opacity = 1 + self.mask_type = masktype + self.opacity = opacity self.image_info = None From cvs at intevation.de Fri May 6 16:17:05 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:17:05 +0200 (CEST) Subject: jonathan: thuban/Thuban/Model load.py,1.54,1.55 Message-ID: <20050506141705.3A0171005B3@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv30172/Thuban/Model Modified Files: load.py Log Message: (SessionLoader.start_rasterlayer): Added code to read the opacity and mask type of the layer and construct a new layer with the additional parameters. Index: load.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- load.py 28 Jan 2005 15:54:00 -0000 1.54 +++ load.py 6 May 2005 14:17:03 -0000 1.55 @@ -508,8 +508,17 @@ filename = os.path.join(self.GetDirectory(), filename) filename = self.encode(filename) visible = self.encode(attrs.get((None, 'visible'), "true")) != "false" + opacity = float(attrs.get((None, 'opacity'), "1")) + masktype = str(attrs.get((None, 'masktype'), "bit")) - self.aLayer = layer_class(title, filename, visible = visible) + masktypes = {"none": layer_class.MASK_NONE, + "bit": layer_class.MASK_BIT, + "alpha": layer_class.MASK_ALPHA} + + self.aLayer = layer_class(title, filename, + visible = visible, + opacity = opacity, + masktype = masktypes[masktype]) def end_rasterlayer(self, name, qname): self.aMap.AddLayer(self.aLayer) From cvs at intevation.de Fri May 6 16:17:31 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:17:31 +0200 (CEST) Subject: jonathan: thuban/Thuban/Model save.py,1.44,1.45 Message-ID: <20050506141731.39BDF1005B1@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv30190/Thuban/Model Modified Files: save.py Log Message: (SessionSaver.write_layer): Added code to save the opacity and mask type of a layer. Index: save.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/save.py,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- save.py 27 Apr 2005 11:05:19 -0000 1.44 +++ save.py 6 May 2005 14:17:29 -0000 1.45 @@ -303,6 +303,15 @@ self.close_element("layer") elif isinstance(layer, RasterLayer): attrs["filename"] = self.prepare_filename(layer.filename) + + masknames = ["none", "bit", "alpha"] + + if layer.MaskType() != layer.MASK_BIT: + attrs["masktype"] = masknames[layer.MaskType()] + + if layer.Opacity() != 1: + attrs["opacity"] = str(layer.Opacity()) + self.open_element("rasterlayer", attrs) self.write_projection(layer.GetProjection()) self.close_element("rasterlayer") From cvs at intevation.de Fri May 6 16:18:02 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:18:02 +0200 (CEST) Subject: jonathan: thuban/Thuban/UI baserenderer.py,1.19,1.20 Message-ID: <20050506141802.0B5F31006A1@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv30202/Thuban/UI Modified Files: baserenderer.py Log Message: (BaseRenderer.draw_raster_layer): Pass the opacity of the layer to draw_raster_data rather than the layer. (BaseRenderer.draw_raster_data): Remove the layer parameter because the function doesn't need to know about the layer. Add the optional opacity parameter whose default is 1.0. Add 'PNG' as a supported graphics format. Index: baserenderer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/baserenderer.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- baserenderer.py 23 Mar 2005 15:30:27 -0000 1.19 +++ baserenderer.py 6 May 2005 14:18:00 -0000 1.20 @@ -488,8 +488,8 @@ if img_data is not None: data = (width, height, img_data) - self.draw_raster_data(layer, fmin[0]+offx, offy-fmax[1], - data, "RAW") + self.draw_raster_data(fmin[0]+offx, offy-fmax[1], + data, format="RAW", opacity=layer.Opacity()) data = None def projected_raster_layer(self, layer, srcProj, dstProj, extents, @@ -523,8 +523,8 @@ raise NotImplementedError - def draw_raster_data(self, layer, x, y, data, format="BMP"): - """Draw the layer's raster image held in data onto the DC with the top + def draw_raster_data(self, x, y, data, format="BMP", opacity=1.0): + """Draw a raster image held in data onto the DC with the top left corner at (x,y) The raster image data is a tuple of the form @@ -541,7 +541,10 @@ The following format names should be used: 'RAW' -- an array of RGB values (len=3*width*height) + 'PNG' -- Portable Network Graphic (transparency supported) 'BMP' -- Windows Bitmap + 'TIFF' -- Tagged Image File Format + 'GIF' -- GIF Image 'JPEG' -- JPEG Image The default format is 'BMP'. From cvs at intevation.de Fri May 6 16:18:33 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:18:33 +0200 (CEST) Subject: jonathan: thuban/Thuban/UI renderer.py,1.61,1.62 Message-ID: <20050506141833.9DDC81006A1@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv30217/Thuban/UI Modified Files: renderer.py Log Message: (MapRenderer.draw_raster_data): Fixed signature to match that in BaseRenderer. Use the new opacity argument in place of calling layer.Opacity(). In the case where the format is not 'RAW', alpha_data is None and the loaded image has alpha information, use the file's alpha information. This is still subject to the layer's opacity setting. Index: renderer.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/renderer.py,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- renderer.py 25 Apr 2005 15:01:48 -0000 1.61 +++ renderer.py 6 May 2005 14:18:31 -0000 1.62 @@ -144,7 +144,7 @@ return ret - def draw_raster_data(self, layer, x,y, data, format = 'BMP'): + def draw_raster_data(self, x,y, data, format = 'BMP', opacity=1.0): mask = None alpha = None @@ -168,6 +168,7 @@ else: stream = cStringIO.StringIO(image_data) image = wxImageFromStream(stream, raster_format_map[format]) + if mask_data is not None: stream = cStringIO.StringIO(mask_data) mask = wxImageFromStream(stream, raster_format_map[format]) @@ -175,20 +176,21 @@ elif alpha_data is not None: stream = cStringIO.StringIO(alpha_data) alpha = wxImageFromStream(stream, raster_format_map[format]) - alpha = alpha.GetData()[:] # XXX: do we need to copy this? + alpha = alpha.GetData() #[:] # XXX: do we need to copy this? + elif image.HasAlpha(): + alpha = image.GetAlphaData() # - # if we are using the alpha_data then scale down the alpha values - # by the layer's opacity using a string translation table + # scale down the alpha values the opacity level using a string + # translation table for efficiency. # if alpha is not None: - lo = layer.Opacity() - if lo == 0: + if opacity == 0: return - elif lo == 1: + elif opacity == 1: a = alpha else: - tr = [int(i*lo) for i in range(256)] + tr = [int(i*opacity) for i in range(256)] table = array.array('B', tr).tostring() a = alpha.translate(table) From cvs at intevation.de Fri May 6 16:19:05 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:19:05 +0200 (CEST) Subject: jonathan: thuban/test test_baserenderer.py,1.14,1.15 Message-ID: <20050506141905.AC6A91005B1@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv30231/test Modified Files: test_baserenderer.py Log Message: (SimpleRenderer.draw_raster_data): Fixed signature to match that in BaseRenderer. Index: test_baserenderer.py =================================================================== RCS file: /thubanrepository/thuban/test/test_baserenderer.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test_baserenderer.py 23 Mar 2005 15:30:27 -0000 1.14 +++ test_baserenderer.py 6 May 2005 14:19:03 -0000 1.15 @@ -91,7 +91,7 @@ def label_font(self): return "label font" - def draw_raster_data(self, layer, x, y, data, format='BMP'): + def draw_raster_data(self, x, y, data, format='BMP', opacity=1.0): self.raster_data = data self.raster_format = format From cvs at intevation.de Fri May 6 16:19:25 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:19:25 +0200 (CEST) Subject: jonathan: thuban/test test_load.py,1.45,1.46 Message-ID: <20050506141925.D611A1006C8@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv30246/test Modified Files: test_load.py Log Message: (TestRasterLayer): Change file_contents to include opacity and masktype variables. (TestRasterLayer.test): Include tests for opacity and masktype changes. Index: test_load.py =================================================================== RCS file: /thubanrepository/thuban/test/test_load.py,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- test_load.py 28 Jan 2005 15:54:00 -0000 1.45 +++ test_load.py 6 May 2005 14:19:23 -0000 1.46 @@ -664,7 +664,7 @@ title="single map&layer"> + title="My RasterLayer" opacity="0.4" masktype="alpha"/> ''' @@ -681,6 +681,9 @@ layer = map.Layers()[0] # one layer in the sample eq(layer.Title(), "My RasterLayer") + eq(layer.Opacity(), 0.4) + eq(layer.MaskType(), layer.MASK_ALPHA) + self.failIf(layer.Visible()) self.failUnless(filenames_equal(layer.GetImageFilename(), os.path.join(self.temp_dir(), From cvs at intevation.de Fri May 6 16:19:42 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:19:42 +0200 (CEST) Subject: jonathan: thuban/test test_save.py,1.35,1.36 Message-ID: <20050506141942.45EE51006CB@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv30260/test Modified Files: test_save.py Log Message: (SaveSessionTest.testRasterLayer): Restructure test to cover a variety of combinations of masktype and opacity settings. Index: test_save.py =================================================================== RCS file: /thubanrepository/thuban/test/test_save.py,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- test_save.py 28 Jan 2005 15:54:00 -0000 1.35 +++ test_save.py 6 May 2005 14:19:40 -0000 1.36 @@ -234,40 +234,58 @@ self.validate_data(written_contents) def testRasterLayer(self): - # deliberately put an apersand in the title :) - session = Session("single map&layer") - map = Map("Test Map") - session.AddMap(map) - # use shapefile from the example data - imgfile = os.path.join(os.path.dirname(__file__), - os.pardir, "Data", "iceland", "island.tif") - layer = RasterLayer("My RasterLayer", imgfile) - map.AddLayer(layer) - filename = self.temp_file_name("%s.thuban" % self.id()) - save_session(session, filename) - session.Destroy() + MASK_NONE = RasterLayer.MASK_NONE + MASK_BIT = RasterLayer.MASK_BIT + MASK_ALPHA = RasterLayer.MASK_ALPHA - file = open(filename) - written_contents = file.read() - file.close() - expected_contents = ''' - - - - - - - ''' - #print written_contents - #print "********************************************" - #print expected_contents - self.compare_xml(written_contents, expected_contents) + for opacity, masktype, opname, maskname in \ + [(1, MASK_BIT, '', ''), + (.2, MASK_BIT, 'opacity="0.2"', ''), + (1, MASK_ALPHA, '', 'masktype="alpha"'), + (.5, MASK_ALPHA, 'opacity="0.5"', 'masktype="alpha"'), + (1, MASK_NONE, '', 'masktype="none"'), + (0, MASK_NONE, 'opacity="0"', 'masktype="none"') ]: - self.validate_data(written_contents) + + # deliberately put an apersand in the title :) + session = Session("single map&layer") + map = Map("Test Map") + session.AddMap(map) + # use shapefile from the example data + imgfile = os.path.join(os.path.dirname(__file__), + os.pardir, "Data", "iceland", "island.tif") + layer = RasterLayer("My RasterLayer", imgfile) + + layer.SetOpacity(opacity) + layer.SetMaskType(masktype) + + map.AddLayer(layer) + + filename = self.temp_file_name("%s.thuban" % self.id()) + save_session(session, filename) + session.Destroy() + + file = open(filename) + written_contents = file.read() + file.close() + expected_contents = ''' + + + + + + + ''' % (opname, maskname) + #print written_contents + #print "********************************************" + #print expected_contents + self.compare_xml(written_contents, expected_contents) + + self.validate_data(written_contents) def testClassifiedLayer(self): """Save a session with a single map with classifications""" From cvs at intevation.de Fri May 6 16:20:22 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Fri, 6 May 2005 16:20:22 +0200 (CEST) Subject: jonathan: thuban ChangeLog,1.809,1.810 Message-ID: <20050506142022.D94241005B1@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv30272 Modified Files: ChangeLog Log Message: Add support for saving and loading the opacity and mask type properties of RasterLayers. Also add support for proper use of alpha information while drawing images not in 'RAW' format. If transparency in an image format (e.g, PNG) is supported by wxWidgets then the image would previously have been draw with transparent regions, but the opaque regions would have been unaffected by a change in the layer's opacity. This patch corrects the problem. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.809 retrieving revision 1.810 diff -u -d -r1.809 -r1.810 --- ChangeLog 2 May 2005 18:59:41 -0000 1.809 +++ ChangeLog 6 May 2005 14:20:20 -0000 1.810 @@ -1,3 +1,51 @@ +2005-05-06 Jonathan Coles + + Add support for saving and loading the opacity and mask type + properties of RasterLayers. Also add support for proper use + of alpha information while drawing images not in 'RAW' format. + If transparency in an image format (e.g, PNG) is supported by + wxWidgets then the image would previously have been draw with + transparent regions, but the opaque regions would have been + unaffected by a change in the layer's opacity. This patch + corrects the problem. + + * Thuban/Model/layer.py (RasterLayer): Added opacity and + masktype parameters to the constructor, and set the + appropriate variables to those values. + + * Thuban/Model/load.py (SessionLoader.start_rasterlayer): Added + code to read the opacity and mask type of the layer and construct + a new layer with the additional parameters. + + * Thuban/Model/save.py (SessionSaver.write_layer): Added code + to save the opacity and mask type of a layer. + + * Thuban/UI/baserenderer.py (BaseRenderer.draw_raster_layer): Pass + the opacity of the layer to draw_raster_data rather than the layer. + (BaseRenderer.draw_raster_data): Remove the layer parameter because + the function doesn't need to know about the layer. Add the optional + opacity parameter whose default is 1.0. Add 'PNG' as a supported + graphics format. + + * Thuban/UI/renderer.py (MapRenderer.draw_raster_data): Fixed + signature to match that in BaseRenderer. Use the new opacity argument + in place of calling layer.Opacity(). In the case where the + format is not 'RAW', alpha_data is None and the loaded image has + alpha information, use the file's alpha information. This is + still subject to the layer's opacity setting. + + * test/test_baserenderer.py (SimpleRenderer.draw_raster_data): + Fixed signature to match that in BaseRenderer. + + * test/test_load.py (TestRasterLayer): Change file_contents to + include opacity and masktype variables. + (TestRasterLayer.test): Include tests for opacity and masktype + changes. + + * test/test_save.py (SaveSessionTest.testRasterLayer): Restructure + test to cover a variety of combinations of masktype and opacity + settings. + 2005-05-02 Jan-Oliver Wagner * debian/rules: add --use-wx-python-swig-hack From jonathan.coles at gmail.com Fri May 6 16:23:55 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Fri, 6 May 2005 10:23:55 -0400 Subject: preparing for Thuban 1.1 In-Reply-To: References: Message-ID: <39ed160a050506072323bb1994@mail.gmail.com> 2005/4/7, Bernhard Herzog : > - the raster layer opacity isn't saved to the .thuban files. This > one's not in the bug tracker. I've also not found any time to look > at the code so far. i just submitted a patch to cvs to add support for saving and loading the mask type and opacity used in a RasterLayer. --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From jonathan.coles at gmail.com Fri May 6 16:27:53 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Fri, 6 May 2005 10:27:53 -0400 Subject: Transparent raster images In-Reply-To: <20050503055758.GF7744@finlandia.infodrom.north.de> References: <20050502074125.GP7744@finlandia.infodrom.north.de> <39ed160a05050205372ed93a2f@mail.gmail.com> <20050503055758.GF7744@finlandia.infodrom.north.de> Message-ID: <39ed160a050506072744e1815c@mail.gmail.com> 2005/5/3, Martin Schulze : > > adjusting the opacity of the layer when using a format other than > > "RAW" will only work if alpha_data is not None. Since the alpha data > > is stored in the png file the layer's opacity property will not > > currently affect the drawn opacity. This is simple to fix. i will add > > a patch soon. > > Hmm. Thenks. Guess I'll have to wait until then then. i've just added a patch to cvs which will allow the opacity of normally opaque regions in a transparent PNG image to be adjusted. you will still need wxWidgets (a.k.a. wxWindows) 2.5.0 or later to have transparent PNG support at all. --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From jonathan.coles at gmail.com Fri May 6 16:30:14 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Fri, 6 May 2005 10:30:14 -0400 Subject: Raster layer opacity In-Reply-To: References: <1111592504.14081.14.camel@localhost.localdomain> Message-ID: <39ed160a0505060730353d0f0b@mail.gmail.com> 2005/4/29, Bernhard Herzog : > I don't see why you need to add the layer itself. The opacity value > would have sufficed. So far the draw_raster_data implementations had no > need to know about layers. They only needed to know about raster data > rendering. I think it should stay that way. i've change draw_raster_data() by removing the layer parameter and adding an opacity parameter whose default value is 1.0. --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From thuban-bugs at intevation.de Sun May 8 04:49:14 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Sun, 8 May 2005 04:49:14 +0200 (CEST) Subject: [bug #3212] (thuban) Cialis will help you. Get erection whenever you want. Message-ID: <20050508024914.AB9F81006A5@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3212 ------------------------------------------------------------------------- Viagra - Just do her! :-) http://sideshow.solidercetion.info/?pietyxtvuyRobbinszctsponsor We are one of the world leading legal sources for male impotence treatments --- Headers Follow --- >From preset at lindmark.com Sun May 8 04:49:14 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id 671C01005DF for ; Sun, 8 May 2005 04:49:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id 39D4836EDC for ; Sun, 8 May 2005 04:49:13 +0200 (CEST) Received: from ppp7326.hakata01.bbiq.jp (ppp7326.hakata01.bbiq.jp [203.135.221.214]) by mail.intevation.de (Postfix) with SMTP id 75E3C36CDD for ; Sun, 8 May 2005 04:49:10 +0200 (CEST) Received: from [199.182.124.172] (port=2208 helo=[slimy]) by ppp7326.hakata01.bbiq.jp with esmtp id 68878128419representably114322 for thuban-bugs at intevation.de; Sun, 8 May 2005 11:49:07 +0900 Mime-Version: 1.0 (Apple Message framework v725) Content-Transfer-Encoding: 7bit Message-Id: <542943882.113593 at ppp7326.hakata01.bbiq.jp> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Ralph Subject: Cialis will help you. Get erection whenever you want. Date: Sun, 8 May 2005 11:49:06 +0900 X-Mailer: Apple Mail (2.725) X-Spam-Status: No, hits=-0.0 tagged_above=-999.0 required=3.0 tests=BAYES_44 X-Spam-Level: -------------------------------------------- Managed by Request Tracker From thuban-bugs at intevation.de Sun May 8 08:27:15 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Sun, 8 May 2005 08:27:15 +0200 (CEST) Subject: [bug #3213] (thuban) Strong enough for a men, but made for a women Message-ID: <20050508062715.630021006BB@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3213 ------------------------------------------------------------------------- Fast, worldwide service using registered doctors and pharmacies http://strikers.tabsyouneed.info/?quarreledxtvuyslowszsvquartered You will have access to some of the lowest prices on the internet --- Headers Follow --- >From screamers at slaten.net Sun May 8 08:27:15 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id 2FB561006A1 for ; Sun, 8 May 2005 08:27:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id 4DF2336EDC for ; Sun, 8 May 2005 08:27:10 +0200 (CEST) Received: from 219.249.161.160 (unknown [219.249.161.160]) by mail.intevation.de (Postfix) with SMTP id A244C36CDB for ; Sun, 8 May 2005 08:27:07 +0200 (CEST) Received: from [216.91.42.71] (port=2084 helo=[reactivates]) by 219.249.161.160 with esmtp id 1950079042roper108648 for thuban-bugs at intevation.de; Sun, 8 May 2005 15:27:05 +0900 Mime-Version: 1.0 (Apple Message framework v725) Content-Transfer-Encoding: 7bit Message-Id: <58901129152.63637 at 219.249.161.160> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Ed Subject: Strong enough for a men, but made for a women Date: Sun, 8 May 2005 15:27:04 +0900 X-Mailer: Apple Mail (2.725) X-Spam-Status: No, hits=-0.0 tagged_above=-999.0 required=3.0 tests=BAYES_44 X-Spam-Level: -------------------------------------------- Managed by Request Tracker From thuban-bugs at intevation.de Sun May 8 12:55:26 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Sun, 8 May 2005 12:55:26 +0200 (CEST) Subject: [bug #3214] (thuban) The best you may make for is to be the #1 lover. Message-ID: <20050508105526.700F71006B8@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3214 ------------------------------------------------------------------------- We have over 20,000 registered users http://removals.solidercetion.info/?planerxtvuysquawkedzsvprominently You will have access to some of the lowest prices on the internet --- Headers Follow --- >From procurements at binns.com Sun May 8 12:55:26 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id 3CEC1100160 for ; Sun, 8 May 2005 12:55:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id 303D136E1D for ; Sun, 8 May 2005 12:55:00 +0200 (CEST) Received: from bdx13.neoplus.adsl.tpnet.pl (bdx13.neoplus.adsl.tpnet.pl [83.28.9.13]) by mail.intevation.de (Postfix) with SMTP id 0EA6C36CDD for ; Sun, 8 May 2005 12:54:59 +0200 (CEST) Received: from [38.227.137.127] (port=2007 helo=[pictorial]) by bdx13.neoplus.adsl.tpnet.pl with esmtp id 28717104431solstice125520 for thuban-bugs at intevation.de; Sun, 8 May 2005 12:55:04 +0200 Mime-Version: 1.0 (Apple Message framework v725) Content-Transfer-Encoding: 7bit Message-Id: <6631773669.77852 at bdx13.neoplus.adsl.tpnet.pl> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Harriot Subject: The best you may make for is to be the #1 lover. Date: Sun, 8 May 2005 12:55:03 +0200 X-Mailer: Apple Mail (2.725) X-Spam-Status: No, hits=-0.9 tagged_above=-999.0 required=3.0 tests=BAYES_10 X-Spam-Level: -------------------------------------------- Managed by Request Tracker From thuban-bugs at intevation.de Mon May 9 17:34:59 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Mon, 9 May 2005 17:34:59 +0200 (CEST) Subject: [bug #3219] (thuban) Drugs Online Message-ID: <20050509153459.098211006CE@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3219 ------------------------------------------------------------------------- more people buy drugs online http://evysdht.roc2va9261rhda9.lavekdhik.com --- Headers Follow --- >From screening at extractorsled.com Mon May 9 17:34:58 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id CC9D31006CB for ; Mon, 9 May 2005 17:34:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id 51F1836CDB for ; Mon, 9 May 2005 17:34:54 +0200 (CEST) Received: from ANancy-107-1-21-145.w81-48.abo.wanadoo.fr (ANancy-107-1-21-145.w81-48.abo.wanadoo.fr [81.48.15.145]) by mail.intevation.de (Postfix) with SMTP id 0866E36E1D for ; Mon, 9 May 2005 17:34:43 +0200 (CEST) Received: from [225.58.82.121] (port=2053 helo=[predatory]) by ANancy-107-1-21-145.w81-48.abo.wanadoo.fr with esmtp id 521927045sodium13948 for thuban-bugs at intevation.de; Mon, 9 May 2005 17:34:34 +0200 Mime-Version: 1.0 (Apple Message framework v728) Content-Transfer-Encoding: 7bit Message-Id: <820013211.91647 at ANancy-107-1-21-145.w81-48.abo.wanadoo.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Sandy Subject: Drugs Online Date: Mon, 9 May 2005 17:34:33 +0200 X-Mailer: Apple Mail (2.728) X-Spam-Status: No, hits=2.2 tagged_above=-999.0 required=3.0 tests=BAYES_01, ONLINE_PHARMACY X-Spam-Level: ** -------------------------------------------- Managed by Request Tracker From cvs at intevation.de Mon May 9 20:12:14 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 9 May 2005 20:12:14 +0200 (CEST) Subject: bh: thuban/test test_postgis_db.py,1.18,1.19 Message-ID: <20050509181214.3832D1006DB@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv3514/test Modified Files: test_postgis_db.py Log Message: * Thuban/Model/postgisdb.py (PostGISConnection.connect): Set the connection to autoconnect. Fixes RT#3148. * test/test_postgis_db.py (TestPostGISSpecialCases.test_simple_error_handling): New test that attempts to reproduce RT#3148. Index: test_postgis_db.py =================================================================== RCS file: /thubanrepository/thuban/test/test_postgis_db.py,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- test_postgis_db.py 16 Dec 2004 15:18:57 -0000 1.18 +++ test_postgis_db.py 9 May 2005 18:12:11 -0000 1.19 @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2004 by Intevation GmbH +# Copyright (C) 2003, 2004, 2005 by Intevation GmbH # Authors: # Bernhard Herzog # @@ -346,6 +346,45 @@ self.assertEquals([s.ShapeID() for s in store.ShapesInRegion((0, 0, 100,100))], [1]) + + + def test_simple_error_handling(self): + """Test some simple error handling. + + If an error happens in, say the SimpleQuery method, a subsequent + ReadValue call should still succeed. + """ + conn = psycopg.connect("dbname=%s " % self.dbname + + self.server.connection_string("admin")) + cursor = conn.cursor() + cursor.execute("CREATE TABLE some_table" + " (gid INTEGER PRIMARY KEY, length float);" + "INSERT INTO some_table VALUES (1, 3.5);") + cursor.execute("GRANT SELECT ON some_table TO PUBLIC;") + conn.commit() + conn.close() + + db = PostGISConnection(dbname = self.dbname, + **self.server.connection_params("user")) + table = PostGISTable(db, "some_table", id_column = "gid") + + # trying to compare the length to a string should fail with an + # exception. + self.assertRaises(psycopg.ProgrammingError, + table.SimpleQuery, + table.Column("length"), "<=", "abc") + + # After the exception, doing a query on the same table should + # work. Since it's the same database connection as before, it + # can fail if no rollback has been done or the connection isn't + # in autocommit mode. Typical error message is + # + # ERROR: current transaction is aborted, commands ignored + # until end of transaction block + try: + self.assertEquals(table.ReadValue(1, "length"), 3.5) + except psycopg.ProgrammingError, val: + self.fail("table didn't handle exception properly (%s)" % val) class PostGISStaticTests(unittest.TestCase, support.FloatComparisonMixin): From cvs at intevation.de Mon May 9 20:12:14 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 9 May 2005 20:12:14 +0200 (CEST) Subject: bh: thuban/Thuban/Model postgisdb.py,1.19,1.20 Message-ID: <20050509181214.3AEC61006DC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/Thuban/Model In directory doto:/tmp/cvs-serv3514/Thuban/Model Modified Files: postgisdb.py Log Message: * Thuban/Model/postgisdb.py (PostGISConnection.connect): Set the connection to autoconnect. Fixes RT#3148. * test/test_postgis_db.py (TestPostGISSpecialCases.test_simple_error_handling): New test that attempts to reproduce RT#3148. Index: postgisdb.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/postgisdb.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- postgisdb.py 16 Dec 2004 15:18:57 -0000 1.19 +++ postgisdb.py 9 May 2005 18:12:12 -0000 1.20 @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2004 by Intevation GmbH +# Copyright (C) 2003, 2004, 2005 by Intevation GmbH # Authors: # Martin Mueller # Bernhard Herzog @@ -106,6 +106,16 @@ self.connection = psycopg.connect(" ".join(params)) except psycopg.OperationalError, val: raise ConnectionError(str(val)) + + # Use autocommit mode. For simple reading of the database it's + # sufficient and we don't have to care much about error + # handling. Without autocommit, an errors during a cursor's + # execute method requires a rollback on the connection, + # otherwise later queries with the same or other cursors sharing + # the same connection will lead to further errors ("ERROR: + # current transaction is aborted, commands ignored until end of + # transaction block") + self.connection.autocommit() # determine the OID for the geometry type. This is PostGIS # specific. From cvs at intevation.de Mon May 9 20:12:14 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 9 May 2005 20:12:14 +0200 (CEST) Subject: bh: thuban ChangeLog,1.810,1.811 Message-ID: <20050509181214.4A4821006DD@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv3514 Modified Files: ChangeLog Log Message: * Thuban/Model/postgisdb.py (PostGISConnection.connect): Set the connection to autoconnect. Fixes RT#3148. * test/test_postgis_db.py (TestPostGISSpecialCases.test_simple_error_handling): New test that attempts to reproduce RT#3148. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.810 retrieving revision 1.811 diff -u -d -r1.810 -r1.811 --- ChangeLog 6 May 2005 14:20:20 -0000 1.810 +++ ChangeLog 9 May 2005 18:12:12 -0000 1.811 @@ -1,3 +1,12 @@ +2005-05-09 Bernhard Herzog + + * Thuban/Model/postgisdb.py (PostGISConnection.connect): Set the + connection to autoconnect. Fixes RT#3148. + + * test/test_postgis_db.py + (TestPostGISSpecialCases.test_simple_error_handling): New test + that attempts to reproduce RT#3148. + 2005-05-06 Jonathan Coles Add support for saving and loading the opacity and mask type From cvs at intevation.de Mon May 9 20:36:04 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 9 May 2005 20:36:04 +0200 (CEST) Subject: bh: thuban/test support.py,1.19,1.20 Message-ID: <20050509183604.567EE1006BC@lists.intevation.de> Author: bh Update of /thubanrepository/thuban/test In directory doto:/tmp/cvs-serv4219/test Modified Files: support.py Log Message: (FileLoadTestCase.filename): Fix doc-string. Index: support.py =================================================================== RCS file: /thubanrepository/thuban/test/support.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- support.py 27 Oct 2003 17:11:20 -0000 1.19 +++ support.py 9 May 2005 18:36:02 -0000 1.20 @@ -1,4 +1,4 @@ -# Copyright (c) 2002, 2003 by Intevation GmbH +# Copyright (c) 2002, 2003, 2004 by Intevation GmbH # Authors: # Bernhard Herzog # @@ -268,8 +268,8 @@ def filename(self): """Return the name of the test file to use. - The default implementation simply calls self.volatile_file_name - with a basename derived from the class name by stripping off a + The default implementation simply calls self.temp_file_name with + a basename derived from the class name by stripping off a leading 'test_' and appending self.file_extension. """ name = self.__class__.__name__ From cvs at intevation.de Mon May 9 20:36:04 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Mon, 9 May 2005 20:36:04 +0200 (CEST) Subject: bh: thuban ChangeLog,1.811,1.812 Message-ID: <20050509183604.604CF1006BE@lists.intevation.de> Author: bh Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv4219 Modified Files: ChangeLog Log Message: (FileLoadTestCase.filename): Fix doc-string. Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.811 retrieving revision 1.812 diff -u -d -r1.811 -r1.812 --- ChangeLog 9 May 2005 18:12:12 -0000 1.811 +++ ChangeLog 9 May 2005 18:36:02 -0000 1.812 @@ -1,5 +1,9 @@ 2005-05-09 Bernhard Herzog + * test/support.py (FileLoadTestCase.filename): Fix doc-string. + +2005-05-09 Bernhard Herzog + * Thuban/Model/postgisdb.py (PostGISConnection.connect): Set the connection to autoconnect. Fixes RT#3148. From thuban-bugs at intevation.de Tue May 10 02:05:23 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Tue, 10 May 2005 02:05:23 +0200 (CEST) Subject: [bug #3221] (thuban) Wholesale Rolex Message-ID: <20050510000523.69AE41006AB@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3221 ------------------------------------------------------------------------- Rolex, Cartier, Frank Mueller, Bretling for sale http://embed.ju7.net/rep/vron/budging.html Perl ? Rolex, Cartier and Breitling --- Headers Follow --- >From begin at cctinc.org Tue May 10 02:05:23 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id 2EEE01005D7 for ; Tue, 10 May 2005 02:05:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id AE77A36CDD for ; Tue, 10 May 2005 02:05:22 +0200 (CEST) Received: from dsl.dynamic81215186198.ttnet.net.tr (unknown [81.215.186.198]) by mail.intevation.de (Postfix) with SMTP id C644936CDB for ; Tue, 10 May 2005 02:05:14 +0200 (CEST) Received: from [91.201.34.113] (port=2445 helo=[circuitry]) by dsl.dynamic81215186198.ttnet.net.tr with esmtp id 1551066347blunt63876 for thuban-bugs at intevation.de; Tue, 10 May 2005 03:04:55 +0300 Mime-Version: 1.0 (Apple Message framework v725) Content-Transfer-Encoding: 7bit Message-Id: <76999117434.83681 at dsl.dynamic81215186198.ttnet.net.tr> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Edmund Subject: Wholesale Rolex Date: Tue, 10 May 2005 03:04:54 +0300 X-Mailer: Apple Mail (2.725) X-Spam-Status: No, hits=-0.0 tagged_above=-999.0 required=3.0 tests=BAYES_44 X-Spam-Level: -------------------------------------------- Managed by Request Tracker From thuban-bugs at intevation.de Tue May 10 17:01:51 2005 From: thuban-bugs at intevation.de (Request Tracker) Date: Tue, 10 May 2005 17:01:51 +0200 (CEST) Subject: [bug #3225] (thuban) Prescription Drug Information Message-ID: <20050510150151.27B231006DD@lists.intevation.de> this bug's URL: http://intevation.de/rt/webrt?serial_num=3225 ------------------------------------------------------------------------- eDrugs Online http://qknh.nk8grongkfnd96n.boweldjaej.com --- Headers Follow --- >From britches at caramail.com Tue May 10 17:01:50 2005 Return-Path: Delivered-To: thuban-bugs at lists.intevation.de Received: from mail.intevation.de (aktaia [212.95.126.10]) by lists.intevation.de (Postfix) with ESMTP id D5AFF1006D8 for ; Tue, 10 May 2005 17:01:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.intevation.de (Postfix) with ESMTP id 76F2836CDB for ; Tue, 10 May 2005 17:01:50 +0200 (CEST) Received: from c-67-164-57-207.hsd1.wa.comcast.net (c-67-164-57-207.hsd1.wa.comcast.net [67.164.57.207]) by mail.intevation.de (Postfix) with SMTP id 1983536CDD for ; Tue, 10 May 2005 17:01:48 +0200 (CEST) Received: from [223.55.179.63] (port=2569 helo=[conjecture]) by c-67-164-57-207.hsd1.wa.comcast.net with esmtp id 90090116302fortified129459 for thuban-bugs at intevation.de; Tue, 10 May 2005 08:01:31 -0700 Mime-Version: 1.0 (Apple Message framework v728) Content-Transfer-Encoding: 7bit Message-Id: <5191497966.5345 at c-67-164-57-207.hsd1.wa.comcast.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: thuban-bugs at intevation.de From: Clotilda Subject: Prescription Drug Information Date: Tue, 10 May 2005 08:01:30 -0700 X-Mailer: Apple Mail (2.728) X-Spam-Status: No, hits=-0.0 tagged_above=-999.0 required=3.0 tests=BAYES_44 X-Spam-Level: -------------------------------------------- Managed by Request Tracker From jonathan.coles at gmail.com Wed May 11 16:21:48 2005 From: jonathan.coles at gmail.com (Jonathan Coles) Date: Wed, 11 May 2005 10:21:48 -0400 Subject: Thuban still crashes because of SWIG pointer problem Message-ID: <39ed160a0505110721cfee3b@mail.gmail.com> Despite some recent hacks at working around incompatibilities with SWIG pointers, Thuban still segfaults when compiling on Debian sid using python 2.3, libwxgtk2.5.3-python, wxpython2.5.3, and libwxgtk2.5-dev. If --use-wx-python-swig-hack is NOT specified, then wx/wxPython/wxPython.h cannot be found. If the flag IS specified, I get a segfault when loading the iceland sample. My fix for this has been to not specify the flag, copy wxPython.h from the wxPython (v2.5.3.1) source to libraries/thuban and modify wxproj.cpp to include "wxPython.h" instead of . The swigPtrConvertHack.h does not work properly with wxwidgets 2.5.3 (at least on my machine). Is anyone else experiencing the same trouble? thanks, --jonathan -- ===================================================================== Jonathan Coles http://www.jpcoles.com jonathan at jpcoles.com ===================================================================== From joey at infodrom.org Wed May 11 19:49:48 2005 From: joey at infodrom.org (Martin Schulze) Date: Wed, 11 May 2005 19:49:48 +0200 Subject: Incorporating PyOGCLib Message-ID: <20050511174947.GX7744@finlandia.infodrom.north.de> Hi, the idea came up to incorporate the part of PyOGCLib that is used in the WMS extension into the WMS extension. This would affect two files (WMSClient.py and Errors.py). What do you think about this? It is suffiently free so we won't create a license problem at least. Regards, Joey -- Of course, I didn't mean that, which is why I didn't say it. What I meant to say, I said. -- Thomas Bushnell From jan at intevation.de Thu May 12 08:22:25 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Thu, 12 May 2005 08:22:25 +0200 Subject: Incorporating PyOGCLib In-Reply-To: <20050511174947.GX7744@finlandia.infodrom.north.de> References: <20050511174947.GX7744@finlandia.infodrom.north.de> Message-ID: <20050512062225.GA30214@intevation.de> On Wed, May 11, 2005 at 07:49:48PM +0200, Martin Schulze wrote: > the idea came up to incorporate the part of PyOGCLib that is used > in the WMS extension into the WMS extension. This would affect two > files (WMSClient.py and Errors.py). > > What do you think about this? I seond this idea, because PyOGCLib has not developed into a generally available package. To have the WMS Extension work out of the box it would be best to add these two files. Of course we should monitor further activities around PyOGCLib and synchronize. Best Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From cvs at intevation.de Thu May 12 16:54:32 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 12 May 2005 16:54:32 +0200 (CEST) Subject: jonathan: thuban/Thuban/UI projdialog.py,1.42,1.43 Message-ID: <20050512145432.7D79A101F09@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban/Thuban/UI In directory doto:/tmp/cvs-serv2275/Thuban/UI Modified Files: projdialog.py Log Message: Add missing import, which led to an exception when opening a layer's projection. Index: projdialog.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/UI/projdialog.py,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- projdialog.py 8 Feb 2005 20:34:29 -0000 1.42 +++ projdialog.py 12 May 2005 14:54:30 -0000 1.43 @@ -13,7 +13,7 @@ # $Source$ # $Id$ -import os +import sys, os from wxPython.wx import * from Thuban import _ From cvs at intevation.de Thu May 12 16:54:52 2005 From: cvs at intevation.de (cvs@intevation.de) Date: Thu, 12 May 2005 16:54:52 +0200 (CEST) Subject: jonathan: thuban ChangeLog,1.812,1.813 Message-ID: <20050512145452.B92E1101F0A@lists.intevation.de> Author: jonathan Update of /thubanrepository/thuban In directory doto:/tmp/cvs-serv2296 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /thubanrepository/thuban/ChangeLog,v retrieving revision 1.812 retrieving revision 1.813 diff -u -d -r1.812 -r1.813 --- ChangeLog 9 May 2005 18:36:02 -0000 1.812 +++ ChangeLog 12 May 2005 14:54:50 -0000 1.813 @@ -1,3 +1,8 @@ +2005-05-12 Jonathan Coles + + * Thuban/UI/projdialog.py: Add missing import, which led to an + exception when opening a layer's projection. + 2005-05-09 Bernhard Herzog * test/support.py (FileLoadTestCase.filename): Fix doc-string. From jan at intevation.de Fri May 13 09:14:44 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Fri, 13 May 2005 09:14:44 +0200 Subject: Patch introducing shapestore registry Message-ID: <20050513071444.GA491@intevation.de> hi, attached is a patch that introduces a simple shapestore registry. The rationale is to allow the load routine to call a ShapeStore class which was registered for a shapetype. This allows to load e.g. a MapInfo layer (I tested this successfully with a modified ogr extension). The registry might have to be improved further, but as a first instance, it works. OK to commit? Jan -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ From jan at intevation.de Fri May 13 09:15:39 2005 From: jan at intevation.de (Jan-Oliver Wagner) Date: Fri, 13 May 2005 09:15:39 +0200 Subject: Patch introducing shapestore registry In-Reply-To: <20050513071444.GA491@intevation.de> References: <20050513071444.GA491@intevation.de> Message-ID: <20050513071539.GB491@intevation.de> On Fri, May 13, 2005 at 09:14:44AM +0200, Jan-Oliver Wagner wrote: > attached is a patch that introduces a simple shapestore > registry. now it is. -- Jan-Oliver Wagner http://intevation.de/~jan/ Intevation GmbH http://intevation.de/ Kolab Konsortium http://kolab-konsortium.de/ FreeGIS http://freegis.org/ -------------- next part -------------- Index: data.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/data.py,v retrieving revision 1.16 diff -u -3 -p -r1.16 data.py --- data.py 27 Apr 2005 11:04:56 -0000 1.16 +++ data.py 13 May 2005 07:07:08 -0000 @@ -112,6 +112,29 @@ class ShapeTable(transientdb.AutoTransie """Return a tuple containing the shapestore""" return (self.store(),) + +class ShapeStoreRegistry: + + def __init__(self): + self._registry = [] + + def __nonzero__(self): + return len(self._registry) <> 0 + + def __iter__(self): + return iter(self._registry) + + def add(self, shapetype, clazz): + self._registry.append( (shapetype, clazz ) ) + + def findClass(self, shapetype): + for i in self._registry: + if i[0] == shapetype: + return i[1] + return None + +shapestore_registry = ShapeStoreRegistry() + # XXX: (this statement should be kept in mind when re-engeneering) # # From a desing POV it was wrong to distinguish between table and @@ -295,6 +318,9 @@ class ShapefileStore(FileShapeStore): def Shape(self, index): """Return the shape with index index""" return ShapefileShape(self.shapefile, index) + +# Add the type supported by ShapefileStore. +shapestore_registry.add("shapefile", ShapefileStore) class DerivedShapeStore: Index: load.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/load.py,v retrieving revision 1.55 diff -u -3 -p -r1.55 load.py --- load.py 6 May 2005 14:17:03 -0000 1.55 +++ load.py 13 May 2005 07:07:08 -0000 @@ -14,7 +14,8 @@ Parser for thuban session files. __version__ = "$Revision: 1.55 $" -import string, os +import os +from string import atoi import xml.sax import xml.sax.handler @@ -35,7 +36,8 @@ from Thuban.Model.range import Range from Thuban.Model.classification import Classification, \ ClassGroupDefault, ClassGroupSingleton, ClassGroupRange, ClassGroupMap, \ ClassGroupProperties -from Thuban.Model.data import DerivedShapeStore, ShapefileStore +from Thuban.Model.data import DerivedShapeStore, ShapefileStore, \ + shapestore_registry from Thuban.Model.table import DBFTable from Thuban.Model.transientdb import TransientJoinedTable @@ -64,14 +66,14 @@ def parse_color(color): Color may be either 'None' or of the form '#RRGGBB' in the usual HTML color notation """ - color = string.strip(color) + color = color.strip() if color == "None": result = Transparent elif color[0] == '#': if len(color) == 7: - r = string.atoi(color[1:3], 16) / 255.0 - g = string.atoi(color[3:5], 16) / 255.0 - b = string.atoi(color[5:7], 16) / 255.0 + r = atoi(color[1:3], 16) / 255.0 + g = atoi(color[3:5], 16) / 255.0 + b = atoi(color[5:7], 16) / 255.0 result = Color(r, g, b) else: raise ValueError(_("Invalid hexadecimal color specification %s") @@ -378,9 +380,18 @@ class SessionLoader(XMLReader): ID = attrs["id"] filename = attrs["filename"] filetype = attrs["filetype"] - if filetype != "shapefile": + clazz = shapestore_registry.findClass(filetype) + if clazz is None: raise LoadError("shapesource filetype %r not supported" % filetype) - self.idmap[ID] = self.open_shapefile(filename) + + # TODO: We should better separate the task of finding the correct path + # and of loading a shape store. E.g. something like this: + # filename = fix_filename_path(filename) + + if clazz == ShapefileStore: + self.idmap[ID] = self.open_shapefile(filename) + else: + self.idmap[ID] = clazz(self.theSession, filename) def start_derivedshapesource(self, name, qname, attrs): attrs = self.check_attrs(name, attrs, Index: session.py =================================================================== RCS file: /thubanrepository/thuban/Thuban/Model/session.py,v retrieving revision 1.28 diff -u -3 -p -r1.28 session.py --- session.py 11 Mar 2004 21:04:30 -0000 1.28 +++ session.py 13 May 2005 07:07:08 -0000 @@ -303,8 +303,13 @@ class Session(TitledObject, Modifiable): The session only holds a weak reference to the shapestore, so it will automatically be removed from the session when the last reference goes away. + + If shapestore is None, this will be ignored. + + Returns: its shapestore parameter. """ - self._add_shapestore(shapestore) + if shapestore is not None: + self._add_shapestore(shapestore) return shapestore def TransientDB(self):