/[thuban]/branches/WIP-pyshapelib-Unicode/thuban/Thuban/Model
ViewVC logotype

Log of /branches/WIP-pyshapelib-Unicode/thuban/Thuban/Model

View Directory Listing Directory Listing


Sticky Revision:
(Current path doesn't exist after revision 2889)

Revision 2865 - Directory Listing
Modified Fri Sep 5 19:45:58 2008 UTC (16 years, 6 months ago) by bramz
Forward porting trunk rev (2834:2864] to WIP-pyshapelib-Unicode branch.

Revision 2839 - Directory Listing
Modified Thu Feb 14 00:19:14 2008 UTC (17 years ago) by bernhard
* Thuban/Model/table.py: Using internal_from_unicode() when reading
dbflib column names and unicode_from_internal() when writing them.

* test/test_load.py(TestNonAsciiColumnName), applied change rev2838 from
  test/test_load_1_0.py(TestNonAsciiColumnName),


Revision 2835 - Directory Listing
Modified Mon Feb 4 18:06:58 2008 UTC (17 years, 1 month ago) by bramz
Forward porting trunk (2819:2834] to WIP-pyshapelib-Unicode branch.

Revision 2808 - Directory Listing
Modified Wed Jan 16 15:37:58 2008 UTC (17 years, 1 month ago) by bramz
Forward porting trunk (2801:2807] to WIP-pyshapelib-Unicode branch. (previous merge was (2793:2801] instead of (2793:2793].

Revision 2801 - Directory Listing
Modified Tue Jan 8 23:32:59 2008 UTC (17 years, 1 month ago) by bramz
- various changes to pyshapelib (see libraries/pyshapelib/ChangeLog)
- forward porting shapelib
- updating setup.py for pyshapelib
- Thuban/Model/table.py creates LDID_ESRI_ANSI dbf files by default

Revision 2797 - Directory Listing
Modified Sat Dec 15 20:40:22 2007 UTC (17 years, 2 months ago) by bramz
start of pyshapelib Unicode support mark II.  It now also reads the .CPG file so that UTF-8 encodings can be used.  Thuban will now create UTF-8 DBF files by default.  See ChangeLogs

Revision 2789 - Directory Listing
Modified Wed Dec 5 18:59:32 2007 UTC (17 years, 3 months ago) by bramz
made a copy

Revision 2787 - Directory Listing
Modified Wed Nov 28 13:54:17 2007 UTC (17 years, 3 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
Databaseconnections: some fixes.

* Thuban/Model/postgisdb.py(_fetch_table_information()): also
quote the tablename, which otherwise would not work when there is
a "_" in the table name. It probably is a good idea anyway.

* Thuban/UI/dbdialog.py(ChooseDBTableDialog.GetTable()): transform
some resulting strings into internal encoding.

* Thuban/UI/mainwindow.py(AddDBLayer()): print a traceback to stderr
if the dataconnection fails to help analysing when there is a problem.

* Extensions/ogr/ogrdialog.py: Fixed some wx calls building the dialog.


Revision 2774 - Directory Listing
Modified Fri Jun 22 22:14:15 2007 UTC (17 years, 8 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
INCOMPATIBLE CHANGE with Thuban 1.1 (development series) and 1.2.0:
Changing the raster layer attributes towards always 
using an alpha channel. As we require wx2.6 there is no real use-case 
for bitmap and this fixes a problem on the windows platform.

* NEWS: adding note about the major change using alpha always.

* Thuban/UI/renderer.py: Removed diversion for wx <2.5.3 as 
we require >= 2.6 now. Bumping copyright, adding author Bernhard.

* Thuban/UI/rasterlayerproperties.py: Removed diversion for
wx <2.5.3 as we require >= 2.6 now, so we always can do alpha channel. 
Added author Bernhard Reiter and copyright year 2007. 
Removed two old code lines which were commented out.
Commented out the code for the mask type selection.

* Thuban/Model/layer.py: Made masktype = MASK_ALPHA default for new
raster images. Bumping copyright.

* test/test_layer.py: made test_raster_layer() expect MASK_ALPHA.
Bumping copyright.

* Thuban/Model/load.py: if there is no masktype set, use alpha.
This means the behaviour changes for files saved with Thuban-1.1,
but this has been a development version. As bitmap does not work
on some platforms (windows currently) it will even fix a problem 
there. Bumping copyright

* test/test_load.py: Removed masktype from example file. Bumping
copyright.

* Thuban/Model/save.py: Do not save raster attribute "masktype" 
anymore. Bumping copyright.

* test/test_save.py: Not expecting "masktype" to be saved anymore.
Bumping copyright.


Revision 2768 - Directory Listing
Modified Wed May 9 22:06:29 2007 UTC (17 years, 9 months ago) by dpinte
Original Path: trunk/thuban/Thuban/Model
2007-05-10  Didrik Pinte <dpinte@itae.be>

    Migration to psycopg2 to support UTF8 environments

    * Thuban/Model/postgisdb.py : psycopg2 migration
    * test/postgissupport.py, test_postgis_db.py : psycopg2 migration



Revision 2756 - Directory Listing
Modified Fri Apr 13 10:43:14 2007 UTC (17 years, 10 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
* test/localessupport.py: replaced getlocale with setlocale
because of a python problem that the output of getlocale cannot
be used as input of setlocale in all cases. python 2.3 2.4 2.5
had the problem, see
sf[ 1699853 ] locale.getlocale() output fails as setlocale() input
https://sourceforge.net/tracker/index.php?func=detail&aid=1699853&group_id=5470&atid=105470
Did some minor formatting. Added German_Germany.1252 encoding 
from window XP experiments to try.

* Thuban/Model/proj.py: replaced getlocale with setlocale.
This avoids an exception on windows xp sp2 German. But it does
not fix the raster display problem. The second attempt of setlocale
can be removed.


Revision 2710 - Directory Listing
Modified Tue Oct 10 08:31:44 2006 UTC (18 years, 4 months ago) by dpinte
Original Path: trunk/thuban/Thuban/Model
2006-10-10 Didrik Pinte <dpinte@itae.be>
    * Thuban/Model/layer.py (Layer.GetLabelPosFromShape): new method 
        extracted from Thuban/UI/viewport.py
    * Thuban/UI/viewport.py (Viewport.LabelShapeAt): uses new method



Revision 2708 - Directory Listing
Modified Sun Sep 24 20:01:23 2006 UTC (18 years, 5 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/proj.py(_do_we_have_to_work_around_broken_proj): 
Making the test more robust for observed python 2.3 problems
with setlocale().


Revision 2699 - Directory Listing
Modified Mon Sep 18 13:59:40 2006 UTC (18 years, 5 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
Improved documentation.


Revision 2698 - Directory Listing
Modified Mon Sep 18 00:56:26 2006 UTC (18 years, 5 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
Fixed behaviour with the proj bug and python >=2.4 
when decimal_point != '.'. So de_DE locales will work fine again.


Revision 2688 - Directory Listing
Modified Fri Jun 30 12:27:20 2006 UTC (18 years, 8 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
New Classification "Pattern": Classify text attributes by regexp.

Revision 2682 - Directory Listing
Modified Mon May 15 20:11:15 2006 UTC (18 years, 9 months ago) by dpinte
Original Path: trunk/thuban/Thuban/Model
2006-05-15 Didrik Pinte <dpinte@itae.be>
    Ashamed ... still some tabs in the files

    * Thuban/version.py : tabs removed
    * Thuban/Model/transientdb.py : tabs removed
        


Revision 2681 - Directory Listing
Modified Mon May 15 16:11:46 2006 UTC (18 years, 9 months ago) by dpinte
Original Path: trunk/thuban/Thuban/Model
2006-05-15 Didrik Pinte <dpinte@itae.be>
  * Thuban/version.py : coding style correction
  * Thuban/Model/transientdb.py : coding style correction
    


Revision 2680 - Directory Listing
Modified Mon May 15 14:36:50 2006 UTC (18 years, 9 months ago) by dpinte
Original Path: trunk/thuban/Thuban/Model
2006-05-15 Didrik Pinte <dpinte@itae.be>
  * Thuban/version.py : Updated imports to support pysqlite2

  * Thuban/Model/transientdb.py : Updated imports to support pysqlite2
    Patched the querying system to support the param style of pysqlite2

--Cette ligne,

M    thuban/Thuban/Model/transientdb.py
M    thuban/Thuban/version.py
M    thuban/ChangeLog


Revision 2659 - Directory Listing
Modified Wed Jul 27 21:51:31 2005 UTC (19 years, 7 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_layer): Don't write any attributes anymore for
the layer element.
(SessionSaver.write_classification): Even if there is no classification
field, still write the classification because the clnull (default)
symbol will not be defined anymore as part of the layer element.


Revision 2658 - Directory Listing
Modified Wed Jul 27 21:50:30 2005 UTC (19 years, 7 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_classification): Change attribute 'field' and
'field_type' from obligatory to optional to allow empty classes
(ie.  only with a default=clnull).


Revision 2657 - Directory Listing
Modified Wed Jul 27 21:49:25 2005 UTC (19 years, 7 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Classification.TreeItem.build_info): Added output of size.


Revision 2644 - Directory Listing
Modified Tue Jul 5 16:30:51 2005 UTC (19 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer.__mangle_bounding_box)
(Layer.ClipBoundingBox): Rename ClipBoundingBox to
__mangle_bounding_box.  See the comments in the code and RT #2845

* test/test_layer.py (TestLayer.test_arc_layer_with_projection):
Remove the explicit test of ClipBoundingBox.  The method isn't
public anymore and the direct call in the test wasn't necessary in
the first place.  If ClipBoundingBox (now __mangle_bounding_box)
isn't called, the return value of ShapesInRegion will be
different.


Revision 2642 - Directory Listing
Modified Fri Jul 1 20:49:04 2005 UTC (19 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
First step towards unicode.  With this roughly we're at step 1
string_representation.txt

* Doc/technotes/string_representation.txt: New.  Document how
strings are represented in Thuban and how to get to a Unicode
Thuban.

* Thuban/__init__.py (set_internal_encoding)
(unicode_from_internal, internal_from_unicode): New. The first few
functions for the internal string representation

* Thuban/UI/about.py (unicodeToLocale): Removed.  Use
internal_from_unicode instead.

* Thuban/UI/__init__.py (install_wx_translation): Determine the
encoding to use for the internal string representation.  Also,
change the translation function to return strings in internal
representation even on unicode builds of wxPython

* Thuban/Model/load.py (SessionLoader.check_attrs): Decode
filenames too.
(SessionLoader.start_clrange): Use check_attrs to decode and check
the attributes.

* Thuban/Model/xmlreader.py (XMLReader.encode): Use
internal_from_unicode to convert unicode strings.

* Thuban/Model/xmlwriter.py (XMLWriter.encode): Use
unicode_from_internal when applicable

* test/runtests.py (main): New command line option:
internal-encoding to specify the internal string encoding to use
in the tests.

* test/support.py (initthuban): Set the internal encoding to
latin-1

* test/test_load.py (TestSingleLayer.test, TestClassification.test)
(TestLabelLayer.test): Use the internal string representation when
dealing with non-ascii characters

* test/test_load_1_0.py (TestSingleLayer.test)
(TestClassification.test, TestLabelLayer.test): Use the internal
string representation when dealing with non-ascii characters

* test/test_load_0_9.py (TestSingleLayer.test)
(TestClassification.test): Use the internal string representation
when dealing with non-ascii characters

* test/test_load_0_8.py (TestUnicodeStrings.test): Use the
internal string representation when dealing with non-ascii
characters

* test/test_save.py (XMLWriterTest.testEncode)
(SaveSessionTest.testClassifiedLayer): Use the internal string
representation when dealing with non-ascii characters where
applicable


Revision 2623 - Directory Listing
Modified Mon May 9 18:12:12 2005 UTC (19 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* 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.


Revision 2616 - Directory Listing
Modified Fri May 6 14:17:29 2005 UTC (19 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_layer): Added code to save the opacity and mask type of a
layer.


Revision 2615 - Directory Listing
Modified Fri May 6 14:17:03 2005 UTC (19 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_rasterlayer): Added code to read the opacity and mask
type of the layer and construct a new layer with the additional parameters.


Revision 2614 - Directory Listing
Modified Fri May 6 14:16:38 2005 UTC (19 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(RasterLayer): Added opacity and masktype parameters to the constructor, and
set the appropriate variables to those values.


Revision 2606 - Directory Listing
Modified Wed Apr 27 11:05:19 2005 UTC (19 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
Replace ShapefileStore by FileShapeStore.
(SessionSaver.write_data_containers): Only use methods of the
base class FileShapeStore.


Revision 2605 - Directory Listing
Modified Wed Apr 27 11:04:56 2005 UTC (19 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
Various small fixes in doc-strings.
(FileShapeStore): New class.
(ShapefileStore): Derive from FileShapeStore.
(ShapefileStore.__init__): Call __init__ of FileShapeStore,
rename self.table to self._table, initialize self._bbox
(ShapefileStore._open_shapefile): Use self._bbox instead of self.bbox
and self.FileName() instead of self.filename.
(ShapefileStore.Table): Use self._table instead of self.table.
(ShapefileStore.FileName): Removed (moved to FileShapeStore).
(ShapefileStore.BoundingBox):  Use self._bbox instead of self.bbox.


Revision 2587 - Directory Listing
Modified Wed Mar 23 15:30:27 2005 UTC (19 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Add support for adjusting the opacity of a raster layer.


Revision 2569 - Directory Listing
Modified Thu Feb 17 11:02:28 2005 UTC (20 years ago) by jan
Original Path: trunk/thuban/Thuban/Model
Fixed doc-strings to comply with coding_guidelines.


Revision 2564 - Directory Listing
Modified Wed Feb 16 23:14:35 2005 UTC (20 years ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Map, Map.Destroy, Map.RemoveLayer, Map.ClearLayers,
Map.Layers, Map.HasLayers, Map.MoveLayerToTop,
Map.RaiseLayer, Map.LowerLayer, Map.MoveLayerToBottom,
Map.ProjectedBoundingBox, Map.GetProjection): Improved/added
doc string.
(Map.BoundingBox): Removed superfluous test for label_layer
and improved doc string.
(Map.TreeInfo): Added label_layer and improved sdo string.


Revision 2563 - Directory Listing
Modified Wed Feb 16 23:13:19 2005 UTC (20 years ago) by jan
Original Path: trunk/thuban/Thuban/Model
Added import of _.
(Label, Label.__init__): Improved/added doc string.
LabelLayer, LabelLayer.__init__, LabelLayer.Labels,
LabelLayer.RemoveLabel, LabelLayer.ClearLabels):
Improved/added doc string.
(LabelLayer.AddLabel): Use already defined names for
align strings and improved doc string.
(LabelLayer.TreeInfo): New. Return the object data for
the tree view.


Revision 2562 - Directory Listing
Modified Wed Feb 16 21:14:47 2005 UTC (20 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Further wxPython 2.5 changes using patches from Daniel Calvelo Aros
so that that wxproj doesn't crash. Added GUI support for selecting
alpha channel (opacity can't be selected yet).


Revision 2552 - Directory Listing
Modified Fri Jan 28 15:54:00 2005 UTC (20 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Make layer's use_mask flag default to true. Support a bit array describing
the mask to use. Improve error handling in ProjectRasterFile (also addresses
RT #2947).


Revision 2551 - Directory Listing
Modified Thu Jan 27 14:19:41 2005 UTC (20 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Add a new dialog box for raster layers. The dialog box allows
the user to toggle a mask that is generated by ProjectRasterFile
and is used to only draw the real parts of the projected image.


Revision 2472 - Directory Listing
Modified Thu Dec 16 15:18:57 2004 UTC (20 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
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.


Revision 2451 - Directory Listing
Modified Mon Dec 13 17:51:11 2004 UTC (20 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* 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


Revision 2449 - Directory Listing
Modified Mon Dec 13 13:37:40 2004 UTC (20 years, 2 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
Updated docstring for SessionLoader.open_shapefile


Revision 2446 - Directory Listing
Modified Mon Dec 13 11:52:34 2004 UTC (20 years, 2 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
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).


Revision 2441 - Directory Listing
Modified Thu Dec 9 10:50:34 2004 UTC (20 years, 2 months ago) by joey
Original Path: trunk/thuban/Thuban/Model
Added missing character encoding so that Python doesn't barf upon
evaluating this file


Revision 2413 - Directory Listing
Modified Mon Nov 22 11:16:35 2004 UTC (20 years, 3 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/base.py (UnsetModified):
Fixed some typos in docstring.

* Thuban/UI/baserenderer.py (BaseRenderer.draw_polygon_shape()):
Added hints on the used algorithm for handling holes.


Revision 2385 - Directory Listing
Modified Thu Oct 7 14:28:51 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(CustomRamp.GetProperties): Added size gradient.


Revision 2384 - Directory Listing
Modified Thu Oct 7 14:24:24 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
put Id and Source to the usual place


Revision 2383 - Directory Listing
Modified Thu Oct 7 14:19:48 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_classification): Write attribute 'size' for cldata
when the shape layer is of point type. This also now make the
test_load.py tests happy.


Revision 2375 - Directory Listing
Modified Sun Oct 3 21:05:30 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_cldata): Also parse the size attribute.


Revision 2374 - Directory Listing
Modified Sun Oct 3 21:01:31 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
Removed some trailing whitespaces.
(ClassGroupProperties.__init__): Set default size.
(ClassGroupProperties.SetProperties): Set the size.
(ClassGroupProperties.GetSize): New. Return the size.
(ClassGroupProperties.SetSize): New. Set the size.
(ClassGroupProperties__eq__): Compare also size.
(ClassGroupProperties__repr__): Print also size.


Revision 2355 - Directory Listing
Modified Tue Sep 28 19:20:35 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Extension): Improved doc-string.


Revision 2343 - Directory Listing
Modified Mon Sep 20 08:13:32 2004 UTC (20 years, 5 months ago) by bernhard
Original Path: trunk/thuban/Thuban/Model
Fixed typos in docstrings.


Revision 2339 - Directory Listing
Modified Fri Aug 20 16:59:21 2004 UTC (20 years, 6 months ago) by silke
Original Path: trunk/thuban/Thuban/Model
Fix bug in projection handling of layers


Revision 2228 - Directory Listing
Modified Thu Jun 3 15:17:54 2004 UTC (20 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Layer.TreeInfo): Convert the bounding box
to a tuple before using it as arguments to the % operator.  This
fixes the formatting issue filed in RT#2239 on 2004-01-13 and
reported today on thuban-list by Jan Schüngel


Revision 2106 - Directory Listing
Modified Fri Mar 12 12:59:33 2004 UTC (20 years, 11 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Support views in addition to normal tables in the postgis shapestore

* Thuban/Model/postgisdb.py
(PostGISShapeStore._fetch_table_information): Add a fallback for
the case where the table name is not in the geometry_columns
table.  This is usually the case for views.  Also, set
self.shapestore here.
(PostGISShapeStore.ShapeType): No need to query the database all
the time.  The shape type is now determined in
_fetch_table_information

* test/postgissupport.py (PostgreSQLServer.new_postgis_db)
(PostgreSQLServer.get_static_data_db, PostGISDatabase.__init__):
New parameter to specify views.
(PostGISDatabase.has_data): Also compare the views.  New views
parameter
(PostGISDatabase.initdb): Create the views.
(PostgreSQLServer.get_default_static_data_db): Add the v_landmarks
view

* test/test_postgis_db.py
(TestPostGISShapestorePointFromViews): New.  Test a
PostGISShapeStore with a view
(TestPostGISShapestorePointOIDAsGIDColumn.setUp): Pass the name of
the geometry_column explicitly to test whether that works


Revision 2104 - Directory Listing
Modified Fri Mar 12 12:19:15 2004 UTC (20 years, 11 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Final step for explicit id/geometry columns: Loading and saving

* Resources/XML/thuban-1.1.dtd: New.  Derived from thuban-1.0.dtd
with the following changes:
(dbshapesource): Two new attributes id_column and geometry_column

* Thuban/Model/save.py (SessionSaver.write): Use the new dtd
(SessionSaver.write_session): Use the new namespace
(SessionSaver.write_data_containers): Write the new dbshapesource
parameters

* Thuban/Model/load.py (SessionLoader.__init__): New namespace for
the new file format version
(SessionLoader.start_dbshapesource): Handle the new db parameters

* test/test_save.py: Update to the new dtd and namespace
(SaveSessionTest.test_save_postgis): Update the NonConnectionStore
mock object to provide a working IDColumn method.

* test/test_load_1_0.py: New.  Copy of the test_load.py before
today's changes but with the round-trip tests removed.

* test/test_load_0_9.py: Update doc-string.

* test/test_load.py: Update all .thuban files to the new dtd and
namespace.
(TestPostGISLayer.file_contents): Add the new dbshapesource
paramters


Revision 2102 - Directory Listing
Modified Thu Mar 11 21:04:30 2004 UTC (20 years, 11 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/UI/dbdialog.py (ChooseDBTableDialog.__init__): Rework how
the dialog is constructed. Add combo boxes to select id and
geometry column.  Rename some instance variables.
(ChooseDBTableDialog.GetTable): Return id and geometry column
names
(ChooseDBTableDialog.OnTableSelect): New. Event handler for
selections in the table list

* Thuban/UI/mainwindow.py (MainWindow.AddDBLayer): Use id_column
and geometry_column

* Thuban/Model/session.py (Session.OpenDBShapeStore): Add the new
parameters for id_column and geometry column of PostGISShapeStore
here as well.

* Thuban/Model/postgisdb.py (type_map): Add ROWID psycog type.
(_raw_type_map): New. Map raw PostgreSQL type ints to thuban types
(PostGISConnection.GeometryTables): Use a better query to
determine which relations in the database might be usable for
shapestores.  Now supports views as well but is more PostgreSQL
specific
(PostGISConnection.table_columns): New. Somewhat experimental
method to let the db dialogs provide lists of columns to users so
that they can select id and geometry columns.
(PostGISTable.__init__): The default value of the id_column
parameter is now None it still means "gid" effectively, though.
(PostGISTable.IDColumn): New introspection method to return a
column object for the id column
(PostGISShapeStore.GeometryColumn): New introspection method to
return a column object for the geometry column

* test/test_postgis_db.py
(TestPostGISConnection.test_gis_tables_non_empty):
Removed. Subsumed by the new:
(TestPostGISConnection.test_gis_tables_with_views_and_tables):
New. Tes the GeometryTables and table_columns methods with actual
tables and views.
(PointTests.test_id_column, PointTests.test_geometry_column):
New. tests for the new methods.
(TestPostGISShapestorePoint.setUp)
(TestPostGISShapestorePointSRID.setUp)
(TestPostGISShapestorePointExplicitGIDColumn.setUp): Fill the
instance variables needed by the new tests


Revision 2096 - Directory Listing
Modified Thu Mar 11 13:50:53 2004 UTC (20 years, 11 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py (PostGISTable.__init__): New parameter
id_column to specify which column to use to identify rows.  Also
new instance variables id_column and quoted_id_column
(PostGISTable.RowIdToOrdinal, PostGISTable.RowOrdinalToId)
(PostGISTable.ReadRowAsDict, PostGISTable.ReadValue)
(PostGISTable.SimpleQuery): Use the id column name provided to the
constructor instead of "gid"
(PostGISShapeStore.__init__): New parameter id_column analogously
to PostGISTable.__init__.  This parameter is simply passed through
to the base class constructor
(PostGISShapeStore._create_col_from_description): Fix typo in
doc-string
(PostGISShapeStore.Shape, PostGISShapeStore.AllShapes)
(PostGISShapeStore.ShapesInRegion): Use the id column name
provided to the constructor instead of "gid"

* test/postgissupport.py
(PostgreSQLServer.get_default_static_data_db): New static table
landmarks_point_id with an id column != "gid.  Update the comments
a bit.
(skip_if_addgeometrycolumn_does_not_use_quote_ident): Fix typo in
doc-
(upload_shapefile): New parameter gid_column to use a name other
than "gid" for the column to store the shape ids

* test/test_postgis_db.py (TableTests): New.  Mixin-class
containing all tests previously in TestPostGISTable.  The actual
tests are the same but the code is a bit more configurable to
allow for different id columns etc.
(TestPostGISTable): Derive from TableTests now for the actual
tests.
(TestPostGISTableExplicitGIDColumn): New. Like TestPostGISTable
except that it the landmarks_point_id table to test the id_column
parameter
(PointTests): Extend the doc-string
(TestPostGISShapestorePointExplicitGIDColumn)
(TestPostGISShapestorePointOIDAsGIDColumn): New classes derived
from PointTests to test the explicit id_column parameter.  One
tests with the name of the column holding the shape ids, the other
uses PostgreSQL's OID column.  For the latter a number of methods
have to be overwritten to make them independent of the actual id
values.


Revision 2059 - Directory Listing
Modified Wed Feb 11 09:05:40 2004 UTC (21 years ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py
(PostGISTable._fetch_table_information): Delegate the creation of
column objects to a different method so that we can extend that in
derived classes
(PostGISTable._create_col_from_description): New. Column object
creation part of _fetch_table_information
(PostGISShapeStore._create_col_from_description): New. Extend
inherited method to handle geometry columns
(PostGISShapeStore.__init__): New parameter geometry_column to
specify which geometry column to use.  Optional but mandatory for
tables with more than one geometry column
(PostGISShapeStore._fetch_table_information): Also use the name of
the geometry column when looking for the srid
(PostGISShapeStore.ShapeType): Also use the name of the geometry
column when looking for the shape type

* test/test_save.py (SaveSessionTest.test_save_postgis): Adapt
NonConnectionStore to changes in the PostGISShapeStore

* test/test_postgis_db.py
(TestPostGISSpecialCases.test_shapestore_two_geom_cols): Test
PostGISShapeStore with tables having two geometry columns.


Revision 2057 - Directory Listing
Modified Tue Feb 10 15:51:57 2004 UTC (21 years ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py (quote_identifier): Fix typo in
doc-string
(PostGISShapeStore._fetch_table_information): New. Extend
inherited method to retrieve srid
(PostGISShapeStore.BoundingBox): Handle tables without data.
extent yields NULL for those
(PostGISShapeStore.ShapesInRegion): Use the srid of the table.

* test/test_postgis_db.py
(TestPostGISSpecialCases.test_shapestore_empty_table): New test
for the special case of a table without any data
(TestPostGISShapestorePointSRID): New class with tests for a table
that uses srids
(PolygonTests): Fix a doc-string typo

* test/postgissupport.py (PostGISDatabase.__init__): New parameter
reference_systems with a specification of spacial reference
systems to create in the new db.
(PostgreSQLServer.new_postgis_db)
(PostgreSQLServer.get_static_data_db): New parameter
reference_systems to be passed through ultimately to
PostGISDatabase.  In new_postgis_db also check whether an existing
db already has the right srids
(PostgreSQLServer.get_default_static_data_db): Add srids and a
table that uses srids
(PostGISDatabase.initdb): Create the entries for the reference
systems
(PostGISDatabase.has_data): Add reference_systems parameter to
check for those too
(upload_shapefile): New parameter srid to create tables with a
specific srid


Revision 2036 - Directory Listing
Modified Mon Dec 22 17:49:43 2003 UTC (21 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* setup.py (setup call): 1.0.0, yeah!

* Thuban/version.py (longversion): 1.0.0, yeah!

* Thuban/Model/load.py (SessionLoader.__init__): Accept the
1.0.0 namespace too

* Thuban/Model/save.py (SessionSaver.write_session): Save with
1.0.0 namespace

* test/test_load.py (LoadSessionTest.dtd)
(TestSingleLayer.file_contents)
(TestNonAsciiColumnName.file_contents)
(TestLayerVisibility.file_contents)
(TestClassification.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestLabelLayer.file_contents, TestPostGISLayer.file_contents)
(TestPostGISLayerPassword.file_contents)
(TestLoadError.file_contents, TestLoadError.test): Update for
1.0.0 namespace

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table)
(SaveSessionTest.test_save_postgis): Update for 1.0.0 namespace


Revision 2034 - Directory Listing
Modified Mon Dec 22 16:35:16 2003 UTC (21 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/load.py (SessionLoader.start_label): Make sure the
alignment flags are byte strings not unicode and that they have
valid values

* test/test_load.py (TestLabelLayer): New. Test loading (and
indirectly saving) of maps with labels.


Revision 2004 - Directory Listing
Modified Tue Dec 2 13:25:55 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/save.py (SessionSaver.write_session): Save files
with the thuban-1.0rc1

* Thuban/Model/load.py (SessionLoader.__init__): Recognize the
thuban-1.0rc1 namespace too

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table)
(SaveSessionTest.test_save_postgis): Update to thuban-1.0rc1
namespace

* test/test_load.py (LoadSessionTest.dtd): Update to thuban-1.0rc1
namespace
(TestSingleLayer.file_contents)
(TestNonAsciiColumnName.file_contents)
(TestLayerVisibility.file_contents)
(TestClassification.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestPostGISLayer.file_contents)
(TestPostGISLayerPassword.file_contents)
(TestLoadError.file_contents, TestLoadError.test): Update to
thuban-1.0rc1 namespace


Revision 1989 - Directory Listing
Modified Fri Nov 28 12:00:54 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Unify the filenames stored in .thuban files so that the .thuban
files are more platform independend

* Thuban/Model/save.py (unify_filename): New. Unify filenames so
that they can be used on both windows and unix
(SessionSaver.prepare_filename): New. Handle all filename
transformations for filenames stored in the thuban file
(SessionSaver.write_data_containers, SessionSaver.write_layer):
Use prepare_filename

* test/test_save.py (SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table): Filenames are always stored
with slashes on all currently supported platforms so adapt all
tests to this

* test/test_load.py (LoadSessionTest.filenames): With the new
filename scheme the filenames in the tests should be
understandable on all currently supported platforms so we turn
this into an empty list because we don't have to normalize them
anymore


Revision 1983 - Directory Listing
Modified Thu Nov 27 15:57:23 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer.LatLongBoundingBox)
(Layer.ShapesBoundingBox, RasterLayer.LatLongBoundingBox): Use the
new InverseBBox method to determine the unprojected bounding box
(Layer.ShapesInRegion): Use the ForwardBBox method to project the
bbox.

* test/test_layer.py (TestLayer.test_point_layer_with_projection):
Removed.
(TestLayer.test_arc_layer_with_projection): New. This test is
better able to test whether bounding boxes are projected correctly
than test_point_layer_with_projection


Revision 1982 - Directory Listing
Modified Thu Nov 27 15:25:34 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/proj.py (Projection.InverseBBox): New. Inverse
version of ForwardBBox
(Projection._transform_bbox): New. common implementation of
ForwardBBox and InverseBBox
(Projection.ForwardBBox): Use _transform_bbox.

* test/test_proj.py (TestProjection.test): Add test for
InverseBBox


Revision 1978 - Directory Listing
Modified Tue Nov 25 14:30:34 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Layer.__getattr__): Removed. It was only
there for backwards compatibility and all code relying on that
should have been updated by now.


Revision 1972 - Directory Listing
Modified Mon Nov 24 19:23:08 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(ShapefileStore._open_shapefile)
(ShapefileStore.__init__): Factor opening the shapefile into a
separate method (the new _open_shapefile). This makes the code a
bit more readable but the real reason is that it makes some evil
hacks easier. :-)


Revision 1970 - Directory Listing
Modified Mon Nov 24 18:36:00 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/load.py (SessionLoader.check_attrs): If no
converter is specified for an attribute assume it's a string
containing only Latin1 characters. Update doc-string accordingly.
This change should fix many places where unicode objects might
accidentally enter Thuban.

* test/test_load.py (TestNonAsciiColumnName): New test to check
what happens with column names in DBF files that contain non-ascii
characters


Revision 1968 - Directory Listing
Modified Fri Nov 21 14:33:27 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Enable the experimental attribute editing again and introduce a
command line switch to actually activate it

* Thuban/UI/main.py (options): New. Container for options set on
the commmand line
(main): Add the --enable-attribute-editing flag.

* Thuban/UI/identifyview.py (IdentifyView.__init__): If attribute
editing is enabled use the grid ctrl which allows editing of the
values

* Thuban/Model/transientdb.py (AutoTransientTable.write_record):
New. Just delegate this to the underlying table.


Revision 1964 - Directory Listing
Modified Wed Nov 19 19:48:47 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/resource.py: Rework the way gdal support is
determined so that we can give a reason in the about why gdal is
not supported.
(gdal_support_status): New. Variable holding a string with the
reason for no gdal support

* Thuban/UI/about.py (About.__init__): Add the reason why gdal is
not supported to the message


Revision 1961 - Directory Listing
Modified Wed Nov 19 15:46:03 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/table.py (OldTableInterfaceMixin): Removed.
(DBFTable, MemoryTable): Do not derive from OldTableInterfaceMixin
anymore

* Thuban/Model/transientdb.py (TransientTableBase)
(AutoTransientTable): Do not derive from OldTableInterfaceMixin
anymore

* test/test_table.py: Removed since the old interface it tests is
gone.


Revision 1955 - Directory Listing
Modified Tue Nov 18 15:37:31 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(PostGISConnection.MatchesParameters):
New. Test whether the connection matches a set of connection
parameters


Revision 1946 - Directory Listing
Modified Thu Nov 13 18:56:41 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Quote table and column names properly for postgis.

(quote_identifier): New. Function to
quote an identifier for use in an sql statement
(PostGISColumn.__init__): Add the quoted_name attribute
(PostGISTable.__init__): New instance variable quoted_tablename
(PostGISTable._fetch_table_information): Use the quoted table
name. New isntance variable quoted_geo_col with a quoted version
of geometry_column
(PostGISTable.NumRows, PostGISTable.RowIdToOrdinal)
(PostGISTable.RowOrdinalToId): Use the quoted table name
(PostGISTable.ReadValue, PostGISTable.ValueRange)
(PostGISTable.UniqueValues, PostGISTable.SimpleQuery)
(PostGISShapeStore.BoundingBox, PostGISShapeStore.Shape)
(PostGISShapeStore.AllShapes, PostGISShapeStore.ShapesInRegion):
Use quoted table and column names


Revision 1940 - Directory Listing
Modified Tue Nov 11 18:27:39 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(EPSG_DEPRECATED_PROJ_FILE): New.
Constant for the file woth deprecated epsg projections
(get_system_proj_file): Update doc-string


Revision 1933 - Directory Listing
Modified Tue Nov 11 16:37:53 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/resource.py (get_system_proj_file): Add a filename
parameter so that this function can be used for all proj files in
Resource/Projections
(DEFAULT_PROJ_FILE, EPSG_PROJ_FILE): New. Predefined filenames for
get_system_proj_file

* Thuban/UI/projdialog.py (ProjFrame.__init__): Instead of one
ProjFile self.__sysProjFile use a dictionary of system ProjFile
objects self._sys_proj_files
(ProjFrame.build_dialog): Adapt to the new changes in the
ProjectionList constructor. Add a check button to toggle whether
EPSG projections are shown
(ProjFrame._OnShowEPSG): New. Handler for the epsg check button
events.
(ProjFrame.load_user_proj, ProjFrame.load_system_proj): Only show
the busy cursor if the files have not yet been loaded by the
dialog.
(ProjFrame.load_system_proj): Add a parameter for the name of the
proj file. Maintain the dictionary of system projections
self._sys_proj_files

* Thuban/UI/projlist.py (ProjectionList): Merge the system_projs,
user_projs parameters into one parameter proj_files which is a
list of proj files.
(ProjectionList._subscribe_proj_files)
(ProjectionList._unsubscribe_proj_files): New. Move
subscription/unsubscription of projfile messages to separate
methods
(ProjectionList.Destroy): The unsubscribe is now done in
_unsubscribe_proj_files
(ProjectionList.update_projections): We now have a list of proj
file objects
(ProjectionList.SetProjFiles): New method to set a new list of
proj file objects

* test/test_proj.py (ProjFileReadTests.test_get_system_proj_file):
Specify explicitly which system proj file to load.


Revision 1930 - Directory Listing
Modified Tue Nov 11 13:24:41 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.Destroy): New. Clear all
instance variables to cut cyclic references. The GC would have
collected the loader eventually but it can happen that it doesn't
run at all until thuban is closed (2.3 but not 2.2 tries a bit
harder and forces a collection when the interpreter terminates)
(load_session): Call the handler's Destroy method to make sure
that it gets garbage collected early. Otherwise it will be
collected very late if at all and it holds some references to e.g.
shapestores and the session which can lead to leaks (of e.g. the
temporary files)


Revision 1923 - Directory Listing
Modified Fri Nov 7 12:07:01 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Tweak the usage of the sqlite database to make common use cases
more responsive. In most cases copying the data to the sqlite
database takes so long that using sqlite doesn't have enough
advantages.

(TransientTableBase.ValueRange): Add
comments about performance and query the min and max in separate
statements because only that way will indexes be used.
(TransientTableBase.UniqueValues): Add some comments about
performance.
(AutoTransientTable.ValueRange, AutoTransientTable.UniqueValues):
Do not copy the data to the transient DB but use the transient
copy if it exists. See the new comments for the performance trade
offs


Revision 1921 - Directory Listing
Modified Mon Nov 3 18:42:27 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(ShapefileStore.ShapesInRegion): Bind some
globals to locals so that it's a bit faster


Revision 1919 - Directory Listing
Modified Mon Nov 3 17:33:36 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(DBFTable.ReadValue): Use the new
read_attribute method of the dbf objects


Revision 1912 - Directory Listing
Modified Mon Nov 3 13:55:41 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Classification.__getattr__)
(Classification._compile_classification)
(Classification._clear_compiled_classification): New. Methods to
manage a 'compiled' representation of the classification groups
which is created on demand
(Classification.InsertGroup, Classification.RemoveGroup)
(Classification.ReplaceGroup): reset the compiled representation
(Classification.FindGroup): Use the compiled representation to
find the matching group
(ClassGroupRange.GetRangeTuple): New. Return the range as a tuple


Revision 1909 - Directory Listing
Modified Fri Oct 31 18:16:34 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Classification.SetDefaultGroup):
Send a CLASS_CHANGED message
(Classification.RemoveGroup): Send a CLASS_CHANGED message and do
not return the removed group since it wasn't used.


Revision 1886 - Directory Listing
Modified Thu Oct 30 09:21:54 2003 UTC (21 years, 4 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
Replaced string replace function by corresponding string method.


Revision 1860 - Directory Listing
Modified Fri Oct 24 16:01:39 2003 UTC (21 years, 4 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Projection.GetProjectedUnits): Added 'longlat' as alias for 'latlong'.


Revision 1844 - Directory Listing
Modified Tue Oct 21 10:49:44 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.__init__): Also accept the
thuban-1.0-dev.dtd namespace
(SessionLoader.check_attrs): Allow a callable object as conversion
too
(SessionLoader.start_projection, SessionLoader.end_projection)
(SessionLoader.start_parameter): Handle the epsg attribute and
rename a few instance variables to lower case


Revision 1843 - Directory Listing
Modified Tue Oct 21 10:49:38 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write)
(SessionSaver.write_session): Use the 1.0 dtd and 1.0-dev
namespace
(SessionSaver.write_projection): Write the projection's epsg
attribute


Revision 1830 - Directory Listing
Modified Thu Oct 16 16:36:00 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(projfile_cache): Introduce a cache for
ProjFile objects
(clear_proj_file_cache): New function to clear the cache. Mainly
useful for use by the test suite
(read_proj_file): Use the cache.


Revision 1824 - Directory Listing
Modified Tue Oct 14 15:21:03 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(ProjFile): Derive from Publisher so we can
easily send messages when the projections change
(ProjFile.Add, ProjFile.Remove, ProjFile.Replace): Issue messages
when the change was successful


Revision 1823 - Directory Listing
Modified Tue Oct 14 15:20:47 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(PROJECTION_ADDED)
(PROJECTION_REPLACED, PROJECTION_REMOVED): New message types for
the ProjFile objects


Revision 1816 - Directory Listing
Modified Mon Oct 13 15:53:56 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(ProjFileReader.start_projection)
(ProjFileReader.end_projection, ProjFileSaver.write_projfile):
Handle the epsg code attribute when reading or writing proj files


Revision 1815 - Directory Listing
Modified Mon Oct 13 15:53:39 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Projection.__init__): New parameter and
instance variable epsg. Update doc-string
(Projection.EPSGCode, Projection.Label): New methods to provide
access to EPSG code and a label for use in dialogs


Revision 1802 - Directory Listing
Modified Thu Oct 9 15:18:35 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(ProjFile.Add): Do not check whether the
projection is already in the list. This is *a lot* faster when
loading files with hundreds of projections since it saves a linear
search. OTOH this will allow adding the same projection to the
user.proj file multiple times in the projection dialog but we'll
deal with that later


Revision 1797 - Directory Listing
Modified Thu Oct 9 10:00:06 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Projection.GetParameter): Handle
parameters that do not contain a "=". Update the doc-string


Revision 1791 - Directory Listing
Modified Wed Oct 8 14:47:53 2003 UTC (21 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(get_user_proj_file): small bug-fix: Added missing 'val' parameter.


Revision 1786 - Directory Listing
Modified Wed Oct 8 10:39:11 2003 UTC (21 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/resource.py (read_proj_file): Return the warnings
too. Update the doc-string
(get_proj_files): Removed. It wasn't used anywhere
(get_system_proj_files, get_system_proj_file): Rename to
get_system_proj_file and return the ProjFile object and not a list
of ProjFile objects. Update the callers.
(get_user_proj_files, get_user_proj_file): Rename to
get_user_proj_file return the ProjFile object and not a list of
ProjFile objects. Update the callers.
(ProjFileReader.__init__): New instance variable for the warnings.
Rename the __pf ivar to projfile. Update the methods referring to
__pf
(ProjFileReader.end_projection): Catch any errors raised when
instantiating the projection and record that as an error. The
projection will not be in the final ProjFile object.
(ProjFileReader.GetWarnings): New method to return the warnings.

* Thuban/UI/projdialog.py (ProjFrame.show_warnings): New method to
show the warnings from the projfile reader
(ProjFrame._OnImport): Deal with any warnings returned by
read_proj_file
(ProjFrame.__FillAvailList): Deal with any warnings returned by
get_system_proj_file or get_user_proj_file.


Revision 1759 - Directory Listing
Modified Fri Sep 26 18:36:01 2003 UTC (21 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(GenQuantiles0): Removed since it's
only used in GREAT-ER but not used in Thuban itself. When GREAT-ER
is ported to a newer the import will fail, so it should be noticed
immediately that this function is gone.
Fixes RT#1919


Revision 1755 - Directory Listing
Modified Fri Sep 26 14:03:44 2003 UTC (21 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(ProjFileSaver.write): Use
'projectionlist' as the name in the document type declaration so
that it matches the element type of the root element.


Revision 1693 - Directory Listing
Modified Mon Sep 1 11:23:26 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py
(PostGISTable): Extend doc-string
(PostGISTable._fetch_table_information): Set the column index
correctly, pretending ignored columns don't exist.

* test/test_postgis_db.py (TestPostGISIgnoredColumns): New tests
for postgis tables with data types not yet supported by thuban.


Revision 1664 - Directory Listing
Modified Wed Aug 27 15:20:54 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
As preparation for the 0.9 release, switch thuban files to a
non-dev namespace

* Thuban/Model/save.py (SessionSaver.write_session): Write files
with the http://thuban.intevation.org/dtds/thuban-0.9.dtd
namespace

* Thuban/Model/load.py (SessionLoader.__init__): Accept the
http://thuban.intevation.org/dtds/thuban-0.9.dtd namespace too

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table)
(SaveSessionTest.test_save_postgis): Update for new namespace

* test/test_load.py (LoadSessionTest.dtd, TestSingleLayer)
(TestLayerVisibility.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestPostGISLayer.file_contents)
(TestPostGISLayerPassword.file_contents)
(TestLoadError.file_contents, TestLoadError.test): Update for new
namespace


Revision 1662 - Directory Listing
Modified Wed Aug 27 13:51:01 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Make the table interface distinguish between row ids (an integer
that uniquely identifies a row) and row ordinals (a simple row
count from 0 to NumRows() - 1)

* Thuban/Model/postgisdb.py (PostGISTable.RowIdToOrdinal)
(PostGISTable.RowOrdinalToId): New methods to conver between row
ids and row ordinals
(PostGISTable.ReadRowAsDict, PostGISTable.ReadValue): New keyword
parameter row_is_ordinal to indicate whether the row parameter is
the row id or the ordinal

* Thuban/Model/transientdb.py (TransientTableBase.RowIdToOrdinal)
(TransientTableBase.RowOrdinalToId)
(AutoTransientTable.RowIdToOrdinal)
(AutoTransientTable.RowOrdinalToId): Same new methods as in
PostGISTable.
(TransientTableBase.ReadRowAsDict, TransientTableBase.ReadValue)
(AutoTransientTable.ReadRowAsDict, AutoTransientTable.ReadValue):
Same new parameter as in PostGISTable.

* Thuban/Model/table.py (DBFTable.RowIdToOrdinal)
(DBFTable.RowOrdinalToId, MemoryTable.RowIdToOrdinal)
(MemoryTable.RowOrdinalToId): Same new methods as in PostGISTable.
(DBFTable.ReadValue, DBFTable.ReadRowAsDict)
(MemoryTable.ReadValue, MemoryTable.ReadRowAsDict): Same new
parameter as in PostGISTable.

* Thuban/UI/tableview.py (DataTable.RowIdToOrdinal)
(DataTable.RowOrdinalToId): New methods to convert between row ids
and row ordinals.
(TableGrid.SelectRowById): New method to select a row based on its
ID as opposed to its ordinal
(DataTable.GetValue, TableGrid.OnRangeSelect)
(TableGrid.OnSelectCell, LayerTableGrid.select_shapes)
(QueryTableFrame.OnQuery, QueryTableFrame.get_selected)
(LayerTableFrame.__init__): Convert between row ids and row
ordinals as appropriate

* test/postgissupport.py (PostGISDatabase.__init__): Add
doc-string.
(PostGISDatabase.initdb): The optional third item in a tuple in
tables is now a (key, value) list with additional arguments to
pass to upload_shapefile
(upload_shapefile): New parameter gid_offset to allow gids that
are not the same as the shapeids in the shapefile
(PostgreSQLServer.get_default_static_data_db): Use the new
gid_offset to make the gids in landmarks 1000 higher than the
shapeids in the shapefile

* test/test_viewport.py
(TestViewportWithPostGIS.test_find_shape_at_point): Adapt to the
new shapeids in the landmarks table

* test/test_transientdb.py
(TestTransientTable.run_iceland_political_tests)
(TestTransientTable.test_transient_joined_table): Add tests for
the new table methods and new keywords arguments.

* test/test_postgis_db.py
(TestPostGISTable.test_read_row_as_dict_row_count_mode)
(TestPostGISTable.test_read_value_row_count_mode)
(TestPostGISTable.test_row_id_to_ordinal)
(TestPostGISTable.test_row_oridnal_to_id): New test for the new
table methods and the new arguments
(TestPostGISShapestorePoint.test_shapes_in_region)
(TestPostGISShapestorePoint.test_shape_raw_data)
(TestPostGISShapestorePoint.test_shape_points)
(TestPostGISShapestorePoint.test_shape_shapeid)
(TestPostGISShapestorePoint.test_all_shapes)
(TestPostGISTable.test_simple_query)
(TestPostGISTable.test_simple_query)
(TestPostGISTable.test_simple_query)
(TestPostGISTable.test_read_value)
(TestPostGISTable.test_read_row_as_dict): Adapt to the new
shapeids in the landmarks table

* test/test_memory_table.py
(TestMemoryTable.test_read_row_as_dict_row_count_mode)
(TestMemoryTable.test_read_value_row_count_mode)
(TestMemoryTable.test_row_id_to_ordinal)
(TestMemoryTable.test_row_oridnal_to_id): New test for the new
table methods and the new arguments

* test/test_dbf_table.py
(TestDBFTable.test_read_row_as_dict_row_count_mode)
(TestDBFTable.test_read_value_row_count_mode)
(TestDBFTable.test_row_id_to_ordinal)
(TestDBFTable.test_row_oridnal_to_id): New test for the new table
methods and the new arguments


Revision 1660 - Directory Listing
Modified Tue Aug 26 12:54:45 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(PostGISShapeStore.BoundingBox): Use a
more postgis specific but much faster method to get the bounding
box


Revision 1658 - Directory Listing
Modified Tue Aug 26 10:34:48 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py (PostGISTable.Title)
(PostGISShapeStore.AllShapes): Add these missing methods.
(PostGISShapeStore.ShapesInRegion): No need to raise
StopIteration. We can simply return

* test/test_postgis_db.py (TestPostGISTable.test_title)
(TestPostGISShapestorePoint.test_all_shapes): New tests for the
new methods


Revision 1656 - Directory Listing
Modified Mon Aug 25 18:26:54 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py (shapetype_map): Add MUTLIPOLYGON.

* test/test_postgis_db.py (PolygonTests): New class containing
those tests from TestPostGISShapestorePolygon that can also be
used to test MUTLIPOLYGON tables
(TestPostGISShapestorePolygon): Most tests are now in PolygonTests
so derive from that
(TestPostGISShapestoreMultiPolygon): New class with tests for
MUTLIPOLYGON tables

* test/postgissupport.py (PostGISDatabase.initdb): Allow the
tables argument to have tuples with three items to override the
WKT type used.
(PostgreSQLServer.get_default_static_data_db): Use the above to
create a polygon table with MUTLIPOLYGONs
(point_to_wkt, coords_to_point, polygon_to_wkt, coords_to_polygon)
(arc_to_wkt, coords_to_multilinestring): Rename from *_to_wkt to
coords_to*
(coords_to_multipolygon): New. Convert to MUTLIPOLYGON
(wkt_converter): New. Map WKT types to converters
(upload_shapefile): New parameter force_wkt_type to use a
different WKT type than the default


Revision 1646 - Directory Listing
Modified Mon Aug 25 13:43:56 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Basic loading of sessions containing postgis connections:

* Thuban/Model/load.py (LoadError): Add doc-string
(LoadCancelled): New exception class to indicate a cancelled load
(SessionLoader.__init__): Add the db_connection_callback parameter
which will be used by the loader to get updated parameters and a
password for a database connection
(SessionLoader.__init__): Add the new XML elements to the
dispatchers dictionary
(SessionLoader.check_attrs): Two new conversions, ascii to convert
to a byte-string object and idref as a generic id reference
(SessionLoader.start_dbconnection)
(SessionLoader.start_dbshapesource): New. Handlers for the new XML
elements
(load_session): Add the db_connection_callback to pass through the
SessionLoader

* test/test_load.py (TestPostGISLayer, TestPostGISLayerPassword):
New classes to test loading of sessions with postgis database
connections.


Revision 1642 - Directory Listing
Modified Mon Aug 25 10:54:31 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/load.py (SessionLoader.check_attrs): Raise a
LoadError when a required attribute is missing. The code used to
be commented out for some reason, but probably should have been
active.

* test/test_load.py (TestLoadError.test): Test the message in the
LoadError too to make sure it really is about the missing
attribute


Revision 1638 - Directory Listing
Modified Fri Aug 22 18:19:14 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Implement saving a session with a postgis connection

* Resources/XML/thuban-0.9.dtd (dbconnection, dbshapesource) New
elements for database connections and shapestores using db
connections
(session): Add the dbconnections to the content model

* Thuban/Model/save.py (SessionSaver.write_db_connections): New.
Write the db connections
(SessionSaver.write_session): Call write_db_connections to write
the connection before the data sources
(SessionSaver.write_data_containers): Handle postgis shapestores

* test/test_save.py (SaveSessionTest.thubanids)
(SaveSessionTest.thubanidrefs): Update for new DTD
(SaveSessionTest.test_save_postgis): New. Test saving a session
with postgis connections

* Thuban/Model/postgisdb.py (PostGISTable.DBConnection)
(PostGISTable.TableName): New accessor methods for the connection
and table name

* test/test_postgis_db.py (TestPostGISTable.test_dbconn)
(TestPostGISTable.test_dbname): New methods to test the new
PostGISConnection methods


Revision 1636 - Directory Listing
Modified Fri Aug 22 17:20:29 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/postgisdb.py (ConnectionError): New exception class
for exceptions occurring when establishing a Database connection
(PostGISConnection.connect): Catch psycopg.OperationalError during
connects and raise ConnectionError.

* test/test_postgis_db.py (TestPostgisDBExceptions): New class for
tests for database exceptions


Revision 1631 - Directory Listing
Modified Fri Aug 22 16:01:14 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/UI/about.py (About.__init__): Add the psycopg version.

* Thuban/version.py: Add psycopg version

* Thuban/Model/postgisdb.py (psycopg_version): New. Return the
version of the psycopg module


Revision 1625 - Directory Listing
Modified Thu Aug 21 16:02:23 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Make postgis support really optional including insensitive menu
items.

* Thuban/Model/postgisdb.py (has_postgis_support): New. Return
whether the postgis is supported.

* Thuban/UI/dbdialog.py: Put the psycopg import into try..except
to make postgis support optional

* Thuban/UI/mainwindow.py (_has_postgis_support): New. Context
version of Thuban.Model.postgisdb.has_postgis_support
(database_management command): Make it only sensitive if postgis
is supported.


Revision 1620 - Directory Listing
Modified Wed Aug 20 13:14:22 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Add dialogs and commands to open database connections and add
database layers.

* Thuban/UI/mainwindow.py (MainWindow.DatabaseManagement): New
method to open the database connection management dialog
(MainWindow.AddDBLayer): New method to add a layer from a database
(_has_dbconnections): New helper function to use for sensitivity
(database_management command, layer_add_db command): New commands
that call the above new methods.
(main_menu): Add the new commands to the menu.

* Thuban/Model/postgisdb.py (PostGISConnection.__init__)
(PostGISConnection.connect): Establish the actual connection in a
separate method and call it in __init__. This makes it easier to
override the behavior in test cases
(PostGISConnection.BriefDescription): New method to return a brief
description for use in dialogs.

* test/test_postgis_db.py (NonConnection): DB connection that
doesn't actually connect
(TestBriefDescription): New class with tests for the new
BriefDescription method


Revision 1607 - Directory Listing
Modified Tue Aug 19 12:50:35 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Add the db connection management to the session.

* Thuban/Model/session.py (Session.__init__): New instance
variable db_connections
(Session.AddDBConnection, Session.DBConnections)
(Session.HasDBConnections, Session.CanRemoveDBConnection)
(Session.RemoveDBConnection): New methods to manage and query the
db connections managed by the session
(Session.OpenDBShapeStore): New method to open a shapestore from a
db connection

* Thuban/Model/messages.py (DBCONN_REMOVED, DBCONN_ADDED): New
messages for the db connection handling in the session

* test/test_postgis_session.py: New. test cases for the session's
db connection handling with postgis connections


Revision 1605 - Directory Listing
Modified Tue Aug 19 11:00:40 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Add very basic postgis database support and the corresponding test
cases. The test cases require a PostgreSQL + postgis installation
but no existing database. The database will be created
automatically by the test cases

* test/README: Add note about skipped tests and the requirements
of the postgis tests.

* Thuban/Model/postgisdb.py: New. Basic postgis database support.

* test/test_postgis_db.py: New. Test cases for the postgis
support.

* Thuban/Model/wellknowntext.py: New. Parser for well-known-text
format

* test/test_wellknowntext.py: New. Test cases for the
wellknowntext parser

* test/postgissupport.py: New. Support module for tests involving
a postgis database.

* test/support.py (execute_as_testsuite): Shut down the postmaster
if it's still running after the tests

* Thuban/Model/data.py (RAW_WKT): New constant for raw data in
well known text format


Revision 1599 - Directory Listing
Modified Mon Aug 18 12:45:28 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Fix some bugs in Thuban and the test suite that were uncovered by
changes introduced in Python 2.3:

* Thuban/Model/table.py (DBFTable.__init__): Make sure the
filename is an absolute name

* Thuban/Model/layer.py (RasterLayer.__init__): Make sure the
filename is an absolute name

* test/test_save.py (SaveSessionTest.testRasterLayer): Use a
unique filename to save to and use the correct relative filename
in the expected output.
(SaveSessionTest.test_dbf_table): Use the correct relative
filename in the expected output.

* test/test_layer.py (TestLayer.test_raster_layer): Update the
test to check whether the filename is absolute.


Revision 1593 - Directory Listing
Modified Fri Aug 15 14:10:27 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Change the way shapes are returned by a shape store. The
ShapesInRegion method returns an iterator over actual shape
objects instead of a list of shape ids.

* Thuban/Model/data.py (ShapefileShape.ShapeID): New. Return shape
id.
(ShapefileStore.ShapesInRegion): Return an iterator over the
shapes which yields shape objects instead of returning a list of
shape ids
(ShapefileStore.AllShapes): New. Return an iterator over all
shapes in the shape store
(DerivedShapeStore.AllShapes): New. Like in ShapefileStore

* Thuban/Model/layer.py (Layer.ShapesInRegion): Update
doc-string.

* Thuban/UI/baserenderer.py
(BaseRenderer.layer_ids, BaseRenderer.layer_shapes): Rename to
layer_shapes and make it return an iterator containg shapes
instead of a list of ids.
(BaseRenderer.draw_shape_layer): Update doc-string; Adapt to
layer_shapes() change

* Thuban/UI/renderer.py (ScreenRenderer.layer_ids)
(ScreenRenderer.layer_shapes): Rename as in BaseRenderer

* Thuban/UI/viewport.py (ViewPort._find_shape_in_layer): Adapt to
changes in the ShapesInRegion return value.
(ViewPort._get_hit_tester): Remove commented out code

* test/mockgeo.py (SimpleShapeStore.ShapesInRegion): Adapt to the
new return value.
(SimpleShapeStore.AllShapes): New. Implement this method too.

* test/test_layer.py (TestLayer.test_arc_layer)
(TestLayer.test_polygon_layer, TestLayer.test_point_layer)
(TestLayer.test_point_layer_with_projection)
(TestLayer.test_derived_store): Adapt to changes in the
ShapesInRegion return value.

* test/test_shapefilestore.py
(TestShapefileStoreArc.test_shapes_in_region)
(TestShapefileStorePolygon.test_shapes_in_region)
(TestShapefileStorePoint.test_shapes_in_region): Adapt to changes
in the ShapesInRegion return value.
(TestShapefileStorePoint.test_all_shapes)
(TestShapefileStoreArc.test_shape_shapeid): New tests for the new
methods

* test/test_derivedshapestore.py
(TestDerivedShapeStore.test_shapes_in_region): Adapt to changes in
the ShapesInRegion return value.
(TestDerivedShapeStore.test_all_shapes)
(TestDerivedShapeStore.test_shape_shapeid): New tests for the new
methods


Revision 1587 - Directory Listing
Modified Fri Aug 15 10:31:07 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer.ShapesInRegion): Apply the layer
projection to all corners of the bounding box to get a better
approximation of the projected bounding box

* test/test_layer.py (TestLayer.test_point_layer_with_projection):
New. Test coordinate handling of a layer with a projection.
Catches the bug fixed in Layer.ShapesInRegion


Revision 1564 - Directory Listing
Modified Thu Aug 7 19:19:56 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/data.py (DerivedShapeStore.RawShapeFormat): New.
Simply delegates to the original shapestore.

* test/test_derivedshapestore.py
(TestDerivedShapeStore.test_raw_format): New. Test case for
DerivedShapeStore.RawShapeFormat


Revision 1559 - Directory Listing
Modified Thu Aug 7 17:32:20 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
update ChangeLog


Revision 1558 - Directory Listing
Modified Thu Aug 7 17:31:54 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove the unused import of Shape from
data. It was only there for interface compatibility but it's not
used inside of Thuban and the generic Shape class will go away
soon anyway.


Revision 1551 - Directory Listing
Modified Wed Aug 6 17:21:07 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/data.py (ShapefileStore.Shape): For consistency, a
Shape object will always have the coordinates as a list of list of
coordinate pairs (tuples).
(Shape.compute_bbox): Adapt to new representation.

* Thuban/UI/viewport.py (ViewPort.find_shape_at)
(ViewPort.LabelShapeAt): Adapt to new coordinate representation in
Shape objects.

* test/test_shapefilestore.py
(ShapefileStoreTests.assertFloatTuplesEqual)
(ShapefileStoreTests.assertPointListEquals): Rename to
assertPointListEquals and change purpose to checking equality of
the lists returned by Shape.Points().
(TestShapefileStoreArc.test_shape)
(TestShapefileStorePolygon.test_shape)
(TestShapefileStorePoint.test_shape): Use the new
assertPointListEquals instead of assertFloatTuplesEqual

* test/test_layer.py (TestLayer.assertFloatTuplesEqual)
(TestLayer.assertPointListEquals): Rename to assertPointListEquals
and change purpose to checking equality of the lists returned by
Shape.Points().
(TestLayer.test_arc_layer, TestLayer.test_arc_layer)
(TestLayer.test_polygon_layer, TestLayer.test_point_layer)
(TestLayer.test_derived_store): Use the new assertPointListEquals
instead of assertFloatTuplesEqual

* test/test_derivedshapestore.py
(TestDerivedShapeStore.assertFloatTuplesEqual)
(TestDerivedShapeStore.assertPointListEquals): Rename to
assertPointListEquals and change purpose to checking equality of
the lists returned by Shape.Points().
(TestDerivedShapeStore.test_shape): Use the new
assertPointListEquals instead of assertFloatTuplesEqual


Revision 1546 - Directory Listing
Modified Tue Aug 5 12:38:52 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Color.__repr__): Make the repr of a color
object look like a Color instantiation. Formerly it looked like a
tuple.


Revision 1542 - Directory Listing
Modified Fri Aug 1 16:13:49 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Insert cvs keywords and doc-strings.


Revision 1535 - Directory Listing
Modified Fri Aug 1 14:27:13 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/data.py (SHAPETYPE_POLYGON, SHAPETYPE_ARC)
(SHAPETYPE_POINT, Shape): Move these constants and classes from
layer.py to data.py
(ShapefileStore.__init__): More Initialization for the new methods
and functionality.
(ShapefileStore.ShapeType, ShapefileStore.NumShapes)
(ShapefileStore.BoundingBox, ShapefileStore.ShapesInRegion)
(ShapefileStore.Shape): New methods that were formerly implemented
in the layer.
(DerivedShapeStore.Shape, DerivedShapeStore.ShapesInRegion)
(DerivedShapeStore.ShapeType, DerivedShapeStore.NumShapes)
(DerivedShapeStore.BoundingBox): New. DerivedShapeStore
equivalents of the new shape methods. These versions are simply
delegated to the original shapstore.

* Thuban/Model/layer.py (SHAPETYPE_POLYGON, SHAPETYPE_ARC)
(SHAPETYPE_POINT, Shape): Removed. They're now in data.py
(Layer.SetShapeStore): Removed the initializatin of instance
variables that were needed for the stuff that's now in
ShapefileStore
(Layer.BoundingBox, Layer.NumShapes, Layer.ShapeType)
(Layer.Shape, Layer.ShapesInRegion): Simply delegate to the
shapestore.


Revision 1525 - Directory Listing
Modified Wed Jul 30 15:42:56 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Add docstrings. Rename specific Ramp instances to use lower_case_style.


Revision 1515 - Directory Listing
Modified Tue Jul 29 14:59:11 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove the now unused import of warnings


Revision 1513 - Directory Listing
Modified Tue Jul 29 14:56:48 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(SimpleStore): Removed. This class has been
deprecated since before the 0.8 release and isn't used in Thuban
itself anymore.


Revision 1511 - Directory Listing
Modified Tue Jul 29 14:48:57 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove some unnecessary imports


Revision 1480 - Directory Listing
Modified Thu Jul 24 17:52:48 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove the #! line as
it annoys lintian which warns about these files not being
executable. The #1 isn't necessary here since if you absolutely
must execute them you can always say "python <filename>".


Revision 1452 - Directory Listing
Modified Fri Jul 18 12:57:59 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer.__init__): Rename
classificationField to classificatin_column and init it here so
that it can be used in SetClassificationColumn
(Layer.GetClassificationColumn, Layer.GetClassificationField):
Rename to GetClassificationColumn.
(Layer.SetClassificationColumn, Layer.SetClassificationField):
Rename to SetClassificationColumn and issue a LAYER_CHANGED
message if the column changes.
(Layer._classification_changed, Layer.ClassChanged): Rename to
_classification_changed. Update the callers.
(Layer.SetShapeStore): Further field->column renames.

* Thuban/Model/load.py (SessionLoader.start_classification)
(SessionLoader.start_clpoint): Updates because of
field->column method name changes in the Layer class

* Thuban/Model/save.py (SessionSaver.write_classification): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/classifier.py (Classifier.__init__)
(Classifier._OnTry, Classifier._OnRevert): Updates because of
field->column method name changes in the Layer class

* Thuban/UI/renderer.py (MapRenderer.draw_shape_layer): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/viewport.py (ViewPort.find_shape_at): Updates because
of field->column method name changes in the Layer class

* test/test_save.py (SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.testClassifiedLayer): Update because of
field->column method name changes in the Layer class

* test/test_layer.py (SetShapeStoreTests.setUp)
(SetShapeStoreTests.test_sanity): Update because of field->column
method name changes in the Layer class
(TestLayerModification.setUp): Subscribe to LAYER_CHANGED as well
(TestLayerModification.test_sanity)
(TestLayerModification.test_initial_settings): remove unsued code
and rename to test_sanity.
(TestLayerModification.test_set_classification): New test for
SetClassification and SetClassificationField.


Revision 1431 - Directory Listing
Modified Wed Jul 16 13:23:41 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(table_to_dbf, table_to_csv): Renamed
        parameter records to rows and add docstring.


Revision 1430 - Directory Listing
Modified Wed Jul 16 13:23:28 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_classification): Get the field name and type from the layer.


Revision 1429 - Directory Listing
Modified Wed Jul 16 13:23:14 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Add CLASS_CHANGED for when a classification is modified.


Revision 1428 - Directory Listing
Modified Wed Jul 16 13:23:01 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_classification):
        Set the field name on the layer, not the classification.


Revision 1427 - Directory Listing
Modified Wed Jul 16 13:22:48 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.Destroy): Unsubscribe from the classification.
(Layer.SetShapeStore): Reset the classification first while
        we still have the old shape store to work with.
(Layer.GetClassificationField, Layer.SetClassificationField):
        New. Method for getting/setting the field to classify on.
(Layer.SetClassification): Simplified now that the layer
        simply has to hold a reference to the classification and not
        tell the classification who owns it.


Revision 1426 - Directory Listing
Modified Wed Jul 16 13:22:20 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Use new CLASS_CHANGED message.
(Classification): Inherit from Publisher.
(Classification.__init__): Remove the layer parameter.
        Classifications no longer need to have a parent layer.
(Classification.GetField, Classification.GetFieldType,
        Classification.SetFieldInfo): Removed. The field name is stored
        in the layer, and the type can be retreived by calling
        Layer.GetFieldType().
(Classification._set_layer, Classification.GetLayer): Removed.
        Classifications no longer have a parent layer.


Revision 1425 - Directory Listing
Modified Wed Jul 16 13:21:59 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(generate_singletons,
        generate_uniform_distribution, generate_quantiles): Remove
        fixes parameter, but maintain the same functionality by having
        the calling function pass a FixedRamp object for the ramp.
(FixedRamp): New. Adapts a ramp to have fixed property values.


Revision 1417 - Directory Listing
Modified Tue Jul 15 08:43:53 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/save.py (SessionSaver.write_classification): Encode
string values (in addition to the labels) as UTF 8

* Thuban/Model/load.py (SessionLoader.start_clpoint): Decode the
values if the field type is string

* test/test_save.py (SaveSessionTest.testClassifiedLayer): Test
saving a session with non-ascii string classification values.

* test/test_load.py (TestClassification.file_contents)
(TestClassification.test): Check for non-ascii values in string
classifications


Revision 1408 - Directory Listing
Modified Mon Jul 14 09:38:29 2003 UTC (21 years, 7 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_map): Encode map
	title to latin1.  Fixes https://intevation.de/rt/webrt?serial_num=2013


Revision 1389 - Directory Listing
Modified Thu Jul 10 14:53:27 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(table_to_dbf, table_to_csv): Added 'records'
        parameter which is a list of records that restricts which
        records are saved. Fixes RTbug #1997.


Revision 1388 - Directory Listing
Modified Thu Jul 10 14:53:15 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Map.SetProjection): Send the old
        projection as an argument to listeners of the MAP_PROJECTION_CHANGED
        event.


Revision 1387 - Directory Listing
Modified Thu Jul 10 14:53:03 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(generate_singletons,
        generate_uniform_distribution, generate_quantiles):
        Added 'fixes' parameter so that property attributes can
        be held constant over the generated classification groups.
(CustomRamp.GetProperties): Remove unused variables.


Revision 1381 - Directory Listing
Modified Tue Jul 8 16:37:46 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/transientdb.py (TransientTableBase.Width): The type
constants in the column objects are the standard ones defined in
the table module.

* test/test_transientdb.py
(TestTransientTable.test_transienttable_to_dbf): New. Test whether
exporting transient tables as DBF works. This should catch the bug
just fixed in TransientTableBase.Width.


Revision 1379 - Directory Listing
Modified Tue Jul 8 13:23:20 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/classgen.py (CustomRamp.GetProperties): Compute the
interpolated colors correctly.

* test/test_classgen.py (TestCustomRamp.test_color_interpolation):
New. Test case for the fix in classgen.py


Revision 1375 - Directory Listing
Modified Tue Jul 8 10:53:05 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Resources/XML/thuban-0.9.dtd: New. This will become the DTD for
0.9.

* Thuban/Model/transientdb.py (TransientJoinedTable.JoinType):
New. Return the join type

* Thuban/Model/save.py (SessionSaver.write_session): Use new 0.9
DTD
(SessionSaver.write_data_containers): Save the join type for
joined tables

* Thuban/Model/load.py (SessionLoader.__init__): Add the new 0.9
namespace
(SessionLoader.start_jointable): Handle the jointype attribute

* test/test_load_0_8.py: New. Effectively a copy of test_load.py
as of Thuban 0.8. These are now tests to determine whether Thuban
can still read files generated by Thuban 0.8

* test/test_load.py (LoadSessionTest.dtd)
(TestSingleLayer.file_contents)
(TestLayerVisibility.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestJoinedTable.file_contents)
(TestLoadError.file_contents): Update for new DTD
(TestJoinedTable.file_contents, TestJoinedTable.setUp): Add test
for new join type attribute

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table): Update for new DTD
(SaveSessionTest.test_joined_table): Add test for new join type
attribute


Revision 1371 - Directory Listing
Modified Fri Jul 4 18:19:16 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/table.py (_find_dbf_column_names): New. Helper
function for table_to_dbf
(table_to_dbf): Deal with names longer than the 10 character limit

* test/test_dbf_table.py (TestTableToDBF.test_table_to_dbf): Add
doc-string
(TestTableToDBF.test_table_to_dbf_long_col_names): New test for
long column names


Revision 1364 - Directory Listing
Modified Thu Jul 3 13:09:43 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* test/test_transientdb.py
(TestTransientTable.test_transient_joined_table_same_column_name):
Update to reflect the new behavior
(TestTransientTable.test_transient_joined_table_with_equal_column_names):
Update to reflect the new behavior
(TestTransientTable.test_transient_joined_table_name_collisions_dont_modify_in_place):
New test case for a bug which modified the column objects in place

* Thuban/Model/transientdb.py (TransientJoinedTable.__init__):
Update doc-string
(TransientJoinedTable.create): Do not modify the column objects of
the input tables in place and copy all columns of the input tables
into the joined table after all.


Revision 1361 - Directory Listing
Modified Wed Jul 2 12:59:20 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(generate_singletons,
        generate_uniform_distribution, generate_quantiles,
        GenQuantiles0): Make sure maxValue isn't less than
        one, otherwise we could divide by zero.


Revision 1359 - Directory Listing
Modified Wed Jul 2 10:51:49 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(generate_singletons,
        generate_uniform_distribution, generate_quantiles,
        GenQuantiles0): The denominator was one to high when
        calculating the index for the ramp causing the index
        to never to reach one.


Revision 1355 - Directory Listing
Modified Wed Jul 2 09:37:23 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.SetClassification): Switch
        the classification instance variable to the new class
        before calling _set_layer otherwise subscribers to a
        LAYER_CHANGED event will not see any difference.


Revision 1354 - Directory Listing
Modified Wed Jul 2 09:37:07 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_clrange): Fix
        call to ClassGroupRange constructor to use a tuple.


Revision 1353 - Directory Listing
Modified Wed Jul 2 09:36:54 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroupRange.__init__):
        Consolidate the min/max parameters into a single _range which
        can either be a tuple or a Range object.
(ClassGroupRange.SetRange): Consolidate the min/max parameters
        into a single _range which can either be a tuple or a Range object.


Revision 1352 - Directory Listing
Modified Wed Jul 2 09:36:39 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixed parameters to ClassGroupRange constructor.


Revision 1351 - Directory Listing
Modified Tue Jul 1 16:17:02 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Classificatio.__init__): Remove unused lock variable.


Revision 1340 - Directory Listing
Modified Tue Jul 1 16:10:25 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Removed import of Color which wasn't being used.


Revision 1339 - Directory Listing
Modified Tue Jul 1 16:10:14 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixes RTbug #1971.
(SessionLoader.start_classification): Call
        Classification.SetFieldInfo().


Revision 1338 - Directory Listing
Modified Tue Jul 1 16:10:00 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixes RTbug #1971, 1973.
(Layer.Destroy): We don't need to call SetClassification
        anymore to clear out the back reference in the classifcation
        to the layer. It's better to set it to None using _set_layer,
        and we won't be creating another clas object too.
(Layer.SetClassification): Classification._set_layer is not
        recursive so remove all the locking variables. Also clean
        up the code so that it remains unchanged if something fails.


Revision 1337 - Directory Listing
Modified Tue Jul 1 16:09:43 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixes RTbug #1971.
(_Transparent): Renamed from Transparent so it doesn't
        conflict with the module variable.
(Transparent, Black): Renamed from Color.Transparent,
        Color.Black so they are not class variables.


Revision 1336 - Directory Listing
Modified Tue Jul 1 16:09:26 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
 Fixes RTbug #1973, 1971.
(Classification.SetField, Classification.SetFieldType):
        Replaced with SetFieldInfo.
(Classification.SetFieldInfo): New. Does a better job of
        what SetField and SetFieldType used to do by combining
        their function since they should really always be done
        at the same time.
(Classification.SetLayer): Renamed to _set_layer.
(Classification._set_layer): Should only be called from
        Layer's SetClassification. This does not cause a recursive
        call as SetLayer did because we know that Layer knows about
        the classification.


Revision 1335 - Directory Listing
Modified Tue Jul 1 16:09:09 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixes RTbug #1972, 1971.
        Import used objects/class from color.
(generate_singletons): We don't
        need the numGroups parameter anymore because we are using
        the new ramps with GetProperties().
(generate_uniform_distribution): Use new ramp method
        GetProperties().
(generate_quantiles, GenQuantiles0): Use new ramp method
        GetProperties().
(CustomRamp.SetNumGroups): Removed. The ramps now map
        a value from 0 to 1 to class properties so the number
        of groups is not needed ahead of time.
(CustomRamp.next): Removed. CustomRamp does not support
        interation anymore.
(CustomRamp.GetProperties): Returns a ClassGroupProperties
        object based on the index value from 0 to 1 that is
        passed to it.
(GreyRamp, RedRamp, GreenRamp, BlueRamp, GreenToRedRamp):
        Made into instances of Monochromatic class instread of
        deriving from it.
(HotToCold.SetNumGroups): Removed. See CustomRamp.
(HotToCold.next): Removed. See CustomRamp.


Revision 1333 - Directory Listing
Modified Tue Jul 1 15:41:08 2003 UTC (21 years, 8 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(TransientJoinedTable.create):
	If duplicates in left and right tables column names are found,
	append '_' (underscores) to the name until it is unique.
	Create always new internal names for the resulting table and reference
	columns in the join statement with <table>.<column>


Revision 1328 - Directory Listing
Modified Tue Jul 1 12:01:58 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* test/test_transientdb.py
(TestTransientTable.test_transient_joined_table_same_column_name):
New. Test whether joining on columns with the same names in both
tables works.

* Thuban/Model/transientdb.py (TransientJoinedTable.create): Make
sure to use the right internal names even when joining on field
with the same names in both tables. Also, detect duplicate names
in the joined table correctly.


Revision 1282 - Directory Listing
Modified Mon Jun 23 09:47:18 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Bug fix for RT #1961:

* Thuban/Model/load.py (SessionLoader.start_derivedshapesource):
Register DerivedShapestores with the session

* Thuban/Model/session.py (Session.Tables): Make sure each table
is only listed once.

* test/test_load.py (TestJoinedTable.test): Add check_format call.
Update file contents to match the one written out.


Revision 1273 - Directory Listing
Modified Fri Jun 20 17:45:49 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(BaseLayer.HasShapes): New. Overridden
        by deriving classes to determine if that layer supports shapes.
(Layer): Override HasShapes and return true.


Revision 1268 - Directory Listing
Modified Fri Jun 20 16:10:12 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Resources/XML/thuban-0.8.dtd: New DTD for the new file format
version.

* Thuban/Model/save.py (sort_data_stores): New. Make topological
sort of the data sources so they can be written with sources that
data sources that depend on other data sources come after the
sources they depend on.
(SessionSaver.__init__): Add idmap instance variable to map from
objects to the ids used in the file.
(SessionSaver.get_id, SessionSaver.define_id)
(SessionSaver.has_id): New. Methods to manage the idmap
(SessionSaver.write): Use thuban-0.8.dtd
(SessionSaver.write_session): Add a namespace on the session and
write out the data sources before the maps.
(SessionSaver.write_data_containers): New. Write the data
containers.
(SessionSaver.write_layer): Layer elements now refer to a
shapestore and don't contain filenames anymore.

* Thuban/Model/load.py (LoadError): Exception class to raise when
errors in the files are discovered
(SessionLoader.__init__): Define dispatchers for elements with a
thuban-0.8 namespace too.
(SessionLoader.check_attrs): New helper method to check and
convert attributes
(AttrDesc): New. Helper class for SessionLoader.check_attrs
(SessionLoader.start_fileshapesource)
(SessionLoader.start_derivedshapesource)
(SessionLoader.start_filetable, SessionLoader.start_jointable):
Handlers for the new elements in the new fileformat
(SessionLoader.start_layer): Handle the shapestore attribute in
addition to filename.
(SessionLoader.start_table, SessionLoader.end_table): Removed.
They were never used in the old formats and aren't needed for the
new.

* Thuban/Model/session.py (Session.DataContainers): New method to
return all "data containers", i.e. shapestores and tables

* test/xmlsupport.py (SaxEventLister.__init__)
(SaxEventLister.startElementNS, sax_eventlist): Add support to
normalize IDs.

* test/test_xmlsupport.py
(TestEventList.test_even_list_id_normalization): New test case for
id normalization

* test/test_load.py (LoadSessionTest.check_format): Use ID
normalization
(LoadSessionTest.thubanids, LoadSessionTest.thubanidrefs): New
class atrributes used for ID normalization
(TestSingleLayer, TestLayerVisibility, TestLabels.test)
(TestLayerProjection.test, TestRasterLayer.test): Adapt to new
file format
(TestJoinedTable): New test for loading sessions with joined
tables.
(TestLoadError): New. Test whether missing required attributes
cause a LoadError.

* test/test_save.py (SaveSessionTest.thubanids)
(SaveSessionTest.thubanidrefs): New class attributes for ID
normalization in .thuban files.
(SaveSessionTest.compare_xml): Use id-normalization.
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer): Adapt to new file format.
(SaveSessionTest.testLayerProjection): The filename used was the
same as for testSingleLayer. Use a different one.
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table): New test cases for saving the
new data sources structures.
(TestStoreSort, MockDataStore): Classes to test the sorting of the
data stores for writing.


Revision 1261 - Directory Listing
Modified Fri Jun 20 14:14:42 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(DerivedShapeStore.__init__): Raise
        an exception if the number of shapes is different from the
        number of rows in the table. Address RTbug #1933.


Revision 1251 - Directory Listing
Modified Fri Jun 20 09:27:55 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_classification):
        Remove unnecessary use of lambdas and nested functions.


Revision 1250 - Directory Listing
Modified Fri Jun 20 09:27:43 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection.GetProjectedUnits): New.
        Currently returns PROJ_UNITS_METERS or PROJ_UNITS_DEGREES
        depending on the units this projection *forwards* into.


Revision 1249 - Directory Listing
Modified Fri Jun 20 09:27:19 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Remove "from __future__"
        import statement since python 2.2 is the earliest supported
        version.


Revision 1230 - Directory Listing
Modified Wed Jun 18 14:46:43 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
First check if we can import
        the gdalwarp Thuban extension before checking for gdal.
        Also added some comments.


Revision 1219 - Directory Listing
Modified Mon Jun 16 17:42:54 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Update to the layer interface: Direct access to the table,
shapetable, shapefile and filename attributes is now actively
deprecated by issuing deprecation warnings for all places where
this happens.

* Thuban/Model/layer.py (Layer.__getattr__): New. Implement access
to the instance variables table, shapetable, shapefile and
filename via __getattr__ so that we can issue a deprecation
warning.
(Layer.SetShapeStore): Don't set the deprecated instance variables
any more
(Layer.SetShapeStore): Don't use deprecated layer instance
variables
(Layer.Destroy): No need to explicitly remove the instance
variables any more
(Layer.GetFieldType, Layer.Shape): Don't use deprecated layer
instance variables

* Thuban/UI/classgen.py (ClassGenDialog.__init__)
(GenUniformPanel._OnRetrieve, GenUniquePanel._OnRetrieve)
(GenQuantilesPanel.GetList, GenQuantilesPanel.OnRetrieve): Don't
use deprecated layer instance variables

* Thuban/UI/classifier.py (Classifier.__init__): Don't use
deprecated layer instance variables

* Thuban/UI/identifyview.py (IdentifyListCtrl.selected_shape)
(IdentifyGridCtrl.selected_shape): Don't set the deprecated layer
instance variables

* Thuban/UI/tableview.py (LayerTableGrid.select_shapes): Don't use
deprecated layer instance variables

* Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Don't use
deprecated layer instance variables

* Thuban/Model/save.py (SessionSaver.write_layer): Don't use
deprecated layer instance variables

* Thuban/UI/renderer.py (MapRenderer.draw_shape_layer)
(MapRenderer.polygon_render_param): Don't use deprecated layer instance
variables

* test/runtests.py (main): Turn Thuban's deprecation warnings into
errors so that they're cought by the tests

* test/test_load.py (TestSingleLayer.test): Don't use deprecated
layer instance variables


Revision 1189 - Directory Listing
Modified Thu Jun 12 17:01:13 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(get_user_proj_files): Moved the
        called to get_application_dir here, so that the directory
        will only be called if this method is invoked.


Revision 1179 - Directory Listing
Modified Thu Jun 12 16:12:56 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fix missed proj functions that needed to be renamed.


Revision 1177 - Directory Listing
Modified Thu Jun 12 15:46:46 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Color): Remove commented code that isn't used.
(Transparent): Renamed from NoColor. Doesn't inherit from Color.
        Fixes RTbug #1835.
(Transparent.__eq__, Transparent.__ne, Transparent.__repr): New.
        Needed now that the class doesn't inherit from Color.


Revision 1176 - Directory Listing
Modified Thu Jun 12 15:46:22 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Removed assert statements that tested if the variable was an instance of Color.


Revision 1171 - Directory Listing
Modified Thu Jun 12 12:52:37 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
New. Contains the XMLWriter class that was in save.py


Revision 1170 - Directory Listing
Modified Thu Jun 12 12:52:19 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
New. Contains the XMLReader class that was in load.py.


Revision 1161 - Directory Listing
Modified Thu Jun 12 12:41:01 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Renamed functions to following the function_names_with_underscores style.
(has_gdal_support): New function that returns true if the gdal
        library is available. Addresses RTbug #1877.


Revision 1160 - Directory Listing
Modified Thu Jun 12 12:40:43 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(escape, XMLWriter): Moved into seperate file xmlwriter.py.


Revision 1159 - Directory Listing
Modified Thu Jun 12 12:40:27 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLReader): Moved into seperate file xmlreader.py.


Revision 1158 - Directory Listing
Modified Thu Jun 12 12:40:11 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Import gdal only if it available.
(RasterLayer): Handle the case where the gdal library is unavailable.
        Addresses RTbug #1877.


Revision 1157 - Directory Listing
Modified Thu Jun 12 12:39:54 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Renamed functions to follow the
        function_names_with_underscores style. Fixes RTbug #1903.
(calculate_quantiles): Raise ValueError if 'percents' is invalid.


Revision 1149 - Directory Listing
Modified Wed Jun 11 10:45:34 2003 UTC (21 years, 8 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
Use get_application_dir


Revision 1142 - Directory Listing
Modified Tue Jun 10 09:41:57 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/messages.py (LAYER_SHAPESTORE_REPLACED): New
message.

* Thuban/Model/layer.py (Layer.SetShapeStore): Send
LAYER_SHAPESTORE_REPLACED when the shapestore changes. A
LAYER_CHANGED will still be sent if the classification changes.

* Thuban/UI/classifier.py (Classifier.__init__): Add the map as
parameter so we can subscribe to some of its messages
(Classifier.__init__): Subscribe to the map's MAP_LAYERS_REMOVED
and the layer's LAYER_SHAPESTORE_REPLACED
(Classifier.unsubscribe_messages): New. Unsubscribe from message
subscribed to in __init__
(Classifier.map_layers_removed)
(Classifier.layer_shapestore_replaced): receivers for the messages
subscribed to in __init__. Unsubscribe and close the dialog

* Thuban/UI/mainwindow.py (MainWindow.OpenLayerProperties): Pass
the map to the Classifier dialog

* test/test_layer.py (SetShapeStoreTests): Derive from
SubscriberMixin as well so we can test messages
(SetShapeStoreTests.setUp): Subscribe to some of the layer's
messages
(SetShapeStoreTests.tearDown): Clear the messages again
(SetShapeStoreTests.test_sanity): Expand the doc-string and check
for the modified flag too
(SetShapeStoreTests.test_set_shape_store_modified_flag): New test
to check whether SetShapeStore sets the modified flag
(SetShapeStoreTests.test_set_shape_store_different_field_name)
(SetShapeStoreTests.test_set_shape_store_same_field)
(SetShapeStoreTests.test_set_shape_store_same_field_different_type):
Add tests for the messages. This checks both the new
LAYER_SHAPESTORE_REPLACED and the older LAYER_CHANGED


Revision 1132 - Directory Listing
Modified Thu Jun 5 13:27:17 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
Guess location of .thuban directory from tempdir parent directory.


Revision 1128 - Directory Listing
Modified Tue Jun 3 17:00:47 2003 UTC (21 years, 9 months ago) by tkoester
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/classgen.py (GenQuantiles0): New function.


Revision 1124 - Directory Listing
Modified Mon Jun 2 14:14:25 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.AddTable): call self.changed to
set the modified flag


Revision 1121 - Directory Listing
Modified Mon Jun 2 13:46:45 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(TitledObject.SetTitle): Call changed
instead of issue so that the modified flags get updated.


Revision 1117 - Directory Listing
Modified Fri May 30 18:31:19 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Layer.Destroy): Set all instance
variables to None that have direct or indirect references to
shapefiles or dbf files to make sure that they do go away and the
files are closed.


Revision 1099 - Directory Listing
Modified Fri May 30 06:28:02 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Map.TopLayer, Map.BottomLayer): Renamed
        to MoveLayerToTop and MoveLayerToBottom respectively. Fixes
        RTBug #1907.


Revision 1098 - Directory Listing
Modified Fri May 30 06:27:44 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Remove ClassGenerator class but make
        all the methods functions. Fixes RTBug #1903.


Revision 1088 - Directory Listing
Modified Wed May 28 12:42:23 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer.SetShapeStore): Set the
classification to "None" if the type of the field has changed.

* test/test_layer.py (SetShapeStoreTests): New. Class with a few
test for the Layer.SetShapeStore method


Revision 1086 - Directory Listing
Modified Wed May 28 11:36:05 2003 UTC (21 years, 9 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Layer.TreeInfo): Fixed a bug (a layer does not necessarily have a filename).


Revision 1078 - Directory Listing
Modified Wed May 28 09:07:30 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/table.py (DBFTable.__init__): Omit the extension
when determining the title from the filename.

* test/test_dbf_table.py (TestDBFTable.test_title): Update to
reflect changes in the way the title is derived from the filename


Revision 1074 - Directory Listing
Modified Tue May 27 17:39:43 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/UI/mainwindow.py (MainWindow.delegated_messages): Also
delegate SelectedLayer.
(MainWindow.LayerUnjoinTable): Implement.
(_can_unjoin): New. Helper function for the sensitivity of the
layer/unjoin command.

* Thuban/Model/data.py (ShapefileStore.OrigShapeStore)
(DerivedShapeStore.OrigShapeStore): New. Return the original
shapestore. Used to figure out how to unjoin.
(DerivedShapeStore.Shapefile): Fix a typo.


Revision 1068 - Directory Listing
Modified Tue May 27 15:02:37 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/messages.py (TABLE_REMOVED): New message.

* Thuban/Model/session.py (Session.UnreferencedTables): New method
to return tables that are not referenced by other tables or shape
stores and can be removed.
(Session.RemoveTable): Issue a TABLE_REMOVED message after
removing the table

* Thuban/UI/mainwindow.py: Remove unused imports
(MainWindow.TableClose): Implement.

* Thuban/UI/tableview.py (TableFrame.__init__): Subscribe to some
messages so that the frame will be automatically closed when a new
session is opened or the table is removed.
(TableFrame.OnClose): Unsubscribe the Subscriptions made in
__init__
(TableFrame.close_on_session_replaced)
(TableFrame.close_on_table_removed): New. Subscribers that close
the window

* test/test_session.py (TestSessionMessages.test_remove_table)
(TestSessionSimple.test_remove_table): Move the test to
TestSessionSimple and add test for the TABLE_REMOVED message
(TestSessionBase.setUp): Also subscribe to TABLE_REMOVED
(TestSessionSimple.test_unreferenced_tables) New. Test for the
UnreferencedTables method.
(UnreferencedTablesTests): New. Class with some more sophisticated
tests for UnreferencedTables.


Revision 1043 - Directory Listing
Modified Mon May 26 19:27:15 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove the Precision methods again. They're too DBF specific to be
part of the table interface and they're only used in table_to_dbf
anyway.

