Function lanelet::write(const std::string&, const lanelet::LaneletMap&, const Origin&, ErrorMessages *, const io::Configuration&)
Defined in File Io.h
Function Documentation
-
void lanelet::write(const std::string &filename, const lanelet::LaneletMap &map, const Origin &origin = Origin::defaultOrigin(), ErrorMessages *errors = nullptr, const io::Configuration ¶ms = io::Configuration())
writes a map to a file
It can not be stressed enough that it is important to provide a valid origin to write/load maps with georeferenced (lat/lon) data. If no origin is specified, the written map will most likely be not correctly located and deformed.
- Parameters:
filename – file to write to (parent folders must exist!)
map – map to be written
origin – origin for x,y -> lat/lon conversion. You will receive a warning if you try to write to a format that requires lat/lon conversion and passed the defaultOrigin.
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.
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. If errors is not null, the writer will instead try to recover and only throw on unrecoverable errors (ie if the file could not be created). However, the written map will be incomplete if errors occurred.