diff --git a/qc_opendrive/checks/basic/fileheader_is_present.py b/qc_opendrive/checks/basic/fileheader_is_present.py index a5485ea..5cd93fb 100644 --- a/qc_opendrive/checks/basic/fileheader_is_present.py +++ b/qc_opendrive/checks/basic/fileheader_is_present.py @@ -56,3 +56,12 @@ def check_rule(checker_data: models.CheckerData) -> None: xpath=checker_data.input_file_xml_root.getpath(root), description=f"No child element header", ) + + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=root.sourceline, + column=0, + description="No child element header", + ) diff --git a/qc_opendrive/checks/basic/root_tag_is_opendrive.py b/qc_opendrive/checks/basic/root_tag_is_opendrive.py index 14a0dbf..6f63d1e 100644 --- a/qc_opendrive/checks/basic/root_tag_is_opendrive.py +++ b/qc_opendrive/checks/basic/root_tag_is_opendrive.py @@ -51,3 +51,12 @@ def check_rule(checker_data: models.CheckerData) -> bool: xpath=checker_data.input_file_xml_root.getpath(root), description=f"Root is not OpenDRIVE", ) + + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=root.sourceline, + column=0, + description="Root is not OpenDRIVE", + ) diff --git a/qc_opendrive/checks/basic/version_is_defined.py b/qc_opendrive/checks/basic/version_is_defined.py index b1aa390..da52746 100644 --- a/qc_opendrive/checks/basic/version_is_defined.py +++ b/qc_opendrive/checks/basic/version_is_defined.py @@ -101,3 +101,12 @@ def check_rule(checker_data: models.CheckerData) -> bool: xpath=checker_data.input_file_xml_root.getpath(file_header_tag), description=f"Header tag has invalid or missing version info", ) + + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=file_header_tag.sourceline, + column=0, + description="Header tag has invalid or missing version info", + ) diff --git a/qc_opendrive/checks/geometry/road_geometry_parampoly3_arclength_range.py b/qc_opendrive/checks/geometry/road_geometry_parampoly3_arclength_range.py index 926da18..c50fbf3 100644 --- a/qc_opendrive/checks/geometry/road_geometry_parampoly3_arclength_range.py +++ b/qc_opendrive/checks/geometry/road_geometry_parampoly3_arclength_range.py @@ -66,6 +66,15 @@ def _check_all_roads(checker_data: models.CheckerData) -> None: description=f"Length does not match the actual curve length. The estimated absolute error from numerical integration is {estimated_error}", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=geometry.sourceline, + column=0, + description=f"Length does not match the actual curve length. The estimated absolute error from numerical integration is {estimated_error}", + ) + s_coordinate = utils.get_s_from_geometry(geometry) if s_coordinate is None: continue diff --git a/qc_opendrive/checks/geometry/road_geometry_parampoly3_length_match.py b/qc_opendrive/checks/geometry/road_geometry_parampoly3_length_match.py index 3473694..fc1a987 100644 --- a/qc_opendrive/checks/geometry/road_geometry_parampoly3_length_match.py +++ b/qc_opendrive/checks/geometry/road_geometry_parampoly3_length_match.py @@ -65,6 +65,15 @@ def _check_all_roads(checker_data: models.CheckerData) -> None: description=f"Length does not match the actual curve length. The estimated absolute error from numerical integration is {estimated_error}", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=geometry.sourceline, + column=0, + description=f"Length does not match the actual curve length. The estimated absolute error from numerical integration is {estimated_error}", + ) + s_coordinate = utils.get_s_from_geometry(geometry) if s_coordinate is None: continue diff --git a/qc_opendrive/checks/geometry/road_geometry_parampoly3_normalized_range.py b/qc_opendrive/checks/geometry/road_geometry_parampoly3_normalized_range.py index 82e3356..325fb31 100644 --- a/qc_opendrive/checks/geometry/road_geometry_parampoly3_normalized_range.py +++ b/qc_opendrive/checks/geometry/road_geometry_parampoly3_normalized_range.py @@ -65,6 +65,15 @@ def _check_all_roads(checker_data: models.CheckerData) -> None: description=f"Length does not match the actual curve length. The estimated absolute error from numerical integration is {estimated_error}", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=geometry.sourceline, + column=0, + description=f"Length does not match the actual curve length. The estimated absolute error from numerical integration is {estimated_error}", + ) + s_coordinate = utils.get_s_from_geometry(geometry) if s_coordinate is None: continue diff --git a/qc_opendrive/checks/geometry/road_lane_border_overlap_with_inner_lanes.py b/qc_opendrive/checks/geometry/road_lane_border_overlap_with_inner_lanes.py index 724fdcf..7aef156 100644 --- a/qc_opendrive/checks/geometry/road_lane_border_overlap_with_inner_lanes.py +++ b/qc_opendrive/checks/geometry/road_lane_border_overlap_with_inner_lanes.py @@ -132,6 +132,15 @@ def _raise_issue( description=f"Outer lane border intersects or stays within inner lane border.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=left_lane.sourceline, + column=0, + description=f"Outer lane border intersects or stays within inner lane border.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -140,6 +149,15 @@ def _raise_issue( description=f"Outer lane border intersects or stays within inner lane border.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=right_lane.sourceline, + column=0, + description=f"Outer lane border intersects or stays within inner lane border.", + ) + s_section = utils.get_s_from_lane_section(lane_section_with_length.lane_section) if s_section is None: diff --git a/qc_opendrive/checks/performance/performance_avoid_redundant_info.py b/qc_opendrive/checks/performance/performance_avoid_redundant_info.py index 04c18f2..d5b425b 100644 --- a/qc_opendrive/checks/performance/performance_avoid_redundant_info.py +++ b/qc_opendrive/checks/performance/performance_avoid_redundant_info.py @@ -48,6 +48,15 @@ def _check_road_superelevations( description=f"Redundant superelevation declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_superelevation.xml_element.sourceline, + column=0, + description=f"Redundant superelevation declaration.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -58,6 +67,15 @@ def _check_road_superelevations( description=f"Redundant superelevation declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=next_superelevation.xml_element.sourceline, + column=0, + description=f"Redundant superelevation declaration.", + ) + inertial_point = utils.get_point_xyz_from_road_reference_line( road, next_superelevation.s_offset ) @@ -99,6 +117,15 @@ def _check_road_elevations( description=f"Redundant elevation declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_elevation.xml_element.sourceline, + column=0, + description=f"Redundant superelevation declaration.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -109,6 +136,15 @@ def _check_road_elevations( description=f"Redundant elevation declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=next_elevation.xml_element.sourceline, + column=0, + description=f"Redundant elevation declaration.", + ) + inertial_point = utils.get_point_xyz_from_road_reference_line( road, next_elevation.s_offset ) @@ -150,6 +186,15 @@ def _check_lane_offsets( description=f"Redundant lane offset declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_lane_offset.xml_element.sourceline, + column=0, + description=f"Redundant lane offset declaration.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -160,6 +205,15 @@ def _check_lane_offsets( description=f"Redundant lane offset declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=next_lane_offset.xml_element.sourceline, + column=0, + description=f"Redundant lane offset declaration.", + ) + s = next_lane_offset.s_offset t = utils.poly3_to_polynomial(next_lane_offset.poly3)(0.0) @@ -214,6 +268,15 @@ def _check_road_plan_view( description=f"Redundant line geometry declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_geometry.sourceline, + column=0, + description=f"Redundant line geometry declaration.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -222,6 +285,15 @@ def _check_road_plan_view( description=f"Redundant line geometry declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=next_geometry.sourceline, + column=0, + description=f"Redundant line geometry declaration.", + ) + s_offset = utils.get_s_from_geometry(next_geometry) if s_offset is not None: inertial_point = utils.get_point_xyz_from_road_reference_line( @@ -268,6 +340,15 @@ def _check_lane_widths( description=f"Redundant lane width declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_width.xml_element.sourceline, + column=0, + description=f"Redundant lane width declaration.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -276,6 +357,15 @@ def _check_lane_widths( description=f"Redundant lane width declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=next_width.xml_element.sourceline, + column=0, + description=f"Redundant lane width declaration.", + ) + s_section = utils.get_s_from_lane_section(lane_section) if s_section is None: @@ -328,6 +418,15 @@ def _check_lane_borders( description=f"Redundant lane border declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_border.xml_element.sourceline, + column=0, + description=f"Redundant lane border declaration.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -336,6 +435,15 @@ def _check_lane_borders( description=f"Redundant lane border declaration.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=next_border.xml_element.sourceline, + column=0, + description=f"Redundant lane border declaration.", + ) + s_section = utils.get_s_from_lane_section(lane_section) if s_section is None: diff --git a/qc_opendrive/checks/semantic/junctions_connection_connect_road_no_incoming_road.py b/qc_opendrive/checks/semantic/junctions_connection_connect_road_no_incoming_road.py index f65c03f..4bd345d 100644 --- a/qc_opendrive/checks/semantic/junctions_connection_connect_road_no_incoming_road.py +++ b/qc_opendrive/checks/semantic/junctions_connection_connect_road_no_incoming_road.py @@ -53,6 +53,15 @@ def _check_junctions_connection_connect_road_no_incoming_road( description="Connection with connecting road found as incoming road.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connection.sourceline, + column=0, + description=f"Connection with connecting road found as incoming road.", + ) + successor_junction_id = utils.get_linked_junction_id( incoming_road, models.LinkageTag.SUCCESSOR ) diff --git a/qc_opendrive/checks/semantic/junctions_connection_end_opposite_linkage.py b/qc_opendrive/checks/semantic/junctions_connection_end_opposite_linkage.py index c273394..2e7a0d4 100644 --- a/qc_opendrive/checks/semantic/junctions_connection_end_opposite_linkage.py +++ b/qc_opendrive/checks/semantic/junctions_connection_end_opposite_linkage.py @@ -40,6 +40,15 @@ def _raise_issue( description=f"Contact point 'end' not used on successor road connection.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connection.sourceline, + column=0, + description=f"Contact point 'end' not used on successor road connection.", + ) + inertial_point = utils.get_end_point_xyz_from_road_reference_line(connection_road) if inertial_point is not None: checker_data.result.add_inertial_location( diff --git a/qc_opendrive/checks/semantic/junctions_connection_one_connection_element.py b/qc_opendrive/checks/semantic/junctions_connection_one_connection_element.py index daeb694..ed541e5 100644 --- a/qc_opendrive/checks/semantic/junctions_connection_one_connection_element.py +++ b/qc_opendrive/checks/semantic/junctions_connection_one_connection_element.py @@ -68,6 +68,15 @@ def _check_junctions_connection_one_connection_element( description="Connection with reused connecting road id.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connection.sourceline, + column=0, + description=f"Connection with reused connecting road id.", + ) + connecting_road = road_id_map.get(connecting_road_id) if connecting_road is not None: inertial_point = utils.get_middle_point_xyz_from_road_reference_line( diff --git a/qc_opendrive/checks/semantic/junctions_connection_one_link_to_incoming.py b/qc_opendrive/checks/semantic/junctions_connection_one_link_to_incoming.py index f2c5e05..c6b424b 100644 --- a/qc_opendrive/checks/semantic/junctions_connection_one_link_to_incoming.py +++ b/qc_opendrive/checks/semantic/junctions_connection_one_link_to_incoming.py @@ -46,6 +46,15 @@ def _raise_lane_linkage_issue( description=f"Lane link in opposite direction.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=lane_link.sourceline, + column=0, + description=f"Lane link in opposite direction.", + ) + s = None if connecting_contact_point == models.ContactPoint.START: s = 0 @@ -564,6 +573,15 @@ def _check_junctions_connection_one_link_to_incoming( description=f"Connection with reused (incoming_road_id, connecting_road_id) = ({incoming_road_id}, {connecting_road_id}) pair.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connection.sourceline, + column=0, + description=f"Connection with reused (incoming_road_id, connecting_road_id) = ({incoming_road_id}, {connecting_road_id}) pair.", + ) + has_start_contact_point = False has_end_contact_point = False for connection in connections: diff --git a/qc_opendrive/checks/semantic/junctions_connection_start_along_linkage.py b/qc_opendrive/checks/semantic/junctions_connection_start_along_linkage.py index 33b97a4..9fcc546 100644 --- a/qc_opendrive/checks/semantic/junctions_connection_start_along_linkage.py +++ b/qc_opendrive/checks/semantic/junctions_connection_start_along_linkage.py @@ -40,6 +40,15 @@ def _raise_issue( description=f"Contact point 'start' not used on predecessor road connection.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connection.sourceline, + column=0, + description=f"Contact point 'start' not used on predecessor road connection.", + ) + inertial_point = utils.get_start_point_xyz_from_road_reference_line(connection_road) if inertial_point is not None: checker_data.result.add_inertial_location( diff --git a/qc_opendrive/checks/semantic/road_lane_access_no_mix_of_deny_or_allow.py b/qc_opendrive/checks/semantic/road_lane_access_no_mix_of_deny_or_allow.py index 43a7cff..faaf436 100644 --- a/qc_opendrive/checks/semantic/road_lane_access_no_mix_of_deny_or_allow.py +++ b/qc_opendrive/checks/semantic/road_lane_access_no_mix_of_deny_or_allow.py @@ -86,6 +86,15 @@ def _check_all_roads(checker_data: models.CheckerData) -> None: description=f"First encounter of {current_rule} having {previous_rule} before.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=access.sourceline, + column=0, + description=f"First encounter of {current_rule} having {previous_rule} before.", + ) + if s_section is None: continue diff --git a/qc_opendrive/checks/semantic/road_lane_level_true_one_side.py b/qc_opendrive/checks/semantic/road_lane_level_true_one_side.py index 2ed329c..0a54337 100644 --- a/qc_opendrive/checks/semantic/road_lane_level_true_one_side.py +++ b/qc_opendrive/checks/semantic/road_lane_level_true_one_side.py @@ -66,6 +66,15 @@ def _check_true_level_on_side( description=f"Lane id {index} @level=False where previous lane id @level=True.", ) + result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=lane.sourceline, + column=0, + description=f"Lane id {index} @level=False where previous lane id @level=True.", + ) + s_section = utils.get_s_from_lane_section( lane_section_with_length.lane_section ) @@ -95,7 +104,8 @@ def _get_linkage_level_warnings( target_lane_section: etree._ElementTree, linkage_tag: models.LinkageTag, ): - warnings: Set[str] = set() + warnings: List[str] = [] + warnings_linenr: List[int] = [] for lane in utils.get_left_and_right_lanes_from_lane_section(current_lane_section): lane_level = utils.get_lane_level_from_lane(lane) @@ -114,9 +124,10 @@ def _get_linkage_level_warnings( linkage_level = utils.get_lane_level_from_lane(linkage_lane) if linkage_level != lane_level: - warnings.add(root.getpath(lane)) + warnings.append(root.getpath(lane)) + warnings_linenr.append(lane.sourceline) - return warnings + return warnings, warnings_linenr def _check_level_change_between_lane_sections( @@ -136,23 +147,24 @@ def _check_level_change_between_lane_sections( function will register the issue twice, one for each linkage. """ - predecessor_warnings = _get_linkage_level_warnings( + predecessor_warnings, predecessor_warnings_linenr = _get_linkage_level_warnings( root=root, current_lane_section=current_lane_section, target_lane_section=previous_lane_section, linkage_tag=models.LinkageTag.PREDECESSOR, ) - successor_warnings = _get_linkage_level_warnings( + successor_warnings, successor_warnings_linenr = _get_linkage_level_warnings( root=root, current_lane_section=previous_lane_section, target_lane_section=current_lane_section, linkage_tag=models.LinkageTag.SUCCESSOR, ) - warnings = predecessor_warnings | successor_warnings - warnings = sorted(list(warnings)) + warnings = predecessor_warnings + successor_warnings + warnings_linenr = predecessor_warnings_linenr + successor_warnings_linenr + warnings_sorted = sorted(zip(warnings, warnings_linenr), key=lambda x: x[1]) - for warning in warnings: + for warning, warning_linenr in warnings_sorted: issue_id = result.register_issue( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -168,6 +180,15 @@ def _check_level_change_between_lane_sections( description="Lane levels are not the same in two consecutive lane sections", ) + result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=warning_linenr, + column=0, + description="Lane levels are not the same in two consecutive lane sections", + ) + def _check_level_change_linkage_roads( linkage_tag: models.LinkageTag, @@ -232,6 +253,15 @@ def _check_level_change_linkage_roads( description="Lane levels are not the same between two connected roads.", ) + result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=lane.sourceline, + column=0, + description=f"Lane levels are not the same between two connected roads.", + ) + result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -240,6 +270,15 @@ def _check_level_change_linkage_roads( description="Lane levels are not the same between two connected roads.", ) + result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=other_lane.sourceline, + column=0, + description=f"Lane levels are not the same between two connected roads.", + ) + s = None if linkage_tag == models.LinkageTag.PREDECESSOR: s = 0 @@ -409,6 +448,15 @@ def _check_level_among_junctions( description="Lane levels are not the same between incoming road and junction.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=incoming_lane.sourceline, + column=0, + description=f"Lane levels are not the same between incoming road and junction.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -417,6 +465,15 @@ def _check_level_among_junctions( description="Lane levels are not the same between incoming road and junction.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connection_lane.sourceline, + column=0, + description=f"Lane levels are not the same between incoming road and junction.", + ) + def check_rule(checker_data: models.CheckerData) -> None: """ diff --git a/qc_opendrive/checks/semantic/road_lane_link_lanes_across_lane_sections.py b/qc_opendrive/checks/semantic/road_lane_link_lanes_across_lane_sections.py index 6c99663..839b9a1 100644 --- a/qc_opendrive/checks/semantic/road_lane_link_lanes_across_lane_sections.py +++ b/qc_opendrive/checks/semantic/road_lane_link_lanes_across_lane_sections.py @@ -66,6 +66,15 @@ def _check_two_lane_sections_one_direction( description="Missing lane link.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=connecting_lane.sourceline, + column=0, + description=f"Missing lane link.", + ) + def _check_two_lane_sections( checker_data: models.CheckerData, diff --git a/qc_opendrive/checks/semantic/road_lane_link_new_lane_appear.py b/qc_opendrive/checks/semantic/road_lane_link_new_lane_appear.py index 7c842c3..16d3b84 100644 --- a/qc_opendrive/checks/semantic/road_lane_link_new_lane_appear.py +++ b/qc_opendrive/checks/semantic/road_lane_link_new_lane_appear.py @@ -46,6 +46,15 @@ def _raise_issue( description=f"Lane with {linkage_tag.value} with width zero.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=lane.sourceline, + column=0, + description=f"Lane with {linkage_tag.value} with width zero.", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -54,6 +63,15 @@ def _raise_issue( description=f"{linkage_tag.value.capitalize()} lane with width zero.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=width_zero_lane.sourceline, + column=0, + description=f"{linkage_tag.value.capitalize()} lane with width zero.", + ) + def _check_successor_with_width_zero_between_lane_sections( checker_data: models.CheckerData, diff --git a/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_end.py b/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_end.py index ff0f7ce..b93a469 100644 --- a/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_end.py +++ b/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_end.py @@ -46,6 +46,15 @@ def _raise_issue( description="Lane with width zero and successors.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=lane.sourceline, + column=0, + description=f"Lane with width zero and successors.", + ) + s_section = utils.get_s_from_lane_section(lane_section_with_length.lane_section) if s_section is None: diff --git a/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_start.py b/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_start.py index c9b1053..f8a3a35 100644 --- a/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_start.py +++ b/qc_opendrive/checks/semantic/road_lane_link_zero_width_at_start.py @@ -46,6 +46,15 @@ def _raise_issue( description="Lane with width zero and predecessors.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=lane.sourceline, + column=0, + description=f"Lane with width zero and predecessors.", + ) + s = utils.get_s_from_lane_section(lane_section) if s is None: diff --git a/qc_opendrive/checks/semantic/road_linkage_is_junction_needed.py b/qc_opendrive/checks/semantic/road_linkage_is_junction_needed.py index 50100e6..1142670 100644 --- a/qc_opendrive/checks/semantic/road_linkage_is_junction_needed.py +++ b/qc_opendrive/checks/semantic/road_linkage_is_junction_needed.py @@ -45,6 +45,15 @@ def _raise_road_linkage_is_junction_needed_issue( description=f"Road cannot have ambiguous {linkage_tag.value}, a junction is needed.", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=element.sourceline, + column=0, + description=f"Road cannot have ambiguous {linkage_tag.value}, a junction is needed.", + ) + if problematic_road is not None: inertial_point = None if linkage_tag == models.LinkageTag.PREDECESSOR: diff --git a/qc_opendrive/checks/smoothness/lane_smoothness_contact_point_no_horizontal_gaps.py b/qc_opendrive/checks/smoothness/lane_smoothness_contact_point_no_horizontal_gaps.py index 64ef282..69bd9c9 100644 --- a/qc_opendrive/checks/smoothness/lane_smoothness_contact_point_no_horizontal_gaps.py +++ b/qc_opendrive/checks/smoothness/lane_smoothness_contact_point_no_horizontal_gaps.py @@ -63,6 +63,16 @@ def _raise_geometry_gap_issue( xpath=checker_data.input_file_xml_root.getpath(previous_geometry), description=f"First geometry element", ) + + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=previous_geometry.sourceline, + column=0, + description=f"First geometry element", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -71,6 +81,15 @@ def _raise_geometry_gap_issue( description=f"Second geometry element", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=geometry.sourceline, + column=0, + description=f"Second geometry element", + ) + if inertial_point is not None: checker_data.result.add_inertial_location( checker_bundle_name=constants.BUNDLE_NAME, @@ -121,6 +140,16 @@ def _raise_lane_linkage_gap_issue( xpath=issue_xpaths[0], description=f"First lane element", ) + + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=previous_lane.sourceline, + column=0, + description=f"First lane element", + ) + checker_data.result.add_xml_location( checker_bundle_name=constants.BUNDLE_NAME, checker_id=CHECKER_ID, @@ -129,6 +158,15 @@ def _raise_lane_linkage_gap_issue( description=f"Next lane element", ) + checker_data.result.add_file_location( + checker_bundle_name=constants.BUNDLE_NAME, + checker_id=CHECKER_ID, + issue_id=issue_id, + row=current_lane.sourceline, + column=0, + description=f"Next lane element", + ) + if inertial_point is not None: checker_data.result.add_inertial_location( checker_bundle_name=constants.BUNDLE_NAME,