* Thuban/Model/transientdb.py (TransientTableBase.Width):Use a
fixed precision of 12 for doubles.
(TransientTableBase.Precision): Removed
(AutoTransientTable.Width): Delegate to self.table.

* Thuban/Model/table.py (DBFTable.Precision)
(MemoryTable.Precision): Removed.
(MemoryTable.Width): Use a fixed precision of 12 for doubles.
(table_to_dbf): Use a fixed precision of 12 for floats unless the
column object specifies something else.


Revision 1036 - Directory Listing
Modified Mon May 26 17:30:29 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.OpenTableFile): New. Open a dbf
file and add the table to the tables managed by the session


Revision 1026 - Directory Listing
Modified Mon May 26 11:46:42 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
TrannsientTableBase.Width, TransientTableBase.Precision):
Return column width and precision.


Revision 1025 - Directory Listing
Modified Mon May 26 11:46:17 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(DBFTable.Width, MemoryTable.Width):
	Return width (in characters) for a column.
(DBFTable.Precision, MemoryTable.Precision): Return decimal precision.
(table_to_dbf): Write table to dbf file.
(table_to_csv): Write table to csv file.


Revision 1020 - Directory Listing
Modified Fri May 23 13:03:07 2003 UTC (21 years, 9 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(TransientTable, TransientJoinedTable, AutoTransientTable): mix-in
TitledObject and call its init-method with a default title. Remove
Title() method.


Revision 1019 - Directory Listing
Modified Fri May 23 12:56:34 2003 UTC (21 years, 9 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(DBFTable, MemoryTable): mix-in TitledObject and call its init-method with
a default title. Remove Title() method.


Revision 1018 - Directory Listing
Modified Fri May 23 12:54:24 2003 UTC (21 years, 9 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(TitledObject.SetTitle): Call method 'issue' only if it exists.


Revision 1016 - Directory Listing
Modified Fri May 23 11:05:59 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/session.py (Session.AddShapeStore): Define
AddShapeStore analogously to AddTable.

* test/test_session.py (TestSessionSimple.test_add_shapestore):
New. Test for AddShapeStore


Revision 1012 - Directory Listing
Modified Fri May 23 09:13:58 2003 UTC (21 years, 9 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Layer.TreeInfo): Added filename.


Revision 1009 - Directory Listing
Modified Fri May 23 08:26:58 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(TransientJoinedTable.__init__):
	Added "outer_join = False" as optional parameter.
(TransientJoinedTable.create): If outer join is true, perform a
	"LEFT OUTER JOIN" instead of "JOIN", which preserves all records of
	the left table. Records not matching are filled with 0 / None.


Revision 1002 - Directory Listing
Modified Thu May 22 19:41:57 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(TransientJoinedTable.__doc__): Typo fixed.


Revision 998 - Directory Listing
Modified Thu May 22 19:29:39 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Give the tables titles so that the GUI can display more meaningful
names. For now the titles are fixed but depend on e.g. filenames
or the titles of the joined tables.

* Thuban/Model/transientdb.py (TransientTable.Title)
(TransientJoinedTable.Title, AutoTransientTable.Title): New.

* Thuban/Model/table.py (DBFTable.Title, MemoryTable.Title): New.

* test/test_transientdb.py
(TestTransientTable.test_auto_transient_table_title): New. Test
for the Title method
(TestTransientTable.test_transient_joined_table)
(TestTransientTable.test_transient_table): Add test for the Title
methods

* test/test_memory_table.py (TestMemoryTable.test_title): New.
Test for the Title method

* test/test_dbf_table.py (TestDBFTable.test_title): New. Test for
the Title method


Revision 996 - Directory Listing
Modified Thu May 22 18:21:10 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* test/test_layer.py (TestLayer.setUp, TestLayer.tearDown):
Provide a better way to destroy the layers
(TestLayer.test_base_layer, TestLayer.test_arc_layer)
(TestLayer.test_point_layer, TestLayer.test_empty_layer)
(TestLayer.test_polygon_layer, TestLayer.test_get_field_type): Use
the new way to destroy the layers.
(TestLayer.test_derived_store): New. Test for using a layer with a
DerivedShapeStore

* Thuban/Model/layer.py (Layer.SetShapeStore): Only set the
filename if the shape store actually has one.


Revision 994 - Directory Listing
Modified Thu May 22 18:05:16 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/table.py (DBFTable.FileName): New. Accessor method
for the filename

* test/test_dbf_table.py (TestDBFTable.test_filename): New. Test
for the FileName method
(TestDBFTableWriting.test_write): Fix spelling of filename


Revision 993 - Directory Listing
Modified Thu May 22 16:54:04 2003 UTC (21 years, 9 months ago) by tkoester
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/range.py, test/test_range.py: Brought over new Range
from SciParam that now really is immutable.


Revision 991 - Directory Listing
Modified Thu May 22 16:51:44 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(Map.TopLayer(), Map.BottomLayer()): New, place
	layer at top/bottom of layer stack.


Revision 987 - Directory Listing
Modified Thu May 22 16:46:14 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/session.py (Session.RemoveTable): New method to
remove tables

* test/test_session.py (TestSessionSimple.test_remove_table): New.
Test for RemoveTable


Revision 986 - Directory Listing
Modified Thu May 22 16:41:10 2003 UTC (21 years, 9 months ago) by tkoester
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/classgen.py: Added short module doc string and CVS id.
(ClassGenerator.GenUniformDistribution): Use new Range __init__, too.


Revision 984 - Directory Listing
Modified Thu May 22 16:37:48 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Implement a way to discover dependencies between tables and
shapestores.

* Thuban/Model/transientdb.py (TransientTableBase.Dependencies)
(TransientJoinedTable.Dependencies)
(AutoTransientTable.SimpleQuery): New. Implement the dependencies
interface
(TransientJoinedTable.__init__): Keep tack of the original table
objects in addition to the corresponding transient tables.

* Thuban/Model/table.py (DBFTable.Dependencies)
(MemoryTable.Dependencies): New. Implement the dependencies
interface

* Thuban/Model/data.py (ShapeTable): New. Helper class for
ShapefileStore
(ShapefileStore.__init__): Use ShapeTable instead of
AutoTransientTable
(ShapefileStore.Table, ShapefileStore.Shapefile): Add doc-strings
(ShapefileStore.FileName, ShapefileStore.FileType): New. Accessor
methods for filename and type
(ShapefileStore.Dependencies): New. Implement the dependencies
interface
(DerivedShapeStore): New class to replace SimpleStore. The main
difference to SimpleStore is that it depends not on a shapefile
but another shapestore which expresses the dependencies a bit
better
(SimpleStore.__init__): Add deprecation warning.

* test/test_dbf_table.py (TestDBFTable.test_dependencies): New.
Test for the Dependencies method.

* test/test_memory_table.py (TestMemoryTable.test_dependencies):
New. Test for the Dependencies method.

* test/test_transientdb.py
(TestTransientTable.test_auto_transient_table_dependencies): New.
Test for the Dependencies method.
(TestTransientTable.test_transient_joined_table): Add test for the
Dependencies method.

* test/test_session.py (TestSessionSimple.setUp)
(TestSessionSimple.tearDown): New. Implement a better way to
destroy the sessions.
(TestSessionSimple.test_initial_state)
(TestSessionSimple.test_add_table): Bind session to self.session
so that it's destroyed by tearDown
(TestSessionSimple.test_open_shapefile): New. Test for
OpenShapefile and the object it returns


Revision 982 - Directory Listing
Modified Thu May 22 12:02:15 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/session.py (Session.AddTable): New method to
register tables with the session.
(Session.Tables): Return the tables registered with AddTable too.

* test/test_session.py (TestSessionSimple.test_add_table): New.
Test case for the AddTable method


Revision 962 - Directory Listing
Modified Wed May 21 17:23:39 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Brought over new Range from SciParam that
        is immutable and has an __init__ which can accept floats.


Revision 961 - Directory Listing
Modified Wed May 21 17:23:25 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(RasterLayer.__init__): Test if the filename is a valid image file.
        Throw IOError otherwise.


Revision 960 - Directory Listing
Modified Wed May 21 17:23:11 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroupRange.SetRange): Use new Range ___init__ to pass floats.


Revision 959 - Directory Listing
Modified Wed May 21 17:22:58 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGenerator.GenQuantiles): Remove
        references to 'inf' and use new Range __init__ to pass floats
        directly rather than converting them to strings first.
        Fixes RTBug #1876.


Revision 933 - Directory Listing
Modified Tue May 20 15:23:50 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(AutoTransientTable.SimpleQuery):
        The right argument may not be a string, it could also be a Column.


Revision 932 - Directory Listing
Modified Tue May 20 15:23:33 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLWriter.encode): Don't assume that we
        get a string in Latin1. If we get such as string convert it to
        unicode first, otherwise leave if alone before encoding.
(SessionSaver.write_layer): Add support for writing both Layers
        and RasterLayers.


Revision 931 - Directory Listing
Modified Tue May 20 15:23:18 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Map.BoundingBox): Fix typo in comment.


Revision 930 - Directory Listing
Modified Tue May 20 15:23:03 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.__init__): Add rasterlayer tag handler.
(SessionLoader.start_layer): Encode the filename.
(SessionLoader.start_rasterlayer, SessionLoader.end_rasterlayer):
        New. Supports reading a rasterlayer tag.


Revision 929 - Directory Listing
Modified Tue May 20 15:22:42 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(BaseLayer.HasClassification): New.
        Defaults to False, but can be overridden by subclasses if they
        support classification.
(RasterLayer): New. Defines a new layer that represents an image.


Revision 920 - Directory Listing
Modified Fri May 16 17:37:29 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove some unused imports including the
__future__ import for nested_scopes as Thuban relies on Python 2.2
now.
(XMLWriter.encode): Remove the special case for a None argument.
In the saver encode is always called with a string argument.


Revision 913 - Directory Listing
Modified Fri May 16 16:25:10 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(roundInterval): round long instead of int


Revision 907 - Directory Listing
Modified Fri May 16 15:01:04 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/table.py (Table): Remove this compatibility alias
for DBFTable.

* test/test_table.py: Import DBFTable as Table because that alias
doesn't exist anymore.

* Thuban/UI/classgen.py: Remove some unused imports


Revision 901 - Directory Listing
Modified Wed May 14 11:15:55 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Range.number_re): Now accepts floats that
        do not have a leading 0 (.5 is now accepted as well as 0.5).


Revision 900 - Directory Listing
Modified Wed May 14 11:15:41 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGenerator.GenSingletonsFromList): Fix docstring.
(ClassGenerator.GenUniformDistribution): Fix spelling of method name.
(ClassGenerator.GenQuantiles): Use the left/right brackets and min/max
        values of the supplied range to determine the beginning and end
        bounds of the generated classes.


Revision 895 - Directory Listing
Modified Mon May 12 11:21:02 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGenerator.GenQuantiles): Add comments describing the parameters,
        use new return values from CalculateQuantiles to produce the correct
        range bounds in the Classification.
(ClassGenerator.CalculateQuantiles): Add more comments describing
        the return values and parameters. Make minor adjustments to improve
        the legibility of the code. Fix problem with adjusted not being set
        in most cases.


Revision 894 - Directory Listing
Modified Mon May 12 10:46:29 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
Old comment deleted.


Revision 892 - Directory Listing
Modified Mon May 12 10:45:47 2003 UTC (21 years, 9 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(XMLWriter.encode()): Explicite call to unicode and latin1. Fixes #1851 finally.


Revision 891 - Directory Listing
Modified Fri May 9 18:08:46 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGenerator.CalculateQuantiles):
        Clean up debugging statement, add comments, fix a small bug in the
        returned adjusted percentiles.


Revision 887 - Directory Listing
Modified Fri May 9 16:38:59 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Taken from SciParam. Used as the underlying
        object in ClassGroupRange, and also uesd for inputting ranges in
        the classifer table and elsewhere.


Revision 886 - Directory Listing
Modified Fri May 9 16:36:56 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
New. Contains the classes ClassGenerator, CustomRamp, MonochromaticRamp,
GreyRamp, RedRamp, GreenRamp, BlueRamp, HotToColdRamp from Thuban/UI/classgen.py


Revision 882 - Directory Listing
Modified Fri May 9 16:34:28 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Explicit imports.


Revision 876 - Directory Listing
Modified Fri May 9 16:31:55 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Explicit imports.
(XMLWriter.encode): New. Encode the given string from a format
        used by Thuban into UTF-8. Fixes RTbug #1851.


Revision 875 - Directory Listing
Modified Fri May 9 16:31:39 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Import _.  (ProjFileSaver.write): write header using projfile.dtd.


Revision 874 - Directory Listing
Modified Fri May 9 16:31:12 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLReader.encode): New. Encodes the given
        string appropriately for use in Thuban. Fixes RTbug #1851.
(SessionLoader.end_projection): Handle the context of the
        projection tag a bit better by looking at what objects are not
        None. There was an assumption that a projection tag for a map
        could occur before any layers.
(SessionLoader.start_clrange): Provide backward compatibility for
        reading min/max values as well as the new range parameter.


Revision 873 - Directory Listing
Modified Fri May 9 16:30:54 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Explicit imports.
(ClassGroupRange): Use the Range class to store the underlying
        range information. The interface remains the same, except for
        GetRange(), and you can also supply a Range object as the min
        parameter to SetRange or __init__.


Revision 861 - Directory Listing
Modified Thu May 8 12:26:44 2003 UTC (21 years, 10 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
Rendering moved to Thuban/UI/scalebar.py
(deriveInterval):
	Calculate scalebar interval and unit which fits in width for scale.
(roundInterval): Round float.


Revision 859 - Directory Listing
Modified Thu May 8 10:41:09 2003 UTC (21 years, 10 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
(ScaleBar.roundInterval()): New,
	round intervals to display smarter lengths
(ScaleBar.DrawScalebar): Draw Scalebar only if the map contains a
	layer. If the maps has no projection applied grey the scalebar.


Revision 853 - Directory Listing
Modified Wed May 7 18:23:58 2003 UTC (21 years, 10 months ago) by frank
Original Path: trunk/thuban/Thuban/Model
New, scalebar rendering.


Revision 851 - Directory Listing
Modified Wed May 7 15:11:12 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/session.py (Session.__init__): New instance
variable shapestores to hold a list of all open shapestore objects
(Session.ShapeStores): New. Accessor method for the shapestores
list.
(Session._add_shapestore, Session._clean_weak_store_refs): New.
Internal methods to maintain the shapestores list.
(Session.Tables): New. Return all tables open in the session.
(Session.OpenShapefile): Insert the new ShapeStore into the
shapestores list.

* test/test_session.py (TestSessionSimple.test_initial_state): Add
tests for ShapeStores and Tables
(TestSessionWithContent.test_shape_stores)
(TestSessionWithContent.test_tables): New. Test cases for
ShapeStores and Tables


Revision 849 - Directory Listing
Modified Wed May 7 11:55:31 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/transientdb.py (TransientTableBase.ReadRowAsDict):
Add comments about the optimizations used.
(AutoTransientTable.ReadValue, TransientTableBase.ReadValue): New.
Implement the ReadValue table interface method.

* test/test_transientdb.py
(TestTransientTable.run_iceland_political_tests)
(TestTransientTable.test_transient_joined_table): Add tests for
ReadValue


Revision 844 - Directory Listing
Modified Tue May 6 18:05:04 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(AutoTransientTable.SimpleQuery):
New. Simply delegate to the transient table's version.


Revision 841 - Directory Listing
Modified Tue May 6 17:12:53 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(TransientTableBase.SimpleQuery):
Implement a simple query method for the query dialog
(TransientTableBase.create): Add an INTEGER PRIMARY KEY that holds
the row index or shapeid.
(TransientTable.create): Insert the right value of the row index
(TransientJoinedTable.create): Copy the row index of the left
table to the joined result table


Revision 839 - Directory Listing
Modified Tue May 6 15:54:18 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Convert all table users to use the new table interface. This only
covers Thuban itself, not GREAT-ER or other applications built on
Thuban yet, so the compatibility interface stays in place for the
time being but it now issues DeprecationWarnings.

Finally, the new Table interface has a new method, HasColumn.

* Thuban/Model/table.py (OldTableInterfaceMixin): All methods
issue deprecation warnings when they're. The warnings refer to the
caller of the method.
(OldTableInterfaceMixin.__deprecation_warning): New. Helper method
for the deprecation warnings

* test/test_table.py: Ignore the deprecation warnings for the old
table in the tests in this module. The purpose of the tests is to
test the old interface, after all.

* test/test_transientdb.py
(TestTransientTable.run_iceland_political_tests): Use the
constants for the types. Add a test for HasColumn
(TestTransientTable.test_transient_joined_table): Adapt to new
table interface. Add a test for HasColumn
(TestTransientTable.test_transient_table_read_twice): Adapt to new
table interface

* Thuban/Model/transientdb.py (TransientTableBase.HasColumn)
(AutoTransientTable.HasColumn): Implement the new table interface
method
(AutoTransientTable.ReadRowAsDict, AutoTransientTable.ValueRange)
(AutoTransientTable.UniqueValues): Adapt to new table interface

* Thuban/Model/layer.py (Layer.SetShapeStore, Layer.GetFieldType):
Adapt to new table interface

* test/test_layer.py (TestLayer.open_shapefile): Helper method to
simplify opening shapefiles a bit easier.
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer)
(TestLayer.test_point_layer): Use the new helper method
(TestLayer.test_get_field_type): New. Test for the GetFieldType
method

* test/test_dbf_table.py (TestDBFTable.test_has_column): Test for
the new table method

* test/test_memory_table.py (TestMemoryTable.test_has_column):
Test for the new table method HasColumn


Revision 828 - Directory Listing
Modified Tue May 6 12:06:12 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Shape): Since a Shape is immutable only
        calculate the bounding box once (the first time compute_bbox() is
        called).
(Layer.ShapesBoundingBox): New. Given a list of shape ids, return
        the bounding box for the shapes in lat/long coordinates.


Revision 818 - Directory Listing
Modified Mon May 5 17:18:31 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Convert the table implementations to a new table interface. All
tables use a common mixin class to provide backwards compatibility
until all table users have been updated.

* Thuban/Model/table.py (OldTableInterfaceMixin): Mixin class to
provide backwards compatibility for table classes implementing the
new interface
(DBFTable, MemoryTable): Implement the new table interface. Use
OldTableInterfaceMixin as base for compatibility
(DBFColumn, MemoryColumn): New. Column description for DBFTable
and MemoryTable resp.

* test/test_dbf_table.py: New. Test cases for the DBFTable with
the new table interface.

* test/test_memory_table.py: New. Test cases for the MemoryTable
with the new table interface.

* test/test_table.py: Document the all tests in this file as only
for backwards compatibility. The equivalent tests for the new
interface are in test_memory_table.py and test_dbf_table.py
(MemoryTableTest.test_read): field_info should be returning tuples
with four items
(MemoryTableTest.test_write): Make doc-string a more precise.

* Thuban/Model/transientdb.py (TransientTableBase): Convert to new
table interface. Derive from from OldTableInterfaceMixin for
compatibility.
(TransientTableBase.create): New intance variable column_map to
map from names and indices to column objects
(TransientTable.create): Use the new table interface of the input
table
(AutoTransientTable): Convert to new table interface. Derive from
from OldTableInterfaceMixin for compatibility.
(AutoTransientTable.write_record): Removed. It's not implemented
yet and we still have to decide how to handle writing with the new
table and data framework.

* test/test_transientdb.py
(TestTransientTable.run_iceland_political_tests)
(TestTransientTable.test_transient_joined_table): Use the new
table interface


Revision 806 - Directory Listing
Modified Fri May 2 16:43:59 2003 UTC (21 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(MemoryTable): New. Quite simple table implementation that operates on a
list of tuples. All of the data are kept in the memory.


Revision 794 - Directory Listing
Modified Wed Apr 30 17:00:52 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.ShapesInRegion): Fix docstring
        to say that the parameter is a tuple of unprojected
        points (which is what the callers to this method were assuming).
        Also, since the points are unprojected we need to projected them.


Revision 791 - Directory Listing
Modified Wed Apr 30 12:26:33 2003 UTC (21 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
(Layer.SetShapeStore): Fixed a bug: don't set the Classification to
None if the classfication field is None (ie only a DEFAULT).


Revision 785 - Directory Listing
Modified Wed Apr 30 10:54:03 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/transientdb.py (TransientTableBase.__init__): New
instance variable read_record_last_result
(TransientTableBase.read_record): Make sure reading the same
record twice works. The implementation uses the new instance
variable read_record_last_result

* test/test_transientdb.py
(TestTransientTable.test_transient_table_read_twice): New test
case for the above bug-fix.


Revision 784 - Directory Listing
Modified Tue Apr 29 17:30:18 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Remove Thuban.common import and commented code that used Str2Num.


Revision 778 - Directory Listing
Modified Tue Apr 29 14:54:17 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.Destroy): Explicitly close the
transient DB if it exists to make sure it doesn't leave a journal
file in the temp directory.


Revision 777 - Directory Listing
Modified Tue Apr 29 14:54:12 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(TransientDatabase.close): Set
self.conn to None after closing the connection to make sure it's
not closed twice


Revision 773 - Directory Listing
Modified Tue Apr 29 14:34:23 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_layer): Save visible parameter.


Revision 772 - Directory Listing
Modified Tue Apr 29 14:34:11 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_layer): Read visible parameter.


Revision 771 - Directory Listing
Modified Tue Apr 29 14:34:02 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(BaseLayer.__init__): Change default value of visible from 1 to True.
(Layer.__init__): Change default value of visible from 1 to True.


Revision 765 - Directory Listing
Modified Tue Apr 29 12:42:14 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Next step of table implementation. Introduce a transient database
using SQLite that some of the data is copied to on demand. This
allows us to do joins and other operations that require an index
for good performance with reasonable efficiency. Thuban now needs
SQLite 2.8.0 and pysqlite 0.4.1. Older versions may work but I
haven't tested that.

* Thuban/Model/transientdb.py: New. Transient database
implementation.

* test/test_transientdb.py: New. Tests for the transient DB
classes.

* Thuban/Model/session.py (AutoRemoveFile, AutoRemoveDir): New
classes to help automatically remove temporary files and
directories.
(Session.__init__): New instance variables temp_dir for the
temporary directory and transient_db for the SQLite database
(Session.temp_directory): New. Create a temporary directory if not
yet done and return its name. Use AutoRemoveDir to have it
automatically deleted
(Session.TransientDB): Instantiate the transient database if not
done yet and return it.

* Thuban/Model/data.py (ShapefileStore.__init__): Use an
AutoTransientTable so that data is copied to the transient DB on
demand.
(SimpleStore): New class that simply combines a table and a
shapefile

* Thuban/Model/table.py (Table, DBFTable): Rename Table into
DBFTable and update its doc-string to reflect the fact that this
is only the table interface to a DBF file. Table is now an alias
for DBFTable for temporary backwards compatibility.

* Thuban/UI/application.py (ThubanApplication.OnExit): Make sure
the last reference to the session goes away so that the temporary
files are removed properly.

* test/test_load.py (LoadSessionTest.tearDown): Remove the
reference to the session to make sure the temporary files are
removed.


Revision 763 - Directory Listing
Modified Tue Apr 29 10:55:26 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(XMLReader.__init__, XMLReader.read): Turn
the __parser instance variable into a normal local variable in
read. It's only used there and read will never be called more than
once. Plus it introduces a reference cycle that keeps can keep the
session object alive for a long time.


Revision 758 - Directory Listing
Modified Tue Apr 29 09:01:12 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection): Removed Set*() methods to make
        Projection an immutable item. Fixes RTbug #1825.
(Projection.__init__): Initialize instance variables here.
(ProjFile.Replace): New. Replace the given projection object with
        the new projection object. This solves the problem of needing the
        mutator Projection.SetProjection() in the ProjFrame class and
        allows a projection to change parameters without changing its
        location in the file.


Revision 754 - Directory Listing
Modified Fri Apr 25 14:48:15 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_projection): Make sure to save the name of the projection.


Revision 749 - Directory Listing
Modified Fri Apr 25 14:22:35 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection.SetName): Set the name to "Unknown" if name is None.
(Projection.SetAllParameters): New. Set the projection's
        parameter list to the one supplied.
(Projection.SetProjection): New. Set the projection's
        properties to those of the supplied Projection.


Revision 745 - Directory Listing
Modified Fri Apr 25 10:26:50 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection.__init__): Change the default
        value for 'name' to None and then test if name is equal to None
        in the body of the constructor. This way the caller doesn't have to
        know what the default value should be. Namely, useful in load.py
        where we have to pick a default value if the 'name' parameter
        doesn't exist in the XML file.


Revision 744 - Directory Listing
Modified Fri Apr 25 10:26:35 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionLoader.start_projection): Remember the projection name and use it
        when constructing the Projection object.


Revision 740 - Directory Listing
Modified Fri Apr 25 09:14:04 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SessionSaver.write_layer): Save projection information.


Revision 739 - Directory Listing
Modified Fri Apr 25 09:13:48 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Rename calls to ProjFile.GetFileName to ProjFile.GetFilename.


Revision 738 - Directory Listing
Modified Fri Apr 25 09:13:36 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ProjFile): Document the class. Move
        back to using a list because the order of the projections in
        the file is important to maintain. Fixes RTbug #1817.


Revision 737 - Directory Listing
Modified Fri Apr 25 09:12:17 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLReader.GetFilename): Renamed from XMLReader.GetFileName.
(SessionLoader): Added support for loading projection tags that
        appear inside a layer.


Revision 736 - Directory Listing
Modified Fri Apr 25 09:11:57 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.TreeInfo): Add an item to the tree for projection information.


Revision 727 - Directory Listing
Modified Thu Apr 24 16:06:16 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(GetSystemProjFiles, GetUserProjFiles): Return a list with only one projection
        file instead of searching for any projection file. This simplifies many
        things if the user can only have one system file and one user file.


Revision 726 - Directory Listing
Modified Thu Apr 24 16:05:56 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection.SetName): New. Allows the name of the projection to be changed.
(ProjFile): Use a dictionary instead of a list so that removing
        projections is easier and we are sure about uniqueness.
(ProjFile.Remove): Remove the given projection object.


Revision 725 - Directory Listing
Modified Thu Apr 24 16:05:36 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.GetProjection): New. Needed to implement the interface that the
        ProjFrame dialog expects.


Revision 723 - Directory Listing
Modified Thu Apr 24 15:31:53 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
First step towards table management. Introduce a simple data
abstraction so that we replace the data a layer uses more easily
in the next step.

* Thuban/Model/data.py: New file with a simple data abstraction
that bundles shapefile and dbffile into one object.

* Thuban/Model/session.py (Session.OpenShapefile): New method to
open shapefiles and return a shape store object

* Thuban/Model/layer.py (Layer.__init__): Pass the data as a store
object instead of a shapefile filename. This introduces a new
instance variable store holding the datastore. For intermediate
backwards compatibility keep the old instance variables.
(open_shapefile): Removed. No longer needed with the shape store.
(Layer.SetShapeStore, Layer.ShapeStore): New methods to set and
get the shape store used by a layer.
(Layer.Destroy): No need to explicitly destroy the shapefile or
table anymore.

* Thuban/UI/mainwindow.py (MainWindow.AddLayer)
(MainWindow.AddLayer): Use the session's OpenShapefile method to
open shapefiles

* Thuban/Model/load.py (ProcessSession.start_layer): Use the
session's OpenShapefile method to open shapefiles

* test/test_classification.py
(TestClassification.test_classification): Use the session's
OpenShapefile method to open shapefiles and build the filename in
a more platform independed way

* test/test_layer.py (TestLayer.setUp, TestLayer.tearDown):
Implement to have a session to use in the tests
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer)
(TestLayer.test_point_layer, TestLayer.test_empty_layer): Use the
session's OpenShapefile method to open shapefiles
(TestLayerLegend.setUp): Instantiate a session so that we can use
it to open shapefiles.
(TestLayerLegend.tearDown): Make sure that all references to
layers and session are removed otherwise we may get a resource
leak

* test/test_map.py (TestMapAddLayer.test_add_layer)
(TestMapWithContents.setUp): Instantiate a session so that we can
use it to open shapefiles.
(TestMapWithContents.tearDown): Make sure that all references to
layers, maps and sessions are removed otherwise we may get a
resource leak
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_save.py (SaveSessionTest.testSingleLayer): Use the
session's OpenShapefile method to open shapefiles
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_selection.py (TestSelection.tearDown): Make sure that
all references to the session and the selection are removed
otherwise we may get a resource leak
(TestSelection.get_layer): Instantiate a session so that we can
use it to open shapefiles.
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_session.py (TestSessionBase.tearDown)
(TestSessionWithContent.tearDown): Make sure that all references
to the session and layers are removed otherwise we may get a
resource leak
(TestSessionWithContent.setUp): Use the session's OpenShapefile
method to open shapefiles


Revision 722 - Directory Listing
Modified Thu Apr 24 10:12:29 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLReader.read): Should have been checking if the file_or_filename object
        had the 'read' attribute.


Revision 718 - Directory Listing
Modified Wed Apr 23 10:39:46 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixes RTbug #1813.
(ReadProjFile): Add documentation about which exceptions are raised.
    Always pass the exceptions up to the caller.
(GetProjFiles): If the directory can't be read return an empty list.
    If any of the proj files can't be read skip that file and go
    on to the next one.


Revision 710 - Directory Listing
Modified Wed Apr 23 08:45:57 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLWriter): Renamed from XMLSaver to promote symmetry.


Revision 709 - Directory Listing
Modified Wed Apr 23 08:45:44 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Use XMLReader and XMLWriter.
(GetProjFiles): Renamed from GetProjections. Now returns a list
        of ProjFile objects.
(GetSystemProjFiles): Renamed from GetSuppliedProjections. Returns
        a list of ProjFile objects whose files are not user defined.
(GetUserProjFiles): Renamed from GetUserProjections. Returns a
        list of ProjFile objects whose files are user defined.
(ProjFileReader): Extend new XMLReader.


Revision 708 - Directory Listing
Modified Wed Apr 23 08:44:52 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection.GetParameters): Renamed to GetAllParameters.
(Projection.GetParameter): Returns the value for the given parameter.


Revision 707 - Directory Listing
Modified Wed Apr 23 08:44:34 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Map.GetProjection): New. Returns the map's projection.


Revision 706 - Directory Listing
Modified Wed Apr 23 08:44:21 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLReader): Renamed from XMLProcessor to
        promote symmetry. There now exists XMLReader and XMLWriter.
(XMLReader.read): New. Call to read the given file descriptor or
        filename.
(XMLReader.close): New. Make sure the file is closed.
(XMLReader.GetFileName): New. Return just the file name that is being read from.
(XMLReader.GetDirectory): New. Return just the directory of the file
        that is being read.
(XMLReader.AddDispatchers): New. Take a dictionary which contains
        the names of functions to call as the XML tree is parsed.
(XMLReader.startElementNS): Updated to use new dispatcher dictionary.
(XMLReader.endElementNS): Updated to use new dispatcher dictionary.
(SessionLoader): Removed class variables start_dispatcher and
        end_dispatcher since this functionality is now part of a class
        instance. Fixes RTbug #1808.
(SessionLoader.__init__): Add dispatcher functions.
(load_xmlfile): Code was moved into the XMLReader.read().
(load_session): Use modified SessionLoader.


Revision 701 - Directory Listing
Modified Thu Apr 17 16:18:48 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Don't import LAYER_LEGEND_CHANGED.
(Layer): Update doc-string since LAYER_LEGEND_CHANGED is not used
anymore.
(Layer.BoundingBox, Layer.GetFieldType, Layer.NumShapes)
(Layer.ShapeType, Layer.Shape): No need to call
self.open_shapefile since it's always called in __init__


Revision 697 - Directory Listing
Modified Wed Apr 16 16:40:07 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLSaver): New. Contains all the general XML writing methods that were
        part of SessionSaver.
(SessionSaver): Renamed from Saver.


Revision 696 - Directory Listing
Modified Wed Apr 16 16:39:49 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
New. Contains general utilities for read and writing projection files.


Revision 695 - Directory Listing
Modified Wed Apr 16 16:39:36 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Projection.__init__): Accepts an optional name.
(ProjFile): New. Represents a file that contains projection information.


Revision 694 - Directory Listing
Modified Wed Apr 16 16:39:18 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(XMLProcessor): New. Contains all the general XML reading methods that
        were part of ProcessSession.


Revision 689 - Directory Listing
Modified Wed Apr 16 13:47:07 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Use repr() around values in the ClassGroup*.__repr__() methods so it is
clearer when a value is a string and when it is a number.


Revision 683 - Directory Listing
Modified Tue Apr 15 21:54:56 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Saver.write_classification): Need to save the group label.


Revision 682 - Directory Listing
Modified Tue Apr 15 21:54:43 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Implemented __repr__ to make debugging a bit easier.


Revision 681 - Directory Listing
Modified Tue Apr 15 21:54:32 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Implemented __repr__ for the ClassGroup* classes to make debugging a bit easier.
(ClassGroup.SetLabel): Check that the string is an instance
        of StringTypes not StringType. Accounts for Unicode strings.


Revision 679 - Directory Listing
Modified Tue Apr 15 19:46:37 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
fix missed renaming


Revision 678 - Directory Listing
Modified Tue Apr 15 19:21:26 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroupProperties): Make instance variables private and optimize comparison
        operator by first checking if the color references are the same.
(ClassGroupSingleton): Make instance variables private.
(ClassGroupRange): Make instance variables private.


Revision 643 - Directory Listing
Modified Thu Apr 10 17:55:57 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroupRange.__init__): Should pass group to ClassGroup constructor.


Revision 637 - Directory Listing
Modified Thu Apr 10 14:35:03 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroup): Move all the common
        methods of the derived classes ([Set|Get]Properties(), __eq__, __ne__)
        here. Implement SetVisible(), IsVisible().
(ClassGroup.__init__): Add group parameter which acts as a copy
        constructor.


Revision 628 - Directory Listing
Modified Wed Apr 9 10:09:15 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Table.field_range): New. Retrive the
        maximum and minimum values over the entire table for a given
        field.
(Table.GetUniqueValues): New. Retrieve all the unique values
        in the table for a given field.


Revision 627 - Directory Listing
Modified Wed Apr 9 10:08:47 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Classification.__deepcopy__): Need to copy over field and fieldType attributes.


Revision 614 - Directory Listing
Modified Mon Apr 7 08:56:38 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Use Classification.AppendGroup(), not AddGroup()


Revision 613 - Directory Listing
Modified Mon Apr 7 08:55:55 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Classification.AppendGroup,
        Classification.InsertGroup, Classification.ReplaceGroup,
        Classification.RemoveGroup, Classification.GetGroup): Do as the
        names imply.
(Classification.FindGroup): This was called GetGroup, but GetGroup
        takes an index, while FindGroup takes a value.
(Classification.__deepcopy__): Copy all the groups, BUT NOT THE LAYER
        REFERENCE. Currently there is a cyclic reference between the layer
        and its classification. If the classification doesn't need to know
        its owning layer we can change this, since it may make sense to be
        able to use the same classification with different layers.


Revision 610 - Directory Listing
Modified Fri Apr 4 13:56:59 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Rename Color.None to Color.Transparent.


Revision 609 - Directory Listing
Modified Fri Apr 4 13:55:59 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Rename Color.None to
        Color.Transparent.
(ClassGroupProperties.SetLineColori, ClassGroupProperties.SetFill):
        Don't bother copying the color, since Colors are immutable.


Revision 605 - Directory Listing
Modified Fri Apr 4 12:16:13 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fix assert calls.


Revision 604 - Directory Listing
Modified Fri Apr 4 12:15:31 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Color.__copy__, Color.__deepcopy): Copy
        the color object.
(NoColor.__copy__, NoColor.__deepcopy): Return 'self' so that we
        are sure there exists only one refernce to Color.None in the system.
        This allows us to use 'is' rather than the comparision functions.


Revision 602 - Directory Listing
Modified Fri Apr 4 12:12:18 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fix assert calls.
    (ClassGroupProperties.SetLineColor, ClassGroupProperties.SetFill):
    Copy the color parameter rather than hold onto a reference.


Revision 590 - Directory Listing
Modified Wed Apr 2 15:03:19 2003 UTC (21 years, 11 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove unnecessary import. Fix a typo.


Revision 582 - Directory Listing
Modified Tue Apr 1 10:22:01 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Use LAYER_CHANGED instead of LAYER_LEGEND_CHANGED.


Revision 559 - Directory Listing
Modified Wed Mar 26 11:05:33 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Map): Forward LAYER_CHANGED messages.


Revision 558 - Directory Listing
Modified Wed Mar 26 11:05:20 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.ClassChanged): Send a LAYER_CHANGED message, not a
LAYER_LEGEND_CHANGED message.


Revision 548 - Directory Listing
Modified Thu Mar 20 09:44:49 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Rename and use new messages.


Revision 547 - Directory Listing
Modified Thu Mar 20 09:44:35 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
New message to indicate that a layer's
        data has changed (LAYER_CHANGED). New map messages to indicate
        when layers have been added/removed/changed or if the stacking order
        of the layers has changed.


Revision 546 - Directory Listing
Modified Thu Mar 20 09:44:20 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Map): Rename messages and use new, more specific, messages.


Revision 545 - Directory Listing
Modified Thu Mar 20 09:44:04 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer.SetClassification): Generate a LAYER_CHANGED event instead of a
LAYER_LEGEND_CHANGED event.


Revision 544 - Directory Listing
Modified Thu Mar 20 09:43:48 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroup.GetDisplayText): New.  Returns a string which is appropriately
describes the group.


Revision 529 - Directory Listing
Modified Wed Mar 12 19:55:24 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Handle the cyclic references between
        a layer and its classification better, and be sure to disconnect
        the classification from the layer when the layer is destroyed
        so that we don't maintain a cyclic reference that may not be
        garbage collected.


Revision 528 - Directory Listing
Modified Wed Mar 12 19:55:13 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
This comment is really for layer.py, but the motive was the same for
classification.py:

	Handle the cyclic references between
        a layer and its classification better, and be sure to disconnect
        the classification from the layer when the layer is destroyed
        so that we don't maintain a cyclic reference that may not be
        garbage collected.


Revision 526 - Directory Listing
Modified Wed Mar 12 19:17:49 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Comments, and an extra import.


Revision 525 - Directory Listing
Modified Wed Mar 12 19:12:30 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Testing fix for xml reader exceptions.


Revision 524 - Directory Listing
Modified Wed Mar 12 18:26:55 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixed external entity problem.


Revision 493 - Directory Listing
Modified Mon Mar 10 10:45:10 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Comment out print statement


Revision 492 - Directory Listing
Modified Mon Mar 10 10:44:57 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
 Added ClassChanged() so that the
        classification can tell the layer when its data has changed.
        (Layer.SetClassification): Accepts None as an arguement to
        remove the current classification and correctly handles
        adding a new classification.


Revision 491 - Directory Listing
Modified Mon Mar 10 10:44:42 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Classification): Don't use
        layer's message function directly, use the ClassChanged() method
        when then classification changes. SetField/SetFieldType/SetLayer
        must keep the information about field name and field type in
        sync when an owning layer is set or removed.


Revision 484 - Directory Listing
Modified Fri Mar 7 18:20:10 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Implemented __copy__ and __deepcopy__ for ClassGroup* and ClassGroupProperites
so they can easily be copied by the classifier dialog.
(ClassGroupProperites.__init__): The default line color should
        have been Color.Black.


Revision 481 - Directory Listing
Modified Thu Mar 6 16:46:36 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(SetClassification): prevent recursion between this method and
Classification.SetLayer().


Revision 480 - Directory Listing
Modified Thu Mar 6 16:46:19 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Addition of __eq__ and __ne__ methods.


Revision 479 - Directory Listing
Modified Thu Mar 6 16:46:07 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Minor documentation changes, Addition of __eq__ and __ne__ methods.
(Classification.SetLayer): prevent recursion between this method
        and Layer.SetClassification().


Revision 474 - Directory Listing
Modified Wed Mar 5 18:40:03 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Put FIELDTYPE constants back


Revision 473 - Directory Listing
Modified Wed Mar 5 18:39:45 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
import FIELDTYPE constants from table


Revision 467 - Directory Listing
Modified Wed Mar 5 18:18:38 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Put FIELDTYPE constants in common.py.  (Table): Add field_info_by_name() to
retrieve field information by specifying the field name, not the number.


Revision 466 - Directory Listing
Modified Wed Mar 5 18:18:20 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Saver): Store field type information.


Revision 465 - Directory Listing
Modified Wed Mar 5 18:18:06 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ProcessSession): Use proper string conversion function; fixes RTbug #1713.


Revision 464 - Directory Listing
Modified Wed Mar 5 18:17:47 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer): Add GetFieldType to retreive the kind of data represented by a field.


Revision 463 - Directory Listing
Modified Wed Mar 5 18:17:30 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Documentation.


Revision 462 - Directory Listing
Modified Wed Mar 5 18:17:17 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Class documentation. Renaming of methods with Stroke to Line.
Groups are stored in a single list with the default as the first element.
Groups are searched in the order they appear in the list.


Revision 454 - Directory Listing
Modified Tue Mar 4 11:31:47 2003 UTC (22 years ago) by bh
Original Path: trunk/thuban/Thuban/Model
(escape): Fix typo in doc-string


Revision 453 - Directory Listing
Modified Tue Mar 4 11:31:39 2003 UTC (22 years ago) by bh
Original Path: trunk/thuban/Thuban/Model
Remove unnecessary wxPython import


Revision 449 - Directory Listing
Modified Tue Mar 4 10:33:08 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ClassGroupRange.GetProperties): Parameter 'value' should default to None.


Revision 440 - Directory Listing
Modified Thu Feb 27 15:54:27 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixes a test case failure.
(Saver.write_classification): Use new Classification and Group functions.


Revision 439 - Directory Listing
Modified Thu Feb 27 15:54:05 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Use new Classification and Group functions.


Revision 437 - Directory Listing
Modified Thu Feb 27 15:53:21 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Fixed name resolution problem.


Revision 436 - Directory Listing
Modified Thu Feb 27 15:53:03 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
 Changed the class hierarchy
        so that a Classification consists of Groups which return
        Properties when a value matches a Group.


Revision 429 - Directory Listing
Modified Mon Feb 24 18:46:51 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Saver.write_classificaton): Uses
        the new iterator to save the classification information.


Revision 428 - Directory Listing
Modified Mon Feb 24 18:46:35 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Classification): Renamed
        GetProperties() to GetClassData(). Used the new iterator
        in TreeInfo().
(ClassIterator): Iterator implementation to iterate over the
        ClassData objects in a classification object.


Revision 414 - Directory Listing
Modified Wed Feb 19 16:52:23 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Saver): Use new Color and Classification methods


Revision 413 - Directory Listing
Modified Wed Feb 19 16:52:04 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(ProcessSession): Use new methods on Layer
        to get the classifcation and use the new ClassData* classes to
        hold the classification data. Use Str2Num to convert numbers
        properly.


Revision 412 - Directory Listing
Modified Wed Feb 19 16:51:50 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Layer): Removed references to fill, stroke,
        stroke_width attributes. Made the 'classification' attribute private.
        New methods for setting/getting the classification.


Revision 411 - Directory Listing
Modified Wed Feb 19 16:51:30 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Added Color.None to represent something
        with no color. Color.Black represents the color black.
(NoColor): Helper class derived from Color to represent something
        with no color.


Revision 410 - Directory Listing
Modified Wed Feb 19 16:51:12 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
(Classification):
        Uses the new ClassData* classes. Modification messages are
        passed up to the parent layer (if it exists).
(ClassData): New class to encapsulate the common data in each
        classification property.
(ClassDataDefault): Represents the Default class. data.
(ClassDataPoint): Represents a single class. data point
(ClassDataRange): Represents a class. range
(ClassDataMap): Represents a class. map (unused).


Revision 397 - Directory Listing
Modified Tue Feb 11 14:23:32 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/classification.py: Added import line to fix
        feature conflicts between running on python2.2 and python2.1.


Revision 391 - Directory Listing
Modified Mon Feb 10 15:26:11 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/save.py (Saver.open_element, Saver.close_element):
        Added element_open variable to track opening and closing of tags
        so that tags that don't span more than one line are closed with
        /> instead of </tag_name>. Use the GetDefault*() methods of
        the Classification class.


Revision 390 - Directory Listing
Modified Mon Feb 10 15:25:49 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/load.py (ProcessSession): Use the new ClassData
        object instead of a dictionary.


Revision 389 - Directory Listing
Modified Mon Feb 10 15:25:30 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer): Remove the
        Set[Fill|Stroke|StrokeWidth]() methods. Code should call the
        SetDefault*() methods on the layer's classification object.
        (Layer.__init__): Use the new SetDefault*() methods in the
        Classification class.


Revision 388 - Directory Listing
Modified Mon Feb 10 15:25:05 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/classification.py (Classificaton): Added set and
        get methods for the default data. The class also takes a layer
        reference so that modification messages can be sent. Fixed the
        methods to use the new ClassData class.
        (ClassData): New class to encapsulate the classification data


Revision 386 - Directory Listing
Modified Mon Feb 3 11:44:27 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Modified these functions to change the null data in the classification rather
than keep these values directly in the Layer class. Menu options to change
these values work again.


Revision 385 - Directory Listing
Modified Mon Feb 3 11:43:56 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Added getNull() to return the NullData reference


Revision 382 - Directory Listing
Modified Tue Jan 28 18:37:35 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Added a call to build the tree info for classifications. Commented out
unnecessary lines.


Revision 381 - Directory Listing
Modified Tue Jan 28 18:37:05 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
New function TreeInfo to add information about the classification
into the tree view.


Revision 378 - Directory Listing
Modified Tue Jan 28 12:13:28 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
fixed merging conflict


Revision 374 - Directory Listing
Modified Mon Jan 27 14:20:02 2003 UTC (22 years, 1 month ago) by jan
Original Path: trunk/thuban/Thuban/Model
Replace user string by _() for i18n.


Revision 371 - Directory Listing
Modified Mon Jan 27 13:49:39 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
Encapsulates classification information for a layer


Revision 366 - Directory Listing
Modified Mon Jan 27 11:48:17 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
added support to save classification information


Revision 365 - Directory Listing
Modified Mon Jan 27 11:47:53 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
added support to load classification information


Revision 364 - Directory Listing
Modified Mon Jan 27 11:47:12 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model
added classification initializations


Revision 320 - Directory Listing
Modified Fri Sep 13 14:21:30 2002 UTC (22 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Modifiable.UnsetModified): Issue a CHANGED
event if the modified flag changes.
(Modifiable.changed): Tweak the doc-string.


Revision 319 - Directory Listing
Modified Fri Sep 13 14:21:24 2002 UTC (22 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Map.forwarded_channels): Forward the
CHANGED channel too.
(Map.__init__): Call the Modifiable constructor as well.


Revision 318 - Directory Listing
Modified Fri Sep 13 14:21:12 2002 UTC (22 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.forwarded_channels): Forward
the CHANGED channel too.


Revision 298 - Directory Listing
Modified Fri Aug 30 17:40:52 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Map.CanRemoveLayer): New method to
determine whether a given layer can be deleted.


Revision 286 - Directory Listing
Modified Thu Aug 29 11:21:52 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Make writing records work correctly:
(Table.__init__): Keep track of whether the DBF is open for
writing
(Table.write_record): Open the DBF file for writing when necessary


Revision 284 - Directory Listing
Modified Tue Aug 27 14:08:32 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Table.write_record, Table.__init__): Open
dbf files only for reading by default. Use a new writable dbf
object for writing.


Revision 276 - Directory Listing
Modified Fri Aug 23 15:25:07 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Layer.__init__): Make sure we have an
absolute filename.


Revision 274 - Directory Listing
Modified Thu Aug 22 16:25:46 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/table.py (Table.write_record): New method to write
records.
(Table.__init__): Open the DBF file for writing too.

* Thuban/UI/controls.py (RecordTable.SetValue): Write the value
into the underlying table.


Revision 268 - Directory Listing
Modified Thu Aug 22 10:25:43 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Saver): New class to handle serializing a
session into an XML file. The main reason to introduce a class is
that applications built on Thuban can derive from it so that they
can save additional information in a session file.
(save_session): Delegate almost all the work to the Saver class.
Rename the filename argument to file because it may be a file like
object now.


Revision 267 - Directory Listing
Modified Thu Aug 22 10:25:30 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Get rid of the Python 1.5.2 compatibility
code. Remove the little test code which would be executed when the
module is run as a script which didn't work anymore since it can't
import the other Thuban modules.
(ProcessSession, load_session): Refactor the ProcessSession to
have one method for each element start and end tag so that derived
classes can easily override the processing of individual tags.
Also, always parse with namespaces enabled because applications
built on top of Thuban will likely use namespaces if they extend
the session file format.


Revision 260 - Directory Listing
Modified Thu Aug 15 17:43:59 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/Model/layer.py (Layer.Destroy): Call the unboundd method
with self.


Revision 258 - Directory Listing
Modified Thu Aug 15 12:48:03 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Layer.Destroy): New. Explicitly close the
shapefile and destroy the table.


Revision 257 - Directory Listing
Modified Thu Aug 15 12:47:59 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Table.Destroy): New. Close the DBF file.


Revision 250 - Directory Listing
Modified Tue Jul 30 14:17:58 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.Destroy): Don't bypass the
direct base class' Destroy method.


Revision 249 - Directory Listing
Modified Tue Jul 30 14:17:33 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Map.ClearLayers): New method to delete all
layers.
(Map.Destroy): Destroy the label_layer as well and call the
inherited Desatroymethod first so that no more messages are
issued.
(Map.RaiseLayer, Map.LowerLayer): Only issue LAYERS_CHANGED
message if the stacking order actually has changed. Add
doc-strings.
(Map.BoundingBox): Correct the doc-string.
(Map.AddLayer, Map.RemoveLayer, Map.Layers, Map.HasLayers)
(Map.ProjectedBoundingBox, Map.SetProjection): Add doc-strings.


Revision 248 - Directory Listing
Modified Tue Jul 30 14:15:39 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(LabelLayer.ClearLabels): New to delete
all labels.


Revision 245 - Directory Listing
Modified Mon Jul 29 13:37:55 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Map.subscribe_layer_channels)
(Map.unsubscribe_layer_channels): Put the code that (un)subscribes
to a layer's channels into separate methods.
(Map.RemoveLayer, Map.AddLayer): Call the new methods
(Map.Destroy): Unsubscribe from a layer's channels before
destroying it.


Revision 241 - Directory Listing
Modified Wed Jul 24 17:16:17 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.RemoveMap): New


Revision 240 - Directory Listing
Modified Wed Jul 24 17:16:09 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Modifiable.changed): Apply the args tuple,
don't pass it as a parameter


Revision 232 - Directory Listing
Modified Fri Jul 19 15:14:57 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/session.py: Issue a CHANGED message every time
	another changed message is issued to make it easier to get
	notified of changes.
	(Session): Update the doc string
	(Session.forward): Issue changed-events as CHANGED as well.
	(Session.changed): Overwrite the inherited version to issue
	CHANGED events as well.


Revision 231 - Directory Listing
Modified Fri Jul 19 15:13:05 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/map.py (Map.TreeInfo): Deal better with empty maps.


Revision 217 - Directory Listing
Modified Wed Jul 17 10:50:40 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
* Thuban/UI/tree.py (color_string): Removed. No longer used.
(SessionTreeCtrl.update_tree, SessionTreeCtrl.add_items): Split
update_tree into update_tree and add_items. The tree now uses a
more generic way to display the contents of the tree.
(SessionTreeCtrl): Add a doc string explaining the TreeInfo method

* Thuban/Model/layer.py (Layer.TreeInfo),
Thuban/Model/extension.py (Extension.TreeInfo),
Thuban/Model/map.py (Map.TreeInfo),
Thuban/Model/session.py (Session.TreeInfo):
Add TreeInfo methods to implement the new tree view update scheme


Revision 201 - Directory Listing
Modified Mon Jul 8 10:50:53 2002 UTC (22 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/save.py (relative_filename): Wrapper around
	Thuban.Lib.fileutil.relative_filename that accepts an empty dir
	argument. save_session now automatically uses this version,
	solving a problem when saving to a relative filename.


Revision 197 - Directory Listing
Modified Thu Jun 20 15:20:58 2002 UTC (22 years, 8 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
Session.Extensions, Session.HasExtensions, Session.AddExtension:
new for handling extensions.
Also some other minor changes to round up extension handling.


Revision 196 - Directory Listing
Modified Thu Jun 20 15:15:18 2002 UTC (22 years, 8 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
new messages for extensions.


Revision 195 - Directory Listing
Modified Thu Jun 20 15:12:01 2002 UTC (22 years, 8 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
new module to handle extension objects.


Revision 179 - Directory Listing
Modified Wed May 15 14:02:49 2002 UTC (22 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/layer.py (Layer.open_shapefile): Set bbox to None
	when the shapefile is empty.
	(Layer.BoundingBox, Layer.LatLongBoundingBox): Both methods may
	now return None for empty shapefiles. Update doc-strings.


Revision 178 - Directory Listing
Modified Wed May 15 14:02:20 2002 UTC (22 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/map.py (Map.BoundingBox): Add doc-string. Deal with
	the layer's bbox being None.


Revision 171 - Directory Listing
Modified Tue May 14 14:16:24 2002 UTC (22 years, 9 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/layer.py (Layer.open_shapefile): Choose a better
	maximum depth for the tree than shapelib does by default.


Revision 147 - Directory Listing
Modified Tue May 7 16:39:52 2002 UTC (22 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/layer.py (Layer.ShapesInRegion): Remove some debug
	prints.


Revision 143 - Directory Listing
Modified Tue May 7 14:17:20 2002 UTC (22 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/layer.py (Layer.__init__): New instance variable
	shapetree to hold the shapelib quadtree for the shapefile
	(Layer.open_shapefile): Create the quad tree.
	(Layer.ShapesInRegion): New method to return the ids of shapes in
	a given region using the quad tree.


Revision 128 - Directory Listing
Modified Fri May 3 14:38:16 2002 UTC (22 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/session.py (Session.AddMap, forwarded_channels):
	Move the map channels to be forwarded by the session into the
	class constant with forwarded_channels.


Revision 127 - Directory Listing
Modified Fri May 3 14:37:46 2002 UTC (22 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/base.py (Modifiable.changed): Fix doc-string (a
	typo and some rewording).


Revision 105 - Directory Listing
Modified Fri Apr 19 15:36:57 2002 UTC (22 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
convert projection parameters from unicode to regular string


Revision 103 - Directory Listing
Modified Fri Apr 19 14:23:24 2002 UTC (22 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model
new session don't have a filename


Revision 82 - Directory Listing
Modified Fri Feb 15 17:11:04 2002 UTC (23 years ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/layer.py (Layer.Shape): list append only takes one
	argument (python <= 1.5.2 erroneously accepted multiuple
	arguments)


Revision 75 - Directory Listing
Modified Mon Feb 4 19:22:22 2002 UTC (23 years, 1 month ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/load.py (ProcessSession.startElement): Read the
	stroke_width attribute


Revision 74 - Directory Listing
Modified Mon Feb 4 19:22:08 2002 UTC (23 years, 1 month ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/save.py (save_session): Write the new stroke_width
	attribute


Revision 73 - Directory Listing
Modified Mon Feb 4 19:19:25 2002 UTC (23 years, 1 month ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/layer.py (Layer.__init__): New parameter and
	instance variable stroke_width
	(Layer.SetStrokeWidth): Set the stroke_width.


Revision 63 - Directory Listing
Modified Fri Sep 14 12:20:02 2001 UTC (23 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/map.py (Map.Destroy): Unsubscribe the label_layer
	messages


Revision 56 - Directory Listing
Modified Thu Sep 13 13:54:37 2001 UTC (23 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
	* Thuban/Model/session.py (create_empty_session): Unset the
	modified bit before returning it


Revision 27 - Directory Listing
Modified Thu Sep 6 13:27:52 2001 UTC (23 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
(Session.UnsetModified): Remove debug prints


Revision 21 - Directory Listing
Modified Tue Sep 4 16:45:28 2001 UTC (23 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
Open the shapefile immediately. This will cause an exception in case the
file can't be opened and we can display an appropriate message.


Revision 6 - Directory Listing
Added Tue Aug 28 15:41:52 2001 UTC (23 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model
import all the source files


[email protected]
ViewVC Help
Powered by ViewVC 1.1.26