Function lanelet::write(const std::string&, const lanelet::LaneletMap&, const std::string&, const Origin&, ErrorMessages *, const io::Configuration&)

Function Documentation

void lanelet::write(const std::string &filename, const lanelet::LaneletMap &map, const std::string &writerName, const Origin &origin = Origin::defaultOrigin(), ErrorMessages *errors = nullptr, const io::Configuration &params = io::Configuration())

writes a map to a file

Parameters:
  • filename – file to write to (parent folders must exist!). The extension is used to deduce the format.

  • map – map to be written

  • writerName – name of the writer format to use. Available writers can be queried with supportedWriters().

  • errors – if this points to a valid object, errors occured during write will be passed via this parameter. If this is nullptr, an exception will be thrown if errors have occurred.

  • origin – origin definition for x,y -> lat/lon conversion

  • params – extra parameters for the writer (if required). If empty, default parameters will be used.

Throws:

lanelet2::IOError – if the file could not be created or writing failed.