Skip to content

Commit

Permalink
Writing macbeth result in the same layer in a new column; Done popup …
Browse files Browse the repository at this point in the history
…whem final file is wrote
  • Loading branch information
gacou54 committed Apr 12, 2021
1 parent 95512d0 commit 203bccd
Show file tree
Hide file tree
Showing 35 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions othello/ui/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def aggregate(self):
df = self.add_weighted_columns(df)
gis.io.write(df, filepath[0])

popup = Popup("Done", self)
popup.show()

except errors.LessThenTwoCriteriaError:
popup = Popup("At least 2 criteria must be loaded", self)
popup.show()
Expand Down Expand Up @@ -117,6 +120,9 @@ def add_weighted_columns(self, df: geopandas.GeoDataFrame) -> geopandas.GeoDataF
criterion = self.table.item(row_index, 2).text()
weight = float(self.table.item(row_index, 3).text())

# Removing the _mb suffix
criterion = criterion.replace('_mb', '')

criterion_geoseries = gis.io.read(filepath, layer=layer)[criterion]
df[criterion + '_np'] = criterion_geoseries
df[criterion + '_p'] = weight * criterion_geoseries
Expand Down
4 changes: 2 additions & 2 deletions othello/ui/criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ def write_file(self):
return

try:
self.df['macbeth'] = evaluate_new_values(
self.df[self.combobox_field.currentText() + '_mb'] = evaluate_new_values(
series=self.df[self.combobox_field.currentText()],
criterion_parameters=self.criterion_parameters
)

gis.io.write(self.df, self.geo_filepath, layer=self.layer + '_mb')
gis.io.write(self.df, self.geo_filepath, layer=self.layer)

popup = Popup("Done", self)
popup.show()
Expand Down
Binary file modified tests/data/CritereArretsSTS.gdb/a00000001.TablesByName.atx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000001.freelist
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000001.gdbtable
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000001.gdbtablx
Binary file not shown.
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000004.CatItemsByType.atx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000004.FDO_UUID.atx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000004.freelist
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000004.gdbtable
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000004.gdbtablx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000004.spx
Binary file not shown.
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000006.CatRelsByOriginID.atx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000006.CatRelsByType.atx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000006.FDO_UUID.atx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000006.freelist
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000006.gdbtable
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000006.gdbtablx
Binary file not shown.
Binary file removed tests/data/CritereArretsSTS.gdb/a0000000e.freelist
Binary file not shown.
Binary file removed tests/data/CritereArretsSTS.gdb/a0000000e.gdbtable
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000011.gdbtable
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/a00000011.gdbtablx
Binary file not shown.
Binary file removed tests/data/CritereArretsSTS.gdb/a00000012.gdbindexes
Binary file not shown.
Binary file removed tests/data/CritereArretsSTS.gdb/a00000012.gdbtable
Binary file not shown.
Binary file not shown.
Binary file removed tests/data/CritereArretsSTS.gdb/a00000012.spx
Binary file not shown.
Binary file modified tests/data/CritereArretsSTS.gdb/timestamps
Binary file not shown.

0 comments on commit 203bccd

Please sign in to comment.