Repository navigation
Refactor elevation provider - #2381
Conversation
easbar
left a comment
There was a problem hiding this comment.
Thanks for this PR. See my comments inline.
The AbstractElevationProvider was alreading containing filesystem related code so I moved the methods there.
Can we rename it to F(T?)ileBasedElevationProvider then?
Please also add a line to CHANGELOG.md and add yourself to CONTRIBUTORS.md.
|
I'd vote for TileBasedElevationProvider |
a874627 to
f6c44b4
Compare
|
IMHO it's either a MultiSourceTileBasedProvider and therefore extends the TileBasedProvider interface or it's generic and we need to loop over it's providers and check+configure them. |
|
I'd prefer a generic MultiSourceElevationProvider and configure each of its wrapped providers. |
@otbutz, do you mean I should:
If yes, how do I handle the public MultiSourceElevationProvider setBaseURL(String baseURL) {
String[] urls = baseURL.split(";");
if (urls.length != 2) {
throw new IllegalArgumentException("The base url must consist of two urls separated by a ';'. The first for cgiar, the second for gmted");
}
srtmProvider.setBaseURL(urls[0]);
globalProvider.setBaseURL(urls[1]);
return this;
} |
|
@otbutz, I am willing to address the concern you expressed. Could you please give me some inputs so that I can move forward? |
|
Scratch that. Had a look at the current implementation and the MultiSourceElevationProvider only ties together a CIGAR and a GMTED provider. So this is far from a generic solution. I'd go with So we'd end up with the following interfaces/classes:
|
f6c44b4 to
15c6c87
Compare
15c6c87 to
98c5cb0
Compare
otbutz
left a comment
There was a problem hiding this comment.
Apart from the config.yml_old the PR is looking fine :)
- move them to the TileBasedElevationProvider; - expose builder methods consistently and specialize the returned type; - assume MultiSourceElevationProvider works with file/tile providers.
98c5cb0 to
93c9ebb
Compare
93c9ebb to
ef28716
Compare
|
Hi @easbar, you requested changes to the PR. I think I addressed all your demands. If the code looks good to you now would you be willing to merge the PR? |
Thanks for your changes. Yes, this PR looks good to me. There are a few minor things that we should fix (like missing overrides, duplicate javadocs in multi source provider and some whitespace/formatting), but I'll do this in a follow-up commit.
Yes, the name is a bit misleading indeed, I'll check if this can be improved, but this is unrelated to this PR. |
|
Thanks @easbar. I saw your follow up PR. Will also manage this part next time. |
Refactor elevation provider:
Fixes: #2374.
Ping @otbutz, @easbar.
I did not introduce constructor parameters as it was a bit tricky with multiple constructors like in MultiplSourceElevationProvider.
The
AbstractElevationProviderwas alreading containing filesystem related code so I moved the methods there.I have not renamed
getInterpolatetocanInterpolateyet. I will work on it later.Please let me know your feedback of this PR.