Hi,
Swissalti3d is a precise elevation data (0.5m or 2m step) available freely as opendata.
I have started investigating how to add support for it in Graphhopper. I would be glad to have feedback and maintainer guidance on how to do that in a great way.
If there is interest for it by the maintainers, my plan is to have it merged into graphhopper mainstream.
Otherwise it would stay in a fork, available for anyone interested in it.
Here are some insights / details following my primary investigation.
The datasource: opendata Swissalti3d
Area: Switzerland
Cloud Optimized Geotiff (COG), LZW compression
0.5 m COG: ~ 26 MB / tile, 770 GB / full coverage
2 m COG: ~ 1 MB / tile, 44 GB / full coverage
Projection: LV95 (EPSG:2056)
Downloading all tiles:
Select entire dataset + download csv with the URLS for all the tiles
Example of tiles from the CSV (these are 2m steps):
swissalti3d_2019_2501-1120_2_2056_5728.tif
Gdal output:
Driver: GTiff/GeoTIFF
Files: swissalti3d_2019_2501-1120_2_2056_5728.tif
swissalti3d_2019_2501-1120_2_2056_5728.tif.aux.xml
Size is 500, 500
Coordinate System is:
PROJCRS[“CH1903+ / LV95”,
…
USAGE[
SCOPE[“Cadastre, engineering survey, topographic mapping (large and medium scale).”],
AREA[“Liechtenstein; Switzerland.”],
BBOX[45.82,5.96,47.81,10.49]],
ID[“EPSG”,2056]]
Data axis to CRS axis mapping: 1,2
Origin = (2501000.000000000000000,1121000.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=BAND
LAYOUT=COG
Corner Coordinates:
Upper Left ( 2501000.000, 1121000.000) ( 6d 9’21.66"E, 46d14’ 3.78"N)
Lower Left ( 2501000.000, 1120000.000) ( 6d 9’22.42"E, 46d13’31.40"N)
Upper Right ( 2502000.000, 1121000.000) ( 6d10’ 8.32"E, 46d14’ 4.31"N)
Lower Right ( 2502000.000, 1120000.000) ( 6d10’ 9.08"E, 46d13’31.93"N)
Center ( 2501500.000, 1120500.000) ( 6d 9’45.37"E, 46d13’47.86"N)
Band 1 Block=128x128 Type=Float32, ColorInterp=Gray
Min=372.139 Max=372.141
Minimum=372.139, Maximum=372.141, Mean=372.140, StdDev=0.000
NoData Value=-9999
Overviews: 250x250
Steps:
- figure out the tiling naming conventions of Swissalti3d
- create a Swissalti3dElevationProvider on the model of CGIARProvider
Pain points?
-
EPSG:2056 projection
I am thinking of adding the dependency to the small proj4j lib GitHub - locationtech/proj4j: Java port of the Proj.4 library for coordinate reprojection
and do reprojection at the lookup time -
Geotiff data
There is already a Tiff reader in Graphhopper, I hope I can use it directly.
I am open to your feedback.
If someone want to directly participate, also let me know.
Guillaume