Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[optional] include location_id column in time filter output #69

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions travel_time_platform_plugin/algorithms/advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ def processAlgorithmOutput(self, results, parameters, context, feedback):

output_fields = QgsFields(locations.fields())
output_fields.append(QgsField("search_id", QVariant.String, "text"))
output_fields.append(QgsField("location_id", QVariant.String, "text"))
output_fields.append(QgsField("reachable", QVariant.Int, "int"))

for prop in self.enabled_properties():
Expand Down Expand Up @@ -928,6 +929,7 @@ def clone_feature(id_):
for properties in location["properties"]:
feature = clone_feature(location["id"])
feature.setAttribute("search_id", result["search_id"])
feature.setAttribute("location_id", location["id"])
feature.setAttribute("reachable", 1)
for prop in self.enabled_properties():
feature.setAttribute(
Expand All @@ -937,6 +939,7 @@ def clone_feature(id_):
for id_ in result["unreachable"]:
feature = clone_feature(id_)
feature.setAttribute("search_id", result["search_id"])
feature.setAttribute("location_id", id_)
feature.setAttribute("reachable", 0)
sink.addFeature(feature, QgsFeatureSink.FastInsert)

Expand Down