From loydms at yahoo.com Mon Jul 21 20:35:01 2008 From: loydms at yahoo.com (mark loyd) Date: Mon, 21 Jul 2008 11:35:01 -0700 (PDT) Subject: [Thuban-list] Opening a dbf Message-ID: <103443.37027.qm@web33403.mail.mud.yahoo.com> ? Hello, ? I am using Thuban version 1.2.1 win32 and get the following error?message when trying to open a dbf. (this dbf is not part of a shapefile but one that i am trying to open so that it may be joined to an attribute table of a shapefile) ? Traceback (most recent call last): ? File "thuban\buildthuban\out1.pyz/Thuban.UI.mainwindow", line 300, in invoke_command ? File "thuban\buildthuban\out1.pyz/Thuban.UI.command", line 121, in Execute ? File "thuban\buildthuban\out1.pyz/Thuban.UI.mainwindow", line 1075, in call_method ? File "thuban\buildthuban\out1.pyz/Thuban.UI.mainwindow", line 862, in TableOpen ? File "thuban\buildthuban\out1.pyz/Thuban.Model.session", line 279, in OpenTableFile ? File "thuban\buildthuban\out1.pyz/Thuban.Model.table", line 99, in __init__ KeyError: 3 ? Any help would be greatly appreciated. ? Also,?Is there a limit on the size of a dbf that can be opened? ? Thank you! ? Mark Loyd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.intevation.de/pipermail/thuban-list/attachments/20080721/6419b20f/attachment.html From antoniolenton at gmail.com Tue Jul 22 16:04:45 2008 From: antoniolenton at gmail.com (Anthony Lenton) Date: Tue, 22 Jul 2008 11:04:45 -0300 Subject: [Thuban-list] Opening a dbf In-Reply-To: <103443.37027.qm@web33403.mail.mud.yahoo.com> References: <103443.37027.qm@web33403.mail.mud.yahoo.com> Message-ID: Hello Mark, On Mon, Jul 21, 2008 at 3:35 PM, mark loyd wrote: > I am using Thuban version 1.2.1 win32 and get the following error message > when trying to open a dbf. (this dbf is not part of a shapefile but one that > i am trying to open so that it may be joined to an attribute table of a > shapefile) > > > > Traceback (most recent call last): > File "thuban\buildthuban\out1.pyz/Thuban.UI.mainwindow", line 300, in > invoke_command > File "thuban\buildthuban\out1.pyz/Thuban.UI.command", line 121, in Execute > File "thuban\buildthuban\out1.pyz/Thuban.UI.mainwindow", line 1075, in > call_method > File "thuban\buildthuban\out1.pyz/Thuban.UI.mainwindow", line 862, in > TableOpen > File "thuban\buildthuban\out1.pyz/Thuban.Model.session", line 279, in > OpenTableFile > File "thuban\buildthuban\out1.pyz/Thuban.Model.table", line 99, in > __init__ > KeyError: 3 > > > Any help would be greatly appreciated. > The KeyError here seems to be because the DBF you're trying to open contains boolean columns. Though the C part of dbflib supports reading and writing booleans, in the Python wrapper code there's only support for Ints, Doubles and Strings. I'm not sure if there's a good reason for not doing bools, but it seems like it's just something nobody ever got round to implementing. If nobody else is coding it I'll add it to my ToDo list, so stay tuned! :) > > Also, Is there a limit on the size of a dbf that can be opened? > Afaik only relative to the amount of memory on your machine. I've opened dbfs that were several megas large, but nothing really huge. > > > Thank you! > > > > Mark Loyd Cheers, -- Anthony Lenton Except - The good guys in software development http://except.com.ar From bernhard at intevation.de Thu Jul 24 11:15:08 2008 From: bernhard at intevation.de (Bernhard Reiter) Date: Thu, 24 Jul 2008 11:15:08 +0200 Subject: [Thuban-list] Opening a dbf In-Reply-To: References: <103443.37027.qm@web33403.mail.mud.yahoo.com> Message-ID: <200807241115.13047.bernhard@intevation.de> On Tuesday 22 July 2008 16:04, Anthony Lenton wrote: > The KeyError here seems to be because the DBF you're trying to open > contains boolean columns. Hmm, in this case: If you might use a different tool to change the boolean columns into something else (deleted them or Integers). I personally would try with Ooo Calc or KSpread. > Though the C part of dbflib supports > reading and writing booleans, in the Python wrapper code there's only > support for Ints, Doubles and Strings. > I'm not sure if there's a good reason for not doing bools, but it > seems like it's just something nobody ever got round to implementing. > If nobody else is coding it I'll add it to my ToDo list, so stay tuned! :) Note that the new shapelib code in Brams Unicode branch will probably also do dbf files better, so new developments should be based on it. So first making an entry in the tracker would be cool as well. ;) Do we have a short example dbf? Bernhard -- Managing Director - Owner: www.intevation.net (Free Software Company) Germany Coordinator: fsfeurope.org. Coordinator: www.Kolab-Konsortium.com. Intevation GmbH, Osnabr?ck, DE; Amtsgericht Osnabr?ck, HRB 18998 Gesch?ftsf?hrer Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner -------------- 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-list/attachments/20080724/a92107dd/attachment.bin