Parent Directory
|
Revision Log
Links to HEAD: | (view) (annotate) |
Sticky Revision: |
(BaseLayer.__init__): Change default value of visible from 1 to True. (Layer.__init__): Change default value of visible from 1 to True.
(Layer.TreeInfo): Add an item to the tree for projection information.
(Layer.GetProjection): New. Needed to implement the interface that the ProjFrame dialog expects.
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
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__
Rename Color.None to Color.Transparent.
(Layer.ClassChanged): Send a LAYER_CHANGED message, not a LAYER_LEGEND_CHANGED message.
(Layer.SetClassification): Generate a LAYER_CHANGED event instead of a LAYER_LEGEND_CHANGED event.
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.
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.
(SetClassification): prevent recursion between this method and Classification.SetLayer().
(Layer): Add GetFieldType to retreive the kind of data represented by a field.
Fixed name resolution problem.
(Layer): Removed references to fill, stroke, stroke_width attributes. Made the 'classification' attribute private. New methods for setting/getting the classification.
* 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.
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.
Added a call to build the tree info for classifications. Commented out unnecessary lines.
Replace user string by _() for i18n.
added classification initializations
(Layer.__init__): Make sure we have an absolute filename.
* Thuban/Model/layer.py (Layer.Destroy): Call the unboundd method with self.
(Layer.Destroy): New. Explicitly close the shapefile and destroy the table.
* 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
* 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.
* Thuban/Model/layer.py (Layer.open_shapefile): Choose a better maximum depth for the tree than shapelib does by default.
* Thuban/Model/layer.py (Layer.ShapesInRegion): Remove some debug prints.
* 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.
* Thuban/Model/layer.py (Layer.Shape): list append only takes one argument (python <= 1.5.2 erroneously accepted multiuple arguments)
* Thuban/Model/layer.py (Layer.__init__): New parameter and instance variable stroke_width (Layer.SetStrokeWidth): Set the stroke_width.
Open the shapefile immediately. This will cause an exception in case the file can't be opened and we can display an appropriate message.
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.
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |