Commit a68ac6bd authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Delegate selection of matching records to read_gis_file in get_data method of...

Delegate selection of matching records to read_gis_file in get_data method of GisData, if 'invert_selection' property is False.

git-svn-id: https://svn.seismo.oma.be/svn/seismo/mapping/layeredbasemap/trunk@5704 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent ac1a5dc6
...@@ -141,7 +141,13 @@ class GisData(BasemapData): ...@@ -141,7 +141,13 @@ class GisData(BasemapData):
for colname in polygon_value_colnames: for colname in polygon_value_colnames:
polygon_data.values[colname] = [] polygon_data.values[colname] = []
for rec in read_gis_file(self.filespec, layer_num=layer_num): if not self.invert_selection:
## Delegate selection to read_gis_file
attribute_filter = self.selection_dict
else:
attribute_filter = None
for rec in read_gis_file(self.filespec, layer_num=layer_num,
attribute_filter=attribute_filter):
selected = np.zeros(len(self.selection_dict.keys())) selected = np.zeros(len(self.selection_dict.keys()))
for i, (selection_colname, selection_value) in enumerate(self.selection_dict.items()): for i, (selection_colname, selection_value) in enumerate(self.selection_dict.items()):
if rec[selection_colname] == selection_value: if rec[selection_colname] == selection_value:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment