-
Notifications
You must be signed in to change notification settings - Fork 321
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
How to load an .osm file with the Geocentric projection to get the data in ECEF #324
Comments
@mantkiew you seem to have provided the Geocentric code, do you have a good idea? |
Or to make the code more consistent: For ECEF we do know the origin: It's the center of the earth. So how about for |
Hi, the tutorial shows using I think it's the same with There's the old API, where you can give just an origin and it creates some bad default projector, but that should not be used. Always create the projector you want and use that consistently. |
Hi @mantkiew , thanks for the reply. I tried that but failed, see below. I think just passing a projector does make sense -- and the projectors which need an origin actually 'carry their own' origin with them (they get constructed from it). The For full reproducibility, here my console log:
So looking at the code I think |
This is the culprit ( Lanelet2/lanelet2_io/include/lanelet2_io/io_handlers/IoHandler.h Lines 34 to 39 in 33e797a
The GeocentricProjector does not use origin at all, because it's hardcoded in the underlying LibGeographic C++ library, and so it only has the default one defined in the class Projector:
So, to fix this: the GeocentricProjector should overwrite the origin with whatever value that is different from the default projector. |
@poggenhans @immel-f this PR fixes this error. It also adds usage demonstration to |
… GeocentricProjector (fzi-forschungszentrum-informatik#325) (cherry picked from commit a41d75b)
I would like to load a .osm file (e.g. the provided example
mapping_example.osm
) and use the data in ECEF.I would have expected to be able to do something like
which sadly fails with
By looking at the code I do not really understand this error and how to circumvent it.
The
GeocentricPorjector
does not accept an origin when creating an instance -- and why should it do so; ECEF should be 'globally accurate', not depending on any origin.During loading, the projector is checked whether it still has the 'default origin' set -- which is true (because we cannot change the origin) and the function fails with above error.
Please advise how to properly load the .osm file to get the data in ECEF.
The text was updated successfully, but these errors were encountered: