Repository navigation
Use SRTM 1 arc second elevation data - #1235
Conversation
| * <p> | ||
| * TODO: In addition, NSF requires oral acknowledgment during all news media interviews. | ||
| * TODO: This is weird, we have to check if really want to use OpenTopography then, see: http://www.opentopography.org/citations | ||
| * <p> |
There was a problem hiding this comment.
I find this very weird. Maybe we find a different source for the SRTM data.
In addition, NSF requires oral acknowledgment during all news media interviews
These seems a bit much for just providing a download server :).
There was a problem hiding this comment.
Indeed a bit strange.
Other question: how much larger is the full world wide data on disc. (CGIAR is 70GB)
There was a problem hiding this comment.
I build a GeoTIFF earlier this year for fun (from the raw tiles, no hole fixing etc!): https://hannes.enjoys.it/blog/2017/01/one-srtmgl1-geotiff-to-rule-them-all/
The result was ~90GB without overviews, ~120GB with. I used -co PREDICTOR 2 -co COMPRESS=DEFLATE -co TILED=YES which from my understanding was ideal.
https://www.datenatlas.de/geodata/public/srtmgl1/
There was a problem hiding this comment.
Thanks for the details @kannes. I think the newer SRTMGL1 are already hole/void fixed with ASTER GDEM data?
Voids in the Version 3.0 products have been filled with ASTER Global Digital Elevation Model (GDEM) Version 2.0, the Global Multi-resolution Terrain Elevation Data 2010 (GMTED2010), and the National Elevation Dataset (NED)
There was a problem hiding this comment.
What do you think about a new section below the software for data licenses here (and explicitly mention what is used by default)?
I would add stuff we have here and also gtfs.
Maybe via a table
| source | license | used as default | included in repo |
|---|---|---|---|
| OpenStreetMap data for the road network | ODBL | yes | yes |
| GTFS NRW | TODO link | no | yes |
| SRTM elevation | public domain | no | yes |
| CGIAR elevation | allowed usage for GraphHopper | no | yes |
| SRTMGL1 elevation | TODO link | no | no |
| OpenTopography mirror for SRTMGL1 | TODO link | no | - |
| /** | ||
| * @author Robin Boldt | ||
| */ | ||
| public class SRTMGL1ProviderTest { |
There was a problem hiding this comment.
I wonder: when we added a test isn't there also a file required under core/files/xy.hgt? Otherwise fresh tests won't run without internet or could be slow (?)
There was a problem hiding this comment.
All elevation provider (except the SRTMProvider) tests don't actually return the height of a coordinate, they only return the name of the file they are going to download. I haven't seen that there are files for the srtm provider. Should we add files for the SRTMGL1 provider as well? (note, the files are 25mb large and per default not zipped). CGIAR files are also around 30mb. GMTED are >200mb. Not sure if it's easy to create small dummy files?
This is actually something that bothers me as well. I was thinking about adding a test, but to put @ignore at the test, so we can enable the test if we change something about the elevation provider, but don't use it most of the time. WDYT?
BTW: Our API/client tests probably fail if there is no internet as well (haven't tested that yet I think)?
There was a problem hiding this comment.
There are files at core/files/*hgt.zip
Should we add files for the SRTMGL1 provider as well?
Ok, probably not :)
The idea with the @Ignore seems interesting and I think there is something in combination with maven for executing only a specific set of tests
BTW: Our API/client tests probably fail if there is no internet as well (haven't tested that yet I think)?
Yes, we should include an option to exclude it or just run it on travis?
|
|
||
| @Override | ||
| public String toString() { | ||
| return "srtmgl1"; |
There was a problem hiding this comment.
Is there a reason we use lower case here and upper case in the other? I would prefer having the same case for all even if this means changing the old case.
There was a problem hiding this comment.
Is there a reason we use lower case here and upper case in the other?
Oh sorry I missed that. The GMTED provider is also lowercase. I can change both. I just thought it should be the same as the config value.
There was a problem hiding this comment.
Makes more sense if they have the config value. Would this break some tests or usage scenarios?
There was a problem hiding this comment.
Would this break some tests or usage scenarios?
I don't think so. I actually think the toString method is only used to do a System.out:
logger.info(this.toString() + " Elevation Provider, from: " + baseUrl + ", to: " + cacheDir + ", as: " + daType);
| * <p> | ||
| * TODO: In addition, NSF requires oral acknowledgment during all news media interviews. | ||
| * TODO: This is weird, we have to check if really want to use OpenTopography then, see: http://www.opentopography.org/citations | ||
| * <p> |
There was a problem hiding this comment.
Indeed a bit strange.
Other question: how much larger is the full world wide data on disc. (CGIAR is 70GB)
|
One minor question: did you do the screenshots without douglas peucker? (and do not hesitate to create a PR that disables douglas peucker for debug=true :)) |
Yes all screenshots were taken with
Good question. So every .hgt file is 25mb large. There are about 14000 files. So the overall size should be at around 340 gb. I haven't tested it though. According to this link it's 318 gb. BTW, according to this link, ASTER GDEM is about 560gb. |
I thought about this a bit. I am not sure if this is wanted/expected behavior. Think about you have a request and want to inspect it, you set debug=true and suddenly you receive more points. I think this would be unexpected. WDYT? |
You are probably right. And as avoiding douglas peucker is already possible we should avoid too many things on debug=true :) |
|
Looks like a good improvement. Can we reduce the code in the GraphHopper class a bit and why is the RAM increase necessary? (because of the tests with tiles of 30 degree resolution?) |
Sorry I should have mentioned that the last commit changing the memory limit was intended to show that the tests work, but Travis timed out. As discussed earlier, I will @ignore these tests and set the memory limit back to the original value.
Sure :).
Yes. Sorry I should have mentioned that this PR wasn't considered mergeable after yesterday's commit :(. BTW: Will commit tomorrow, sorry for the delay :(. |
Really no problem ... all fine and please no hurry :) |
|
@karussell do you remember why we read the width of the tile in the SRTM provider (see here): This document describes the number of rows and colums for the SRTM files so it seems reasonalbe to me to assume that all files use the same width? |
Improved FileNotFound handling for the SRTMGL1Provider Some minor improvements
| * | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * |
There was a problem hiding this comment.
I just updated IntelliJ, they added formatting for Copyright Statements (I mean who hasn't been waiting for this great feature). Even if I disable formatting for copyright statements and for java doc IntelliJ still messes this up...
Before merging I could just overwrite all copyright statements that got changed by the autoformatting?
|
I think we read&store the width because of the different resolutions (30 vs. 90). If you click blame you see this commit: 2e60c80 |
Ah ok makes sense. Since we have two different providers for this now, we could think about reverting this and define the width before. I think this would make the code a bit nicer and we might be able to abstract more and reduce the code duplication. I updated the PR adding some more tests that check that the borders between the HeightTiles are aligned correctly. BTW: A very handy tool to check elevation is the elevation-service by @perliedman. |
| /* | ||
| * Licensed to GraphHopper GmbH under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with this work for | ||
| * license agreements. See the NOTICE file distributed with this work for |
There was a problem hiding this comment.
I tried to copy the copyright information from a different class in GraphHopper and I think that the applied formatting is actually correct and that the formatting before has been wrong, so I would keep it that way.
|
I think this PR should be good to merge now. If we want to change the width handling of the SRTM provider I could further try to further melt down the code. Something worth checking would be also if there is a major slow down due to the getFileName method. This method uses String.format and builds Strings with '+' instead of using StringBuilder. I would assume that the jit should be able to properly optimize these methods. If there is a performance issue I would revisit this method and try to improve it's performance. |
Sure, let's write this down in another issue
Yes, I think it is necessary to avoid String.format in this method (but you can easily prove me wrong via comparing this for world wide import ;)). Please see CGIARProvider where I wrote that String.format makes problems (btw: I do not think that strings and pluses are a problem due to the JIT you mentioned). |
String.format is definitely slower than using regular concatenation, so I just changed it. Even if the difference might be small, having a faster import is always better. I think this PR should be mergeable now. Let me know if I should change anything? |
# Conflicts: # core/src/main/java/com/graphhopper/reader/dem/GMTEDProvider.java
|
I did a minor change here. I kept the CGIAR provider as default provider in the MultiProvider so that we don't break any existing code. Over time it might make sense to set the SRTMGL1Provider as the default provider. |
| public void setAutoRemoveTemporaryFiles(boolean autoRemoveTemporary) { | ||
| this.autoRemoveTemporary = autoRemoveTemporary; | ||
| } | ||
| abstract boolean outsideSupportedArea(double lat, double lon); |
There was a problem hiding this comment.
I know this is not a setter but do we need Java code style here: isOutsideSupportedArea?
There was a problem hiding this comment.
Makes sense :). I changed the method name.
|
Merged this PR after updating the method name |
|
Thanks, will be deployed in the next days! |
This PR partially fixes #384.
With this PR we add the functionality to use SRTM 1 arc second data. I did a couple of tests so far it looks a lot better than the CGIAR data. It would be interesting to see it working together with #1220. Both PRs seem to change the data in the same direction, with both combined I think we would see a very smooth and nice looking elevation diagram. Also this would probably improve calculated routes a lot.
At first I wanted to use the ALOS data, but decided against it after reading more reviews about the ALOS data. In general it is considered to be one of the most detailed data sources, but it has some major flaws in some areas:
On the other hand some studies found that the AW3D30 data has less errors than SRTM data.
I know that SRTM has similar issues especially with water surfaces being not perfectly even. Combining AW3D30, SRTMGL1, and GMTED, in the MultiElevationProvider is probably our best bet on the long term.
Here are a couple of comparison (I used the same as in #1220 ).
Schauinsland

GH Maps 29.46km ↗1891m ↘1515m
PR 29.08km ↗1479m ↘1120m

From Grabenstetten to St. Johan.
GH Maps 15.72km ↗907m ↘863m

PR 15.45km ↗642m ↘595m

Neuffen.
GH Maps 5.15km ↗613m ↘332m

PR 4.89km ↗393m ↘113m

Herrnstein


Bad Hindelang

