Skip to content

Commit

Permalink
Fix relation target for visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
Waguramu committed Jan 24, 2025
1 parent ac31970 commit 847f363
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/core/src/rule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void FeatureStyleRule::parse(const YAML::Node& yaml)
attributeType_ = yaml["attribute-type"].as<std::string>();
}
if (yaml["attribute-filter"].IsDefined()) {
// Parse an attribute based on it's field value, e.g. `speedLimitKmh > 100`
// Parse an attribute based on its field value, e.g. `speedLimitKmh > 100`
attributeFilter_ = yaml["attribute-filter"].as<std::string>();
}
if (yaml["attribute-layer-type"].IsDefined()) {
Expand Down
8 changes: 5 additions & 3 deletions libs/core/src/visualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ void RecursiveRelationVisualizationState::render(
return result;
};
auto sourceGeoms = convertMultiValidityWithFallback(r.relation_->sourceValidityOrNull(), r.sourceFeature_);
auto targetGeoms = convertMultiValidityWithFallback(r.relation_->sourceValidityOrNull(), r.sourceFeature_);;
auto targetGeoms = convertMultiValidityWithFallback(r.relation_->targetValidityOrNull(), r.targetFeature_);;

// Get offset base vector.
auto offsetBase = localWgs84UnitCoordinateSystem(sourceGeoms[0]);
Expand All @@ -984,22 +984,24 @@ void RecursiveRelationVisualizationState::render(
visu_.addLine(p1hi, p2hi, UnselectableId, rule_, boundEvalFun, offset);
}
if (rule_.relationLineEndMarkerStyle()) {
if (visualizedFeatures_.emplace(sourceId + "-endmarker").second)
if (visualizedFeatures_.emplace(sourceId + "-endmarker").second) {
visu_.addLine(
p1lo,
p1hi,
UnselectableId,
*rule_.relationLineEndMarkerStyle(),
boundEvalFun,
offsetBase * rule_.relationLineEndMarkerStyle()->offset());
if (visualizedFeatures_.emplace(targetId + "-endmarker").second)
}
if (visualizedFeatures_.emplace(targetId + "-endmarker").second) {
visu_.addLine(
p2lo,
p2hi,
UnselectableId,
*rule_.relationLineEndMarkerStyle(),
boundEvalFun,
offsetBase * rule_.relationLineEndMarkerStyle()->offset());
}
}
}

Expand Down

0 comments on commit 847f363

Please sign in to comment.