/[thuban]/trunk/thuban/Thuban/Model/layer.py
ViewVC logotype

Log of /trunk/thuban/Thuban/Model/layer.py

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (annotate)
Sticky Revision:

Revision 771 - (view) (annotate) - [select for diffs]
Modified Tue Apr 29 14:34:02 2003 UTC (21 years, 10 months ago) by jonathan
File length: 9594 byte(s)
Diff to previous 736 , to selected 464
(BaseLayer.__init__): Change default value of visible from 1 to True.
(Layer.__init__): Change default value of visible from 1 to True.


Revision 736 - (view) (annotate) - [select for diffs]
Modified Fri Apr 25 09:11:57 2003 UTC (21 years, 10 months ago) by jonathan
File length: 9588 byte(s)
Diff to previous 725 , to selected 464
(Layer.TreeInfo): Add an item to the tree for projection information.


Revision 725 - (view) (annotate) - [select for diffs]
Modified Thu Apr 24 16:05:36 2003 UTC (21 years, 10 months ago) by jonathan
File length: 9404 byte(s)
Diff to previous 723 , to selected 464
(Layer.GetProjection): New. Needed to implement the interface that the
        ProjFrame dialog expects.


Revision 723 - (view) (annotate) - [select for diffs]
Modified Thu Apr 24 15:31:53 2003 UTC (21 years, 10 months ago) by bh
File length: 9343 byte(s)
Diff to previous 701 , to selected 464
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 701 - (view) (annotate) - [select for diffs]
Modified Thu Apr 17 16:18:48 2003 UTC (21 years, 10 months ago) by bh
File length: 9769 byte(s)
Diff to previous 610 , to selected 464
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 610 - (view) (annotate) - [select for diffs]
Modified Fri Apr 4 13:56:59 2003 UTC (21 years, 11 months ago) by jonathan
File length: 10095 byte(s)
Diff to previous 558 , to selected 464
Rename Color.None to Color.Transparent.


Revision 558 - (view) (annotate) - [select for diffs]
Modified Wed Mar 26 11:05:20 2003 UTC (21 years, 11 months ago) by jonathan
File length: 10040 byte(s)
Diff to previous 545 , to selected 464
(Layer.ClassChanged): Send a LAYER_CHANGED message, not a
LAYER_LEGEND_CHANGED message.


Revision 545 - (view) (annotate) - [select for diffs]
Modified Thu Mar 20 09:44:04 2003 UTC (21 years, 11 months ago) by jonathan
File length: 10047 byte(s)
Diff to previous 529 , to selected 464
(Layer.SetClassification): Generate a LAYER_CHANGED event instead of a
LAYER_LEGEND_CHANGED event.


Revision 529 - (view) (annotate) - [select for diffs]
Modified Wed Mar 12 19:55:24 2003 UTC (21 years, 11 months ago) by jonathan
File length: 10039 byte(s)
Diff to previous 492 , to selected 464
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 492 - (view) (annotate) - [select for diffs]
Modified Mon Mar 10 10:44:57 2003 UTC (21 years, 11 months ago) by jonathan
File length: 9698 byte(s)
Diff to previous 481 , to selected 464
 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 481 - (view) (annotate) - [select for diffs]
Modified Thu Mar 6 16:46:36 2003 UTC (22 years ago) by jonathan
File length: 9278 byte(s)
Diff to previous 464
(SetClassification): prevent recursion between this method and
Classification.SetLayer().


Revision 464 - (view) (annotate) - [selected]
Modified Wed Mar 5 18:17:47 2003 UTC (22 years ago) by jonathan
File length: 8912 byte(s)
Diff to previous 437
(Layer): Add GetFieldType to retreive the kind of data represented by a field.


Revision 437 - (view) (annotate) - [select for diffs]
Modified Thu Feb 27 15:53:21 2003 UTC (22 years ago) by jonathan
File length: 8685 byte(s)
Diff to previous 412 , to selected 464
Fixed name resolution problem.


Revision 412 - (view) (annotate) - [select for diffs]
Modified Wed Feb 19 16:51:50 2003 UTC (22 years ago) by jonathan
File length: 8690 byte(s)
Diff to previous 389 , to selected 464
(Layer): Removed references to fill, stroke,
        stroke_width attributes. Made the 'classification' attribute private.
        New methods for setting/getting the classification.


