fzi-forschungszentrum-informatik / Lanelet2

Map handling framework for automated driving
BSD 3-Clause "New" or "Revised" License
800 stars 327 forks source link

origin in the .OSM file #153

Closed amastrobera closed 3 years ago

amastrobera commented 4 years ago

Dear Lanelet2,

I produce OSM files.

The OSM files contain data in lat/lon format. When using Lanelet2 library I have to create an Origin object and use a Projector to load that file. That assumes I know the lat/lon of the origin, which normally is not in the OSM file.

I could add one an element in the OSM xml, at the top, like this. Will you be able to change lanelet2 in order to make it read the origin? Do you find this useful for uses ?

<osm>
  // lanelet2 won't read it
  <metadata>
     <origin>
        <lat>51.04</lat>
        <lon>0.13</lon>
        <alt>35</alt>
  </metadata>

  // lanelet2 reads only this below
  <node> ... </node>
  <way> ... </way>
  <relation> ... </relation>
</osm>
joeda commented 4 years ago

It's not metadata of the map, since the map won't change depending on the origin. Rather, it's metadata of a process using the map, which will vary wildly on the intended usage and that the map is independent of. For this reason, I don't find this information as part of a map useful. Also, the actual coordinates of the projector will not change the projected data except for an offset that is the same for all map elements and the possibility of inaccuracy at very large offsets.

I suggest storing the origin somewhere else or determining it dynamically depending on the use case (for example using the point at which information in the map is relevant).