Skip to content

Commit

Permalink
Merge pull request #125 from MIERUNE/fix/other-renderer-types
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanahiro authored Aug 9, 2023
2 parents 4f8e16b + a46c947 commit f1f8bcf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
15 changes: 14 additions & 1 deletion translator/vector/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def process_vector(
result = _process_graduated(layer, extent, idx, output_dir)
elif layer.renderer().type() == "singleSymbol":
result = _process_singlesymbol(layer, extent, idx, output_dir)

else:
result = _process_unsupported_renderer(layer, extent, idx, output_dir)
return result


Expand Down Expand Up @@ -306,3 +307,15 @@ def _process_singlesymbol(
"has_unsupported_symbol": has_unsupported_symbol,
"completed": True,
}


def _process_unsupported_renderer(
layer: QgsVectorLayer, extent: QgsRectangle, idx: int, output_dir: str
) -> dict:
return {
"idx": idx,
"layer_name": layer.name(),
"has_unsupported_symbol": False,
"reason": "unsupported renderer",
"completed": False,
}
11 changes: 11 additions & 0 deletions ui/main_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ def _run(self):
)
)

# list-up layers NOT completed and its reason
layers_not_completed = list(
map(
lambda r: f"{r['layer_name']} : {r['reason']}",
list(filter(lambda r: r["completed"] is False, results)),
)
)

# list-up layers processed successfully: layer_0, layer_2, layer_5, ...
layers_processed_successfully = list(
map(
Expand Down Expand Up @@ -147,6 +155,9 @@ def _run(self):
シンプルシンボルに変換しました。\n"
+ "\n".join(layers_has_unsupported_symbol)
)
if len(layers_not_completed) > 0:
msg += "\n\n以下のレイヤーは出力できませんでした。\n"
msg += "\n".join(layers_not_completed)
QMessageBox.information(
None,
"完了",
Expand Down

0 comments on commit f1f8bcf

Please sign in to comment.