Revision 389 - (view) (annotate) - [select for diffs]
Modified Mon Feb 10 15:25:30 2003 UTC (22 years ago) by jonathan
File length: 8950 byte(s)
Diff to previous 386 , to selected 464
* 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 386 - (view) (annotate) - [select for diffs]
Modified Mon Feb 3 11:44:27 2003 UTC (22 years, 1 month ago) by jonathan
File length: 9681 byte(s)
Diff to previous 382 , to selected 464
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 382 - (view) (annotate) - [select for diffs]
Modified Tue Jan 28 18:37:35 2003 UTC (22 years, 1 month ago) by jonathan
File length: 9411 byte(s)
Diff to previous 374 , to selected 464
Added a call to build the tree info for classifications. Commented out
unnecessary lines.


Revision 374 - (view) (annotate) - [select for diffs]
Modified Mon Jan 27 14:20:02 2003 UTC (22 years, 1 month ago) by jan
File length: 9250 byte(s)
Diff to previous 364 , to selected 464
Replace user string by _() for i18n.


Revision 364 - (view) (annotate) - [select for diffs]
Modified Mon Jan 27 11:47:12 2003 UTC (22 years, 1 month ago) by jonathan
File length: 9201 byte(s)
Diff to previous 276 , to selected 464
added classification initializations


Revision 276 - (view) (annotate) - [select for diffs]
Modified Fri Aug 23 15:25:07 2002 UTC (22 years, 6 months ago) by bh
File length: 8999 byte(s)
Diff to previous 260 , to selected 464
(Layer.__init__): Make sure we have an
absolute filename.


Revision 260 - (view) (annotate) - [select for diffs]
Modified Thu Aug 15 17:43:59 2002 UTC (22 years, 6 months ago) by bh
File length: 8741 byte(s)
Diff to previous 258 , to selected 464
* Thuban/Model/layer.py (Layer.Destroy): Call the unboundd method
with self.


Revision 258 - (view) (annotate) - [select for diffs]
Modified Thu Aug 15 12:48:03 2002 UTC (22 years, 6 months ago) by bh
File length: 8737 byte(s)
Diff to previous 217 , to selected 464
(Layer.Destroy): New. Explicitly close the
shapefile and destroy the table.


Revision 217 - (view) (annotate) - [select for diffs]
Modified Wed Jul 17 10:50:40 2002 UTC (22 years, 7 months ago) by bh
File length: 8514 byte(s)
Diff to previous 179 , to selected 464
* 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 179 - (view) (annotate) - [select for diffs]
Modified Wed May 15 14:02:49 2002 UTC (22 years, 9 months ago) by bh
File length: 7685 byte(s)
Diff to previous 171 , to selected 464
	* 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 171 - (view) (annotate) - [select for diffs]
Modified Tue May 14 14:16:24 2002 UTC (22 years, 9 months ago) by bh
File length: 7196 byte(s)
Diff to previous 147 , to selected 464
	* Thuban/Model/layer.py (Layer.open_shapefile): Choose a better
	maximum depth for the tree than shapelib does by default.


Revision 147 - (view) (annotate) - [select for diffs]
Modified Tue May 7 16:39:52 2002 UTC (22 years, 10 months ago) by bh
File length: 6824 byte(s)
Diff to previous 143 , to selected 464
	* Thuban/Model/layer.py (Layer.ShapesInRegion): Remove some debug
	prints.


Revision 143 - (view) (annotate) - [select for diffs]
Modified Tue May 7 14:17:20 2002 UTC (22 years, 10 months ago) by bh
File length: 6942 byte(s)
Diff to previous 82 , to selected 464
	* 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 82 - (view) (annotate) - [select for diffs]
Modified Fri Feb 15 17:11:04 2002 UTC (23 years ago) by bh
File length: 6285 byte(s)
Diff to previous 73 , to selected 464
	* Thuban/Model/layer.py (Layer.Shape): list append only takes one
	argument (python <= 1.5.2 erroneously accepted multiuple
	arguments)


Revision 73 - (view) (annotate) - [select for diffs]
Modified Mon Feb 4 19:19:25 2002 UTC (23 years, 1 month ago) by bh
File length: 6283 byte(s)
Diff to previous 21 , to selected 464
	* Thuban/Model/layer.py (Layer.__init__): New parameter and
	instance variable stroke_width
	(Layer.SetStrokeWidth): Set the stroke_width.


Revision 21 - (view) (annotate) - [select for diffs]
Modified Tue Sep 4 16:45:28 2001 UTC (23 years, 6 months ago) by bh
File length: 6053 byte(s)
Diff to previous 6 , to selected 464
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 - (view) (annotate) - [select for diffs]
Added Tue Aug 28 15:41:52 2001 UTC (23 years, 6 months ago) by bh
File length: 6023 byte(s)
Diff to selected 464
import all the source files


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26