Faulty coordinate axes shift in L2 to CR conversion using a projection string

We want to convert a Lanelet2 (L2) file into the CommonRoad (CR) format while centering the coordinate axes around a specific point using a projection string. I used the following command within the CRDesigner CLI:

crdesigner map-convert-lanelet -f -i <OSM_FILE> -o <CR_FILE> --proj "+proj=tmerc +lat_0=<LATITUDE> +lon_0=<LONGITUDE> +x_0=<X_SHIFT> +y_0=<Y_SHIFT> +k=1 +datum=WGS84 +units=m +vunits=m +no_defs"

Unfortunately, the coordinate axes does not seem to have changed after the conversion. I receive the following output when using the abovementioned command:

<workspace>/.venv/lib/python3.10/site-packages/crdesigner/map_conversion/sumo_map/cr2sumo/converter.py:34: UserWarning: Unable to import commonroad_dc.pycrccosy, converting static scenario into interactive is not supported!
  warnings.warn(
17-Aug-23 09:51:30 - INFO - Lanelet2CRConverter OSM bounds - lower-left: <LAT>/<LON> - upper right <LAT>/<LON>
17-Aug-23 09:51:30 - INFO - Lanelet2CRConverter::_way_rel_to_lanelet: Trying to fix relation -103733...
17-Aug-23 09:51:30 - INFO - Lanelet2CRConverter::_way_rel_to_lanelet: Trying to fix relation -103736...
17-Aug-23 09:51:30 - INFO - Lanelet2CRConverter::_way_rel_to_lanelet: Trying to fix relation 
Replace file <CR_FILE>

Subsequently, I tried to load the CR file in the CRDesigner GUI, which throws a CommonRoad XML Error at first, but the map looks fine so far (apart from the huge, unchanged X and Y coordinate values):

image

I tried to “verify” the shift with proj, which delivers a (0.00 0.00) coordinate tuple:

echo 49.0 8.0 | proj +proj=tmerc +lat_0=<LATITUDE> +lon_0=<LONGITUDE> +X_0=<X_SHIFT> +Y_0=<Y_SHIFT> +k=1 +datum=WGS84 +units=m +vunits=m +no_defs

Is it possible that it’s related to the self._config.translate parameter within the Lanelet2CRConverter during conversion?

Many thanks in advance!

UPDATE: While debugging, I encountered a part where the given Lanelet2 configuration is ignored (and thrown away) as seen in the command_line.py.

UPDATE v2: The configuration is indeed missing. It seems to convert smoothly into CR format, but with two modifications:

  • To make use of the command_line.py, you need to add the main statement
    if __name__ == '__main__':
        main()
    
  • You only need to specify the origin coordinates, if desired. The shift towards X and Y axes is unnecessary

Thank you for letting us know.
We will fix the bug in on of our next releases.

1 Like