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

feat(lanelet2_extension): add multi osm parser #234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StepTurtle
Copy link

Description

I have added a new library class to facilitate the loading of multiple OSM files in lanelet2_extension. These changes were made to support dynamic lanelet loading.

Related links

Proposal Link

Tests performed

In this video, the map in background loaded with current approach and the white map load new class and cannot see any difference. Also the maps which loaded with new class tested with mission and behavior planner and cannot see any problem.

dynamic_load_map.webm

Notes for reviewers

Interface changes

Effects on system behavior

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@StepTurtle StepTurtle changed the title Add multi osm parser feat(lanelet2_extension): add multi osm parser Jan 30, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/15)


#include <string>

using namespace std::string_literals;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-global-names-in-headers ⚠️
using declarations in the global namespace in headers are prohibited

Comment on lines +32 to +39
namespace lanelet
{
namespace io_handlers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
namespace lanelet
{
namespace io_handlers
namespace lanelet::io_handlers

void parserError(Id id, const std::string & what);
};
} // namespace
} // namespace io_handlers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
} // namespace io_handlers

std::unique_ptr<LaneletMap> parse(
const std::vector<std::string> & lanelet2_filenames, ErrorMessages & errors) const;

std::unique_ptr<LaneletMap> fromOsmFile(const osm::File & file, ErrorMessages & errors) const;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function fromOsmFile

Suggested change
std::unique_ptr<LaneletMap> fromOsmFile(const osm::File & file, ErrorMessages & errors) const;
std::unique_ptr<LaneletMap> from_osm_file(const osm::File & file, ErrorMessages & errors) const;


std::unique_ptr<LaneletMap> fromOsmFile(const osm::File & file, ErrorMessages & errors) const;

std::unique_ptr<LaneletMap> fromOsmFile(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function fromOsmFile

Suggested change
std::unique_ptr<LaneletMap> fromOsmFile(
std::unique_ptr<LaneletMap> from_osm_file(

std::unique_ptr<LaneletMap> fromOsmFile(
const std::map<std::string, osm::File> & files_map, ErrorMessages & errors) const;

static void parseVersions(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function parseVersions

Suggested change
static void parseVersions(
static void parse_versions(

static constexpr const char * name() { return "autoware_multi_osm_handler"; }
};

namespace
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-build-namespaces ⚠️
do not use unnamed namespaces in header files


namespace
{
RegisterParser<MultiOsmParser> regParser;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ misc-definitions-in-headers ⚠️
variable regParser defined in a header file; variable definitions in header files can lead to ODR violations


namespace
{
RegisterParser<MultiOsmParser> regParser;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regParser

Suggested change
RegisterParser<MultiOsmParser> regParser;
RegisterParser<MultiOsmParser> reg_parser;

class MultiFileLoader
{
public:
static std::unique_ptr<LaneletMap> loadMap(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadMap

Suggested change
static std::unique_ptr<LaneletMap> loadMap(
static std::unique_ptr<LaneletMap> load_map(

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (2/15)

MultiFileLoader loader;
loader.loadNodes(file.nodes, projector);
loader.loadWays(file.ways);
auto laneletsWithRelation = loader.loadLanelets(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto lanelets_with_relation = loader.loadLanelets(file.relations);

auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto areasWithRelation = loader.loadAreas(file.relations);
loader.loadRegulatoryElements(file.relations);
loader.addRegulatoryElements(laneletsWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(lanelets_with_relation);

loader.loadNodes(file.nodes, projector);
loader.loadWays(file.ways);
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto areasWithRelation = loader.loadAreas(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
auto areasWithRelation = loader.loadAreas(file.relations);
auto areas_with_relation = loader.loadAreas(file.relations);

auto areasWithRelation = loader.loadAreas(file.relations);
loader.loadRegulatoryElements(file.relations);
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
loader.addRegulatoryElements(areasWithRelation);
loader.addRegulatoryElements(areas_with_relation);

loader.lineStrings_, loader.points_);
}

static std::unique_ptr<LaneletMap> loadMap(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadMap

Suggested change
static std::unique_ptr<LaneletMap> loadMap(
static std::unique_ptr<LaneletMap> load_map(

loader.loadWays(file.second.ways);
});

LaneletsWithRegulatoryElements laneletsWithRelation;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
LaneletsWithRegulatoryElements laneletsWithRelation;
LaneletsWithRegulatoryElements lanelets_with_relation;


LaneletsWithRegulatoryElements laneletsWithRelation;
for (const auto & file : files_map) {
laneletsWithRelation = loader.loadLanelets(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
laneletsWithRelation = loader.loadLanelets(file.second.relations);
lanelets_with_relation = loader.loadLanelets(file.second.relations);

for (const auto & file : files_map) {
loader.loadRegulatoryElements(file.second.relations);
}
loader.addRegulatoryElements(laneletsWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable laneletsWithRelation

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(lanelets_with_relation);

laneletsWithRelation = loader.loadLanelets(file.second.relations);
}

AreasWithRegulatoryElements areasWithRelation;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
AreasWithRegulatoryElements areasWithRelation;
AreasWithRegulatoryElements areas_with_relation;


AreasWithRegulatoryElements areasWithRelation;
for (const auto & file : files_map) {
areasWithRelation = loader.loadAreas(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
areasWithRelation = loader.loadAreas(file.second.relations);
areas_with_relation = loader.loadAreas(file.second.relations);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (3/15)

loader.loadRegulatoryElements(file.second.relations);
}
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable areasWithRelation

Suggested change
loader.addRegulatoryElements(areasWithRelation);
loader.addRegulatoryElements(areas_with_relation);


MultiFileLoader() = default;

void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadNodes has internal linkage but is not defined

const osm::File & file, const Projector & projector, ErrorMessages & errors)
{
MultiFileLoader loader;
loader.loadNodes(file.nodes, projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadNodes

Suggested change
loader.loadNodes(file.nodes, projector);
loader.load_nodes(file.nodes, projector);

MultiFileLoader loader;

std::for_each(files_map.begin(), files_map.end(), [&loader, &projector](const auto & file) {
loader.loadNodes(file.second.nodes, projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadNodes

Suggested change
loader.loadNodes(file.second.nodes, projector);
loader.load_nodes(file.second.nodes, projector);


MultiFileLoader() = default;

void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadNodes

Suggested change
void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);
void load_nodes(const lanelet::osm::Nodes & nodes, const Projector & projector);


void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);

void loadWays(const lanelet::osm::Ways & ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadWays has internal linkage but is not defined

{
MultiFileLoader loader;
loader.loadNodes(file.nodes, projector);
loader.loadWays(file.ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadWays

Suggested change
loader.loadWays(file.ways);
loader.load_ways(file.ways);

});

std::for_each(files_map.begin(), files_map.end(), [&loader](const auto & file) {
loader.loadWays(file.second.ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadWays

Suggested change
loader.loadWays(file.second.ways);
loader.load_ways(file.second.ways);


void loadNodes(const lanelet::osm::Nodes & nodes, const Projector & projector);

void loadWays(const lanelet::osm::Ways & ways);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadWays

Suggested change
void loadWays(const lanelet::osm::Ways & ways);
void load_ways(const lanelet::osm::Ways & ways);


void loadWays(const lanelet::osm::Ways & ways);

LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadLanelets has internal linkage but is not defined

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (4/15)

MultiFileLoader loader;
loader.loadNodes(file.nodes, projector);
loader.loadWays(file.ways);
auto laneletsWithRelation = loader.loadLanelets(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadLanelets

Suggested change
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto laneletsWithRelation = loader.load_lanelets(file.relations);


LaneletsWithRegulatoryElements laneletsWithRelation;
for (const auto & file : files_map) {
laneletsWithRelation = loader.loadLanelets(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadLanelets

Suggested change
laneletsWithRelation = loader.loadLanelets(file.second.relations);
laneletsWithRelation = loader.load_lanelets(file.second.relations);


void loadWays(const lanelet::osm::Ways & ways);

LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadLanelets

Suggested change
LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);
LaneletsWithRegulatoryElements load_lanelets(const lanelet::osm::Relations & relations);


LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);

AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadAreas has internal linkage but is not defined

loader.loadNodes(file.nodes, projector);
loader.loadWays(file.ways);
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto areasWithRelation = loader.loadAreas(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadAreas

Suggested change
auto areasWithRelation = loader.loadAreas(file.relations);
auto areasWithRelation = loader.load_areas(file.relations);


AreasWithRegulatoryElements areasWithRelation;
for (const auto & file : files_map) {
areasWithRelation = loader.loadAreas(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadAreas

Suggested change
areasWithRelation = loader.loadAreas(file.second.relations);
areasWithRelation = loader.load_areas(file.second.relations);


LaneletsWithRegulatoryElements loadLanelets(const lanelet::osm::Relations & relations);

AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadAreas

Suggested change
AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);
AreasWithRegulatoryElements load_areas(const lanelet::osm::Relations & relations);


AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);

void loadRegulatoryElements(const osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::loadRegulatoryElements has internal linkage but is not defined

loader.loadWays(file.ways);
auto laneletsWithRelation = loader.loadLanelets(file.relations);
auto areasWithRelation = loader.loadAreas(file.relations);
loader.loadRegulatoryElements(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadRegulatoryElements

Suggested change
loader.loadRegulatoryElements(file.relations);
loader.load_regulatory_elements(file.relations);

}

for (const auto & file : files_map) {
loader.loadRegulatoryElements(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadRegulatoryElements

Suggested change
loader.loadRegulatoryElements(file.second.relations);
loader.load_regulatory_elements(file.second.relations);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (5/15)


AreasWithRegulatoryElements loadAreas(const lanelet::osm::Relations & relations);

void loadRegulatoryElements(const osm::Relations & relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function loadRegulatoryElements

Suggested change
void loadRegulatoryElements(const osm::Relations & relations);
void load_regulatory_elements(const osm::Relations & relations);

void loadRegulatoryElements(const osm::Relations & relations);

template <typename PrimT>
void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::addRegulatoryElements<lanelet::Area> has internal linkage but is not defined

void loadRegulatoryElements(const osm::Relations & relations);

template <typename PrimT>
void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ clang-diagnostic-undefined-internal ⚠️
function lanelet::io_handlers::(anonymous namespace)::MultiFileLoader::addRegulatoryElements<lanelet::Lanelet> has internal linkage but is not defined

Comment on lines +77 to +83
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function addRegulatoryElements

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
loader.add_regulatory_elements(laneletsWithRelation);
loader.add_regulatory_elements(areasWithRelation);

Comment on lines +113 to +119
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function addRegulatoryElements

Suggested change
loader.addRegulatoryElements(laneletsWithRelation);
loader.addRegulatoryElements(areasWithRelation);
loader.add_regulatory_elements(laneletsWithRelation);
loader.add_regulatory_elements(areasWithRelation);

void loadRegulatoryElements(const osm::Relations & relations);

template <typename PrimT>
void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function addRegulatoryElements

Suggested change
void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);
void add_regulatory_elements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);

void addRegulatoryElements(std::vector<std::pair<PrimT, const osm::Relation *>> & addTos);

template <const char * Type>
bool isType(const lanelet::osm::Relation & relation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function isType

Suggested change
bool isType(const lanelet::osm::Relation & relation);
bool is_type(const lanelet::osm::Relation & relation);

template <const char * Type>
bool isType(const lanelet::osm::Relation & relation);

static lanelet::AttributeMap getAttributes(const lanelet::osm::Attributes & osmAttributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getAttributes

Suggested change
static lanelet::AttributeMap getAttributes(const lanelet::osm::Attributes & osmAttributes);
static lanelet::AttributeMap get_attributes(const lanelet::osm::Attributes & osmAttributes);


static lanelet::AttributeMap getAttributes(const lanelet::osm::Attributes & osmAttributes);

LineString3d getLaneletBorder(const osm::Relation & llElem, const std::string & role);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getLaneletBorder

Suggested change
LineString3d getLaneletBorder(const osm::Relation & llElem, const std::string & role);
LineString3d get_lanelet_border(const osm::Relation & llElem, const std::string & role);


LineString3d getLaneletBorder(const osm::Relation & llElem, const std::string & role);

LineStrings3d getLinestrings(const osm::Roles & roles, const std::string & roleName, Id refId);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getLinestrings

Suggested change
LineStrings3d getLinestrings(const osm::Roles & roles, const std::string & roleName, Id refId);
LineStrings3d get_linestrings(const osm::Roles & roles, const std::string & roleName, Id refId);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (6/15)


LineStrings3d getLinestrings(const osm::Roles & roles, const std::string & roleName, Id refId);

LineStrings3d getOuterRing(const osm::Relation & area);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getOuterRing

Suggested change
LineStrings3d getOuterRing(const osm::Relation & area);
LineStrings3d get_outer_ring(const osm::Relation & area);


LineStrings3d getOuterRing(const osm::Relation & area);

std::vector<LineStrings3d> getInnerRing(const osm::Relation & area);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getInnerRing

Suggested change
std::vector<LineStrings3d> getInnerRing(const osm::Relation & area);
std::vector<LineStrings3d> get_inner_ring(const osm::Relation & area);


std::vector<LineStrings3d> getInnerRing(const osm::Relation & area);

RuleParameterMap getRulesForRegulatoryElement(Id currElemId, const osm::Roles & roles);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getRulesForRegulatoryElement

Suggested change
RuleParameterMap getRulesForRegulatoryElement(Id currElemId, const osm::Roles & roles);
RuleParameterMap get_rules_for_regulatory_element(Id currElemId, const osm::Roles & roles);


RuleParameterMap getRulesForRegulatoryElement(Id currElemId, const osm::Roles & roles);

std::vector<LineStrings3d> assembleBoundary(LineStrings3d lineStrings, Id id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function assembleBoundary

Suggested change
std::vector<LineStrings3d> assembleBoundary(LineStrings3d lineStrings, Id id);
std::vector<LineStrings3d> assemble_boundary(LineStrings3d lineStrings, Id id);

std::vector<LineStrings3d> assembleBoundary(LineStrings3d lineStrings, Id id);

template <typename PrimT>
PrimT getOrGetDummy(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getOrGetDummy

Suggested change
PrimT getOrGetDummy(
PrimT get_or_get_dummy(

PrimT getOrGetDummy(
const typename std::unordered_map<Id, PrimT> & map, Id id, Id currentPrimitiveId);

void parserError(Id id, const std::string & what);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function parserError

Suggested change
void parserError(Id id, const std::string & what);
void parser_error(Id id, const std::string & what);

Comment on lines +31 to +33
namespace lanelet
{
namespace io_handlers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
namespace lanelet
{
namespace io_handlers
namespace lanelet::io_handlers

*map_version = metainfo.attribute("map_version").value();
}
}
} // namespace io_handlers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-concat-nested-namespaces ⚠️
nested namespaces can be concatenated

Suggested change
} // namespace io_handlers

using AreasWithRegulatoryElements = PrimitivesWithRegulatoryElement<Area>;
using LaneletsWithRegulatoryElements = PrimitivesWithRegulatoryElement<Lanelet>;

bool isValid(const LineStrings3d & lss)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function isValid

Suggested change
bool isValid(const LineStrings3d & lss)
bool is_valid(const LineStrings3d & lss)

// check if we closed the ring
if (currRing.back().back().id() == currRing.front().front().id()) {
// wohoo. Check the clockwise requirement.
if (!isValid(currRing)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function isValid

Suggested change
if (!isValid(currRing)) {
if (!is_valid(currRing)) {

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (7/15)

// wohoo. Check the clockwise requirement.
if (!isValid(currRing)) {
reverse(currRing);
if (!isValid(currRing)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function isValid

Suggested change
if (!isValid(currRing)) {
if (!is_valid(currRing)) {

}

template <typename PrimT>
PrimT getDummy(Id id)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getDummy

Suggested change
PrimT getDummy(Id id)
PrimT get_dummy(Id id)

return map.at(id);
} catch (std::out_of_range &) {
parserError(currentPrimitiveId, "Failed to get id "s + std::to_string(id) + " from map");
return getDummy<PrimT>(id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function getDummy

Suggested change
return getDummy<PrimT>(id);
return get_dummy<PrimT>(id);

return std::make_shared<GenericRegulatoryElement>(std::make_shared<RegulatoryElementData>(id));
}

Errors buildErrorMessage(const std::string & errorIntro, const Errors & errors)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function buildErrorMessage

Suggested change
Errors buildErrorMessage(const std::string & errorIntro, const Errors & errors)
Errors build_error_message(const std::string & errorIntro, const Errors & errors)

registerIds(file.second.relations);
}

errors = buildErrorMessage(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function buildErrorMessage

Suggested change
errors = buildErrorMessage(
errors = build_error_message(

registerIds(file.nodes);
registerIds(file.ways);
registerIds(file.relations);
errors = buildErrorMessage(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function buildErrorMessage

Suggested change
errors = buildErrorMessage(
errors = build_error_message(

Comment on lines +89 to +90
for (const auto & nodeElem : nodes) {
const auto & node = nodeElem.second;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable nodeElem

Suggested change
for (const auto & nodeElem : nodes) {
const auto & node = nodeElem.second;
for (const auto & node_elem : nodes) {
const auto & node = node_elem.second;

Comment on lines +102 to +103
for (const auto & wayElem : ways) {
const auto & way = wayElem.second;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable wayElem

Suggested change
for (const auto & wayElem : ways) {
const auto & way = wayElem.second;
for (const auto & way_elem : ways) {
const auto & way = way_elem.second;

Comment on lines +118 to +119
auto isArea = attributes.find(AttributeNamesString::Area);
if (isArea != attributes.end() && isArea->second.asBool().get_value_or(false)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable isArea

Suggested change
auto isArea = attributes.find(AttributeNamesString::Area);
if (isArea != attributes.end() && isArea->second.asBool().get_value_or(false)) {
auto is_area = attributes.find(AttributeNamesString::Area);
if (is_area != attributes.end() && is_area->second.asBool().get_value_or(false)) {

// The regulatory elements are not parsed yet. We store lanelets with one
// for
// later.
LaneletsWithRegulatoryElements llWithRegulatoryElement;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable llWithRegulatoryElement

Suggested change
LaneletsWithRegulatoryElements llWithRegulatoryElement;
LaneletsWithRegulatoryElements ll_with_regulatory_element;

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (8/15)

Comment on lines +158 to +161
llWithRegulatoryElement.push_back(std::make_pair(lanelet, &llElem));
}
}
return llWithRegulatoryElement;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable llWithRegulatoryElement

Suggested change
llWithRegulatoryElement.push_back(std::make_pair(lanelet, &llElem));
}
}
return llWithRegulatoryElement;
ll_with_regulatory_element.push_back(std::make_pair(lanelet, &llElem));
}
}
return ll_with_regulatory_element;

Comment on lines +134 to +135
for (const auto & relElem : relations) {
const auto & llElem = relElem.second;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable relElem

Suggested change
for (const auto & relElem : relations) {
const auto & llElem = relElem.second;
for (const auto & rel_elem : relations) {
const auto & llElem = rel_elem.second;

Comment on lines +135 to +136
const auto & llElem = relElem.second;
if (!isType<AttributeValueString::Lanelet>(llElem)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable llElem

Suggested change
const auto & llElem = relElem.second;
if (!isType<AttributeValueString::Lanelet>(llElem)) {
const auto & ll_elem = relElem.second;
if (!isType<AttributeValueString::Lanelet>(ll_elem)) {

Comment on lines +139 to +142
const auto id = llElem.id;
const auto attributes = getAttributes(llElem.attributes);
auto left = getLaneletBorder(llElem, RoleNameString::Left);
auto right = getLaneletBorder(llElem, RoleNameString::Right);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable llElem

Suggested change
const auto id = llElem.id;
const auto attributes = getAttributes(llElem.attributes);
auto left = getLaneletBorder(llElem, RoleNameString::Left);
auto right = getLaneletBorder(llElem, RoleNameString::Right);
const auto id = ll_elem.id;
const auto attributes = getAttributes(ll_elem.attributes);
auto left = getLaneletBorder(ll_elem, RoleNameString::Left);
auto right = getLaneletBorder(ll_elem, RoleNameString::Right);

Comment on lines +149 to +150
if (findRole(llElem.members, RoleNameString::Centerline) != llElem.members.end()) {
auto center = getLaneletBorder(llElem, RoleNameString::Centerline);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable llElem

Suggested change
if (findRole(llElem.members, RoleNameString::Centerline) != llElem.members.end()) {
auto center = getLaneletBorder(llElem, RoleNameString::Centerline);
if (findRole(ll_elem.members, RoleNameString::Centerline) != ll_elem.members.end()) {
auto center = getLaneletBorder(ll_elem, RoleNameString::Centerline);

Comment on lines +157 to +158
if (findRole(llElem.members, RoleNameString::RegulatoryElement) != llElem.members.end()) {
llWithRegulatoryElement.push_back(std::make_pair(lanelet, &llElem));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable llElem

Suggested change
if (findRole(llElem.members, RoleNameString::RegulatoryElement) != llElem.members.end()) {
llWithRegulatoryElement.push_back(std::make_pair(lanelet, &llElem));
if (findRole(ll_elem.members, RoleNameString::RegulatoryElement) != ll_elem.members.end()) {
llWithRegulatoryElement.push_back(std::make_pair(lanelet, &ll_elem));

AreasWithRegulatoryElements MultiFileLoader::loadAreas(const lanelet::osm::Relations & relations)
{
// regElems are not parsed yet. We store areas with one for later.
AreasWithRegulatoryElements arWithRegulatoryElement;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arWithRegulatoryElement

Suggested change
AreasWithRegulatoryElements arWithRegulatoryElement;
AreasWithRegulatoryElements ar_with_regulatory_element;

Comment on lines +187 to +190
arWithRegulatoryElement.push_back(std::make_pair(area, &arElem));
}
}
return arWithRegulatoryElement;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arWithRegulatoryElement

Suggested change
arWithRegulatoryElement.push_back(std::make_pair(area, &arElem));
}
}
return arWithRegulatoryElement;
ar_with_regulatory_element.push_back(std::make_pair(area, &arElem));
}
}
return ar_with_regulatory_element;

Comment on lines +168 to +169
for (const auto & relElem : relations) {
const auto & arElem = relElem.second;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable relElem

Suggested change
for (const auto & relElem : relations) {
const auto & arElem = relElem.second;
for (const auto & rel_elem : relations) {
const auto & arElem = rel_elem.second;

Comment on lines +169 to +170
const auto & arElem = relElem.second;
if (!isType<AttributeValueString::Multipolygon>(arElem)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arElem

Suggested change
const auto & arElem = relElem.second;
if (!isType<AttributeValueString::Multipolygon>(arElem)) {
const auto & ar_elem = relElem.second;
if (!isType<AttributeValueString::Multipolygon>(ar_elem)) {

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (9/15)

Comment on lines +173 to +174
const auto id = arElem.id;
const auto attributes = getAttributes(arElem.attributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arElem

Suggested change
const auto id = arElem.id;
const auto attributes = getAttributes(arElem.attributes);
const auto id = ar_elem.id;
const auto attributes = getAttributes(ar_elem.attributes);

const auto id = arElem.id;
const auto attributes = getAttributes(arElem.attributes);

auto outerRing = getOuterRing(arElem);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arElem

Suggested change
auto outerRing = getOuterRing(arElem);
auto outerRing = getOuterRing(ar_elem);

continue;
}

Area area(id, outerRing, getInnerRing(arElem), attributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arElem

Suggested change
Area area(id, outerRing, getInnerRing(arElem), attributes);
Area area(id, outerRing, getInnerRing(ar_elem), attributes);

Comment on lines +186 to +187
if (findRole(arElem.members, RoleNameString::RegulatoryElement) != arElem.members.end()) {
arWithRegulatoryElement.push_back(std::make_pair(area, &arElem));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable arElem

Suggested change
if (findRole(arElem.members, RoleNameString::RegulatoryElement) != arElem.members.end()) {
arWithRegulatoryElement.push_back(std::make_pair(area, &arElem));
if (findRole(ar_elem.members, RoleNameString::RegulatoryElement) != ar_elem.members.end()) {
arWithRegulatoryElement.push_back(std::make_pair(area, &ar_elem));

Comment on lines +176 to +177
auto outerRing = getOuterRing(arElem);
if (outerRing.empty()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable outerRing

Suggested change
auto outerRing = getOuterRing(arElem);
if (outerRing.empty()) {
auto outer_ring = getOuterRing(arElem);
if (outer_ring.empty()) {

continue;
}

Area area(id, outerRing, getInnerRing(arElem), attributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable outerRing

Suggested change
Area area(id, outerRing, getInnerRing(arElem), attributes);
Area area(id, outer_ring, getInnerRing(arElem), attributes);

Comment on lines +195 to +196
for (const auto & relElem : relations) {
const auto & regElem = relElem.second;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable relElem

Suggested change
for (const auto & relElem : relations) {
const auto & regElem = relElem.second;
for (const auto & rel_elem : relations) {
const auto & regElem = rel_elem.second;

Comment on lines +196 to +197
const auto & regElem = relElem.second;
if (!isType<AttributeValueString::RegulatoryElement>(regElem)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regElem

Suggested change
const auto & regElem = relElem.second;
if (!isType<AttributeValueString::RegulatoryElement>(regElem)) {
const auto & reg_elem = relElem.second;
if (!isType<AttributeValueString::RegulatoryElement>(reg_elem)) {

Comment on lines +200 to +201
const auto id = regElem.id;
const auto attributes = getAttributes(regElem.attributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regElem

Suggested change
const auto id = regElem.id;
const auto attributes = getAttributes(regElem.attributes);
const auto id = reg_elem.id;
const auto attributes = getAttributes(reg_elem.attributes);

parserError(id, "Regulatory element has no 'subtype' tag.");
continue;
}
auto rules = getRulesForRegulatoryElement(id, regElem.members);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regElem

Suggested change
auto rules = getRulesForRegulatoryElement(id, regElem.members);
auto rules = getRulesForRegulatoryElement(id, reg_elem.members);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (10/15)

continue;
}
auto rules = getRulesForRegulatoryElement(id, regElem.members);
auto regelemData = std::make_shared<RegulatoryElementData>(id, rules, attributes);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regelemData

Suggested change
auto regelemData = std::make_shared<RegulatoryElementData>(id, rules, attributes);
auto regelem_data = std::make_shared<RegulatoryElementData>(id, rules, attributes);

auto regelemData = std::make_shared<RegulatoryElementData>(id, rules, attributes);
auto regelemType = type->second.value();
try {
auto regElement = RegulatoryElementFactory::create(regelemType, regelemData);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regelemData

Suggested change
auto regElement = RegulatoryElementFactory::create(regelemType, regelemData);
auto regElement = RegulatoryElementFactory::create(regelemType, regelem_data);

}
auto rules = getRulesForRegulatoryElement(id, regElem.members);
auto regelemData = std::make_shared<RegulatoryElementData>(id, rules, attributes);
auto regelemType = type->second.value();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regelemType

Suggested change
auto regelemType = type->second.value();
auto regelem_type = type->second.value();

auto regelemData = std::make_shared<RegulatoryElementData>(id, rules, attributes);
auto regelemType = type->second.value();
try {
auto regElement = RegulatoryElementFactory::create(regelemType, regelemData);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regelemType

Suggested change
auto regElement = RegulatoryElementFactory::create(regelemType, regelemData);
auto regElement = RegulatoryElementFactory::create(regelem_type, regelemData);

regulatoryElements_.emplace(id, regElement);
} catch (std::exception & e) {
parserError(
id, "Creating a regulatory element of type "s + regelemType + " failed: " + e.what());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regelemType

Suggested change
id, "Creating a regulatory element of type "s + regelemType + " failed: " + e.what());
id, "Creating a regulatory element of type "s + regelem_type + " failed: " + e.what());

Comment on lines +211 to +212
auto regElement = RegulatoryElementFactory::create(regelemType, regelemData);
regulatoryElements_.emplace(id, regElement);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regElement

Suggested change
auto regElement = RegulatoryElementFactory::create(regelemType, regelemData);
regulatoryElements_.emplace(id, regElement);
auto reg_element = RegulatoryElementFactory::create(regelemType, regelemData);
regulatoryElements_.emplace(id, reg_element);

void MultiFileLoader::addRegulatoryElements(
std::vector<std::pair<PrimT, const osm::Relation *>> & addTos)
{
for (auto & addTo : addTos) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable addTo

Suggested change
for (auto & addTo : addTos) {
for (auto & add_to : addTos) {

Comment on lines +226 to +228
addTo.second->members, RoleNameString::RegulatoryElement, [&](const osm::Role & role) {
auto regElem = getOrGetDummy(regulatoryElements_, role.second->id, addTo.first.id());
addTo.first.addRegulatoryElement(regElem);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable addTo

Suggested change
addTo.second->members, RoleNameString::RegulatoryElement, [&](const osm::Role & role) {
auto regElem = getOrGetDummy(regulatoryElements_, role.second->id, addTo.first.id());
addTo.first.addRegulatoryElement(regElem);
add_to.second->members, RoleNameString::RegulatoryElement, [add_to](const osm::Role & role) {
auto regElem = getOrGetDummy(regulatoryElements_, role.second->id, add_to.first.id());
add_to.first.addRegulatoryElement(regElem);

Comment on lines +227 to +228
auto regElem = getOrGetDummy(regulatoryElements_, role.second->id, addTo.first.id());
addTo.first.addRegulatoryElement(regElem);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable regElem

Suggested change
auto regElem = getOrGetDummy(regulatoryElements_, role.second->id, addTo.first.id());
addTo.first.addRegulatoryElement(regElem);
auto reg_elem = getOrGetDummy(regulatoryElements_, role.second->id, addTo.first.id());
addTo.first.addRegulatoryElement(reg_elem);

Comment on lines +243 to +244
for (const auto & osmAttr : osmAttributes) {
attributes.insert(std::make_pair(osmAttr.first, lanelet::Attribute(osmAttr.second)));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmAttr

Suggested change
for (const auto & osmAttr : osmAttributes) {
attributes.insert(std::make_pair(osmAttr.first, lanelet::Attribute(osmAttr.second)));
for (const auto & osm_attr : osmAttributes) {
attributes.insert(std::make_pair(osm_attr.first, lanelet::Attribute(osm_attr.second)));

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (11/15)

Comment on lines +252 to +254
size_t numMembers = 0;
osm::forEachMember(llElem.members, role, [&](auto & /*role*/) { ++numMembers; });
if (numMembers != 1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable numMembers

Suggested change
size_t numMembers = 0;
osm::forEachMember(llElem.members, role, [&](auto & /*role*/) { ++numMembers; });
if (numMembers != 1) {
size_t num_members = 0;
osm::forEachMember(llElem.members, role, [num_members](auto & /*role*/) { ++num_members; });
if (num_members != 1) {

osm::forEachMember(llElem.members, role, [&](auto & /*role*/) { ++numMembers; });
if (numMembers != 1) {
parserError(llElem.id, "Lanelet has not exactly one "s + role + " border!");
return LineString3d(llElem.id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-return-braced-init-list ⚠️
avoid repeating the return type from the declaration; use a braced initializer list instead

auto member = osm::findRole(llElem.members, role);
if (member->second->type() != AttributeValueString::Way) {
parserError(llElem.id, "Lanelet "s + role + " border is not of type way!");
return LineString3d(llElem.id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-return-braced-init-list ⚠️
avoid repeating the return type from the declaration; use a braced initializer list instead

Comment on lines +291 to +292
auto outerLs = getLinestrings(area.members, RoleNameString::Outer, area.id);
if (outerLs.empty()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable outerLs

Suggested change
auto outerLs = getLinestrings(area.members, RoleNameString::Outer, area.id);
if (outerLs.empty()) {
auto outer_ls = getLinestrings(area.members, RoleNameString::Outer, area.id);
if (outer_ls.empty()) {

parserError(area.id, "Areas must have at least one outer border!");
return {};
}
auto outerRings = assembleBoundary(outerLs, area.id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable outerLs

Suggested change
auto outerRings = assembleBoundary(outerLs, area.id);
auto outerRings = assembleBoundary(outer_ls, area.id);

Comment on lines +296 to +297
auto outerRings = assembleBoundary(outerLs, area.id);
if (outerRings.size() != 1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable outerRings

Suggested change
auto outerRings = assembleBoundary(outerLs, area.id);
if (outerRings.size() != 1) {
auto outer_rings = assembleBoundary(outerLs, area.id);
if (outer_rings.size() != 1) {

parserError(area.id, "Areas must have exactly one outer ring!");
return {};
}
return outerRings.front();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable outerRings

Suggested change
return outerRings.front();
return outer_rings.front();

Comment on lines +306 to +307
auto innerLs = getLinestrings(area.members, RoleNameString::Inner, area.id);
return assembleBoundary(innerLs, area.id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable innerLs

Suggested change
auto innerLs = getLinestrings(area.members, RoleNameString::Inner, area.id);
return assembleBoundary(innerLs, area.id);
auto inner_ls = getLinestrings(area.members, RoleNameString::Inner, area.id);
return assembleBoundary(inner_ls, area.id);

Comment on lines +314 to +315
for (const auto & memberPair : roles) {
const auto & member = memberPair.second;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable memberPair

Suggested change
for (const auto & memberPair : roles) {
const auto & member = memberPair.second;
for (const auto & member_pair : roles) {
const auto & member = member_pair.second;

const auto & member = memberPair.second;
if (member->type() == AttributeValueString::Node) {
auto newMember = getOrGetDummy(points_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable memberPair

Suggested change
rules[memberPair.first].emplace_back(newMember);
rules[member_pair.first].emplace_back(newMember);

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (12/15)

// can either be linestring or polygon
if (polygons_.find(member->id) != polygons_.end()) {
auto newMember = getOrGetDummy(polygons_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable memberPair

Suggested change
rules[memberPair.first].emplace_back(newMember);
rules[member_pair.first].emplace_back(newMember);

rules[memberPair.first].emplace_back(newMember);
} else {
auto newMember = getOrGetDummy(lineStrings_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable memberPair

Suggested change
rules[memberPair.first].emplace_back(newMember);
rules[member_pair.first].emplace_back(newMember);

" without a type tag!");
} else if (type->second == AttributeValueString::Lanelet) {
auto newMember = getOrGetDummy(lanelets_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable memberPair

Suggested change
rules[memberPair.first].emplace_back(newMember);
rules[member_pair.first].emplace_back(newMember);

rules[memberPair.first].emplace_back(newMember);
} else if (type->second == AttributeValueString::Multipolygon) {
auto newMember = getOrGetDummy(areas_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable memberPair

Suggested change
rules[memberPair.first].emplace_back(newMember);
rules[member_pair.first].emplace_back(newMember);

Comment on lines +317 to +318
auto newMember = getOrGetDummy(points_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newMember

Suggested change
auto newMember = getOrGetDummy(points_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
auto new_member = getOrGetDummy(points_, member->id, currElemId);
rules[memberPair.first].emplace_back(new_member);

Comment on lines +322 to +323
auto newMember = getOrGetDummy(polygons_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newMember

Suggested change
auto newMember = getOrGetDummy(polygons_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
auto new_member = getOrGetDummy(polygons_, member->id, currElemId);
rules[memberPair.first].emplace_back(new_member);

Comment on lines +325 to +326
auto newMember = getOrGetDummy(lineStrings_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newMember

Suggested change
auto newMember = getOrGetDummy(lineStrings_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
auto new_member = getOrGetDummy(lineStrings_, member->id, currElemId);
rules[memberPair.first].emplace_back(new_member);

Comment on lines +336 to +337
auto newMember = getOrGetDummy(lanelets_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newMember

Suggested change
auto newMember = getOrGetDummy(lanelets_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
auto new_member = getOrGetDummy(lanelets_, member->id, currElemId);
rules[memberPair.first].emplace_back(new_member);

Comment on lines +339 to +340
auto newMember = getOrGetDummy(areas_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newMember

Suggested change
auto newMember = getOrGetDummy(areas_, member->id, currElemId);
rules[memberPair.first].emplace_back(newMember);
auto new_member = getOrGetDummy(areas_, member->id, currElemId);
rules[memberPair.first].emplace_back(new_member);

Comment on lines +363 to +365
auto & currRing = rings.back();
if (currRing.empty()) {
currRing.push_back(lineStrings.back());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable currRing

Suggested change
auto & currRing = rings.back();
if (currRing.empty()) {
currRing.push_back(lineStrings.back());
auto & curr_ring = rings.back();
if (curr_ring.empty()) {
curr_ring.push_back(lineStrings.back());

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (13/15)

currRing.push_back(lineStrings.back());
lineStrings.pop_back();
} else {
const auto lastId = currRing.back().back().id();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable currRing

Suggested change
const auto lastId = currRing.back().back().id();
const auto lastId = curr_ring.back().back().id();

if (elem == lineStrings.rend()) {
parserError(
id,
"Could not complete boundary around linestring " + std::to_string(currRing.back().id()));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable currRing

Suggested change
"Could not complete boundary around linestring " + std::to_string(currRing.back().id()));
"Could not complete boundary around linestring " + std::to_string(curr_ring.back().id()));

if (newLineString.back().id() == lastId) {
newLineString = newLineString.invert();
}
currRing.push_back(newLineString);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable currRing

Suggested change
currRing.push_back(newLineString);
curr_ring.push_back(newLineString);

}

// check if we closed the ring
if (currRing.back().back().id() == currRing.front().front().id()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable currRing

Suggested change
if (currRing.back().back().id() == currRing.front().front().id()) {
if (curr_ring.back().back().id() == curr_ring.front().front().id()) {

Comment on lines +393 to +395
if (!isValid(currRing)) {
reverse(currRing);
if (!isValid(currRing)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable currRing

Suggested change
if (!isValid(currRing)) {
reverse(currRing);
if (!isValid(currRing)) {
if (!isValid(curr_ring)) {
reverse(curr_ring);
if (!isValid(curr_ring)) {

currRing.push_back(lineStrings.back());
lineStrings.pop_back();
} else {
const auto lastId = currRing.back().back().id();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable lastId

Suggested change
const auto lastId = currRing.back().back().id();
const auto last_id = currRing.back().back().id();

Comment on lines +370 to +371
std::find_if(lineStrings.rbegin(), lineStrings.rend(), [lastId](const auto & elem) {
return elem.back().id() == lastId || elem.front().id() == lastId;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable lastId

Suggested change
std::find_if(lineStrings.rbegin(), lineStrings.rend(), [lastId](const auto & elem) {
return elem.back().id() == lastId || elem.front().id() == lastId;
std::find_if(lineStrings.rbegin(), lineStrings.rend(), [last_id](const auto & elem) {
return elem.back().id() == last_id || elem.front().id() == last_id;

// we found the matching next linestring. add it in the correct order
auto newLineString = *elem;
lineStrings.erase(std::next(elem).base());
if (newLineString.back().id() == lastId) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable lastId

Suggested change
if (newLineString.back().id() == lastId) {
if (newLineString.back().id() == last_id) {

continue;
}
// we found the matching next linestring. add it in the correct order
auto newLineString = *elem;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newLineString

Suggested change
auto newLineString = *elem;
auto new_line_string = *elem;

Comment on lines +384 to +385
if (newLineString.back().id() == lastId) {
newLineString = newLineString.invert();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newLineString

Suggested change
if (newLineString.back().id() == lastId) {
newLineString = newLineString.invert();
if (new_line_string.back().id() == lastId) {
new_line_string = new_line_string.invert();

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (14/15)

if (newLineString.back().id() == lastId) {
newLineString = newLineString.invert();
}
currRing.push_back(newLineString);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable newLineString

Suggested change
currRing.push_back(newLineString);
currRing.push_back(new_line_string);

}

template <typename MapT>
void registerIds(const MapT & map)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function registerIds

Suggested change
void registerIds(const MapT & map)
void register_ids(const MapT & map)

Comment on lines +473 to +475
registerIds(file.second.nodes);
registerIds(file.second.ways);
registerIds(file.second.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function registerIds

Suggested change
registerIds(file.second.nodes);
registerIds(file.second.ways);
registerIds(file.second.relations);
register_ids(file.second.nodes);
register_ids(file.second.ways);
register_ids(file.second.relations);

Comment on lines +496 to +506
registerIds(file.nodes);
registerIds(file.ways);
registerIds(file.relations);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function registerIds

Suggested change
registerIds(file.nodes);
registerIds(file.ways);
registerIds(file.relations);
register_ids(file.nodes);
register_ids(file.ways);
register_ids(file.relations);

}
}

void testAndPrintLocaleWarning(ErrorMessages & errors)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function testAndPrintLocaleWarning

Suggested change
void testAndPrintLocaleWarning(ErrorMessages & errors)
void test_and_print_locale_warning(ErrorMessages & errors)

throw lanelet::ParseError(
"Errors occured while parsing osm file: "s + result.description());
}
testAndPrintLocaleWarning(osmReadErrors);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function testAndPrintLocaleWarning

Suggested change
testAndPrintLocaleWarning(osmReadErrors);
test_and_print_locale_warning(osmReadErrors);

throw lanelet::ParseError("Errors occured while parsing osm file: "s + result.description());
}
osm::Errors osmReadErrors;
testAndPrintLocaleWarning(osmReadErrors);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for function testAndPrintLocaleWarning

Suggested change
testAndPrintLocaleWarning(osmReadErrors);
test_and_print_locale_warning(osmReadErrors);

Comment on lines +437 to +438
auto * decimalPoint = std::localeconv()->decimal_point;
if (decimalPoint == nullptr || *decimalPoint != '.') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable decimalPoint

Suggested change
auto * decimalPoint = std::localeconv()->decimal_point;
if (decimalPoint == nullptr || *decimalPoint != '.') {
auto * decimal_point = std::localeconv()->decimal_point;
if (decimal_point == nullptr || *decimal_point != '.') {

if (decimalPoint == nullptr || *decimalPoint != '.') {
std::stringstream ss;
ss << "Warning: Current decimal point of the C locale is set to \""
<< (decimalPoint == nullptr ? ' ' : *decimalPoint)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable decimalPoint

Suggested change
<< (decimalPoint == nullptr ? ' ' : *decimalPoint)
<< (decimal_point == nullptr ? ' ' : *decimal_point)

{
std::map<std::string, osm::File> files;

osm::Errors osmReadErrors;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
osm::Errors osmReadErrors;
osm::Errors osm_read_errors;

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (15/15)


std::for_each(
lanelet2_filenames.begin(), lanelet2_filenames.end(),
[&files, &osmReadErrors](const auto & file_name) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
[&files, &osmReadErrors](const auto & file_name) {
[&files, &osm_read_errors](const auto & file_name) {

throw lanelet::ParseError(
"Errors occured while parsing osm file: "s + result.description());
}
testAndPrintLocaleWarning(osmReadErrors);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
testAndPrintLocaleWarning(osmReadErrors);
testAndPrintLocaleWarning(osm_read_errors);

}
testAndPrintLocaleWarning(osmReadErrors);

files[file_name] = lanelet::osm::read(doc, &osmReadErrors);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
files[file_name] = lanelet::osm::read(doc, &osmReadErrors);
files[file_name] = lanelet::osm::read(doc, &osm_read_errors);

}

errors = buildErrorMessage(
"Errors ocurred while parsing Lanelet Map:", utils::concatenate({osmReadErrors, errors}));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
"Errors ocurred while parsing Lanelet Map:", utils::concatenate({osmReadErrors, errors}));
"Errors ocurred while parsing Lanelet Map:", utils::concatenate({osm_read_errors, errors}));

Comment on lines +491 to +501
osm::Errors osmReadErrors;
testAndPrintLocaleWarning(osmReadErrors);
auto file = lanelet::osm::read(doc, &osmReadErrors);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
osm::Errors osmReadErrors;
testAndPrintLocaleWarning(osmReadErrors);
auto file = lanelet::osm::read(doc, &osmReadErrors);
osm::Errors osm_read_errors;
testAndPrintLocaleWarning(osm_read_errors);
auto file = lanelet::osm::read(doc, &osm_read_errors);

registerIds(file.ways);
registerIds(file.relations);
errors = buildErrorMessage(
"Errors ocurred while parsing Lanelet Map:", utils::concatenate({osmReadErrors, errors}));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmReadErrors

Suggested change
"Errors ocurred while parsing Lanelet Map:", utils::concatenate({osmReadErrors, errors}));
"Errors ocurred while parsing Lanelet Map:", utils::concatenate({osm_read_errors, errors}));

Comment on lines +531 to +540
auto osmNode = doc.child("osm");
auto metainfo = osmNode.child("MetaInfo");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ readability-identifier-naming ⚠️
invalid case style for variable osmNode

Suggested change
auto osmNode = doc.child("osm");
auto metainfo = osmNode.child("MetaInfo");
auto osm_node = doc.child("osm");
auto metainfo = osm_node.child("MetaInfo");

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 319 lines in your changes are missing coverage. Please review.

Project coverage is 9.50%. Comparing base (ede5f15) to head (9944319).
Report is 1 commits behind head on main.

Files Patch % Lines
...nelet2_extension/lib/autoware_multi_osm_parser.cpp 0.00% 279 Missing ⚠️
...anelet2_extension/io/autoware_multi_osm_parser.hpp 0.00% 31 Missing ⚠️
tmp/lanelet2_extension/lib/message_conversion.cpp 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #234      +/-   ##
=========================================
- Coverage   10.46%   9.50%   -0.97%     
=========================================
  Files          42      44       +2     
  Lines        3154    3473     +319     
  Branches     1409    1600     +191     
=========================================
  Hits          330     330              
- Misses       2397    2716     +319     
  Partials      427     427              
Flag Coverage Δ *Carryforward flag
differential 7.33% <0.00%> (?)
total 10.46% <ø> (ø) Carriedforward from ede5f15

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

#include <utility>
#include <vector>

using std::string_literals::operator""s;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ google-global-names-in-headers ⚠️
using declarations in the global namespace in headers are prohibited

#include <utility>
#include <vector>

using std::string_literals::operator""s;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ misc-unused-using-decls ⚠️
using decl operator""s is unused

Copy link
Contributor

@esteve esteve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StepTurtle is the code in the tmp folder meant to be included in this PR? There also seems to be changes unrelated to this PR that are copied from #238, is that intended?

Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
@xmfcx xmfcx force-pushed the feat/add_multi_osm_parser branch from ca1ed11 to 9944319 Compare March 27, 2024 14:40
@StepTurtle
Copy link
Author

@StepTurtle is the code in the tmp folder meant to be included in this PR? There also seems to be changes unrelated to this PR that are copied from #238, is that intended?

Hi @esteve
When you said this, I realized I had added some wrong parts to the PR. Now we fixed everything and it looks correct. I also apologize for any inconvenience I may have caused. Thank you for your warning

Copy link

stale bot commented May 26, 2024

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:stale Inactive or outdated issues. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants