-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: replace Airmap terrain data with Copernicus #10740
feat: replace Airmap terrain data with Copernicus #10740
Conversation
// Calc the elevation as the average across the four known points | ||
double known00 = _data[latIndex][lonIndex]; | ||
double known01 = _data[latIndex][lonIndex+1]; | ||
double known10 = _data[latIndex+1][lonIndex]; | ||
double known11 = _data[latIndex+1][lonIndex+1]; | ||
double lonValue1 = known00 + ((known01 - known00) * lonFraction); | ||
double lonValue2 = known10 + ((known11 - known10) * lonFraction); | ||
double latValue = lonValue1 + ((lonValue2 - lonValue1) * latFraction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped the bi-linear interpolation since it doesn't necessarily yield better results than NN. More advanced interpolation algorithms based on statistical methods, e.g. Kriging or Natural Neighbor, would be ideal.
Sources:
Thanks @leonardosimovic I took a quick look, and regarding the implementation I would only change all the references to Airmap to whatever we want to call this provider. Not 100% sure right now, but doing this also we can probably avoid bumping cache version right? Regarding the bi-linear approximation or not, what is the gridSize of your tiles right now? The graphs on your comparisons look great, so probably we are good, but I think it would be good to specify somewhere the gridSize of your tiles so we can understand the error we are assuming not doing interpolation, or doing it. I tested real quick your branch and it works great for me, but I am getting some errors when I create a polygon and then I move it. When creating a survey polygon everything is smooth, I only get the errors when click and drag vertices: TerrainQueryLog: TerrainTileManager::getAltitudesForCoordinates Internal Error: missing elevation in tile cache I don't think I will be able to spend much more time this week on this matter, so if you could investigate the above it would be great. Thank you very much! |
Hey @Davidsastresas Thank you for the feedback!
I would also prefer not upgrading the cache. However, it is necessary because the new data has a different format and therefore is not compatible. Previously, with Airmap, it was assumed that each carpet query would return a fixed array size
It has the same resolution as
I will have a look! |
Great to hear you can also reproduce those warnings! Regarding Cache, I am not 100% sure of this, but isn't the cache system based on the hash for each tile, and isn't this hash dependant on the name? So, changing the name of the provider, shouldn't the tiles have a different hash and thus not having need to bump cache version? I am not 100% sure though. Thanks! |
Hey @Davidsastresas I looked into the warnings some more and traced it back to rounding errors in the
This sounds right, but I'm not 100% sure either. When I tested it the cache needed to be bumped otherwise still the perviously cached tiles were loaded 🤔 Edit |
6da7f0e
to
e42ebd5
Compare
I pushed a couple of commits, addressing the Airmap hard-coding + some unrelated performance improvements. I tried to keep the changes to a minimum in order to reduce conflicts with your PR. Let me know what you think! Also, I will let you know as soon as we have deployed our updated service. |
Thank you, sounds great! I won't have time to take a look at it until next week I think. Thanks! |
Thanks so, so much for this work. I took a quick look through and it looks fine. But at this point @Davidsastresas knows way more about this than I do since he was recently in this code. My one complaint is in the license string being part of the terrain status display. That takes up really (really) critical vertical real estate on small screens, like small tablets or say a Herelink. Can that go someplace else? Couple options: |
Hey @DonLakeFlyer! No problem, we're happy to help :)
That's a valid point! My only concern is with the visibility of the copyright notice if we place it in the menus. Let me check with the team and I'll come back to you. |
Is there some legal thing with respect to where it needs to be? |
The other options is show it in terrain status for say a few seconds and then hide it. |
Hi!, I think I will be able to check this tomorrow. Thanks for the work! About the label, I agree with Don, it is really not good there, in devices like Herelink screen real state is precious. The idea about showing it for a few seconds I think is a good compromise. Something like 5 seconds will really be noticed. On the draft PR we were making for supporting several elevation providers we will have a dedicated option in general settings for it. It could be another nice place, in a way that the copyright only shows if we select this provider. Also, It would be good to somehow link that license to the elevationmap provider, instead of being in QGCUrlmapengine as a global variable. Just thinking on the near future when we support more elevation providers. We can manage that later as well, I don't think that should hold back the PR. Thanks! |
I just spared some time to check this out. It looks good, but that error when creating a polygon and moving it around is still there: addPathQuery: signalling failure due to internal error Some notes:
and then it could be accessed like this:
In any case, I understand you probably don't have a lot of time left to spend into this, and we are very grateful that you managed to spend the time in the first place. So maybe we can push this to a separate branch, not master, and rework it from there, if you can not put the time to fix the above. But it would be good to sort out that error before considering this. Of course this is only my opinion, and if the rest of developers disagree and we decide to take a different approach I am totally happy with it too. Thanks! |
Hey @leonardosimovic thanks for your work we are excited to have this feature in. Is there a way we can get this finalized soon we would like to promote a stable release to deprecate Airmap and bring in a few other fixes |
Hey everyone, sorry for the delay!
I'm not sure about hiding the label after x seconds from a UX point of view. I don't think the label is super noticeable as it is now, but it's disappearing will cause the plot to resize / elements to shift, this will be noticed for sure by which time the label is already gone. Other suggestion would be to move outside and on top of the plot. This won't increase terrain plot background size while the label remains visible.
This would be a very nice solution!
Yeah we haven't yet deployed the fix to the terrain-service. I will let you know as soon as it's in.
That's definitely the way to go and you already implemented in your draft I believe. Hence I went with the bare minimum so it's a) less cumbersome to rebase for you and b) we can safe time by avoid duplicate work. |
I like that much better. If it's just text you can still see the map behind it and make sure it in the zorder below the plan items on the map. |
e42ebd5
to
fcc8873
Compare
Hey everyone, I cleaned up the commit history and moved the label ontop of the terrain plot: It's not the prettiest solution but I hope it's acceptable for the time being, until there's a dedicated terrain settings section which @Davidsastresas proposed. |
I think it's good enough for now. @Davidsastresas Want to give one final look see an then you can merge. |
fcc8873
to
534e33f
Compare
@DonLakeFlyer as said on my previous comment, if the rest of you are fine with this I am fine myself too, so I am happy with this getting merged as well! Thanks! |
Awesome, thank you all for the reviews! @Davidsastresas we have redeployed our terrain service, so you shouldn't see the error any more after clearing the map cache 😄 |
The Problem
The Airmap terrain servers (and possibly other Airmap services) are shutting down. The docs https://developers.airmap.com/docs/elevation-api are already down while the servers seem still to be running for the time being.
The Solution
This PR replaces the
Airmap
query with an alternative provider, hosting the Copernicus GLO-30 which was compiled and provided by© Airbus Defence and Space GmbH
dataset. The Copernicus dataset has generally better global coverage and accuracy than the previous SRTM dataset.Followup or Incremental Work
Airmap
references in the code.© Airbus Defence and Space GmbH
also in the UI.Elevation Provider Credit
Added a small note in the bottom center of terrain plot:
Comparison
Latitude zone I: 0-50 degrees north and south
Latitude zone II: 50-70 degrees north and south:
Latitude zone III: 70-75 degrees north and south:
Latitude zone IV: 75-80 degrees north and south:
Latitude zone V: 80-90 degrees north and south:
Raw Images and Mission Plans
qgc-airmap-replacement.zip