1

I'm very unclear on all of these acronyms. All I know is that USGS 3DEP LiDAR maps are very useful for seeing cliffs for climbing, and Osmand is very useful for offline navigation, but I can't figure out how to get the 3DEP maps in Osmand. I've been talking to ChatGPT a lot and it doesn't know, either.

A URL of this format works:

https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?FORMAT=image/png32&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=3DEPElevation:Hillshade%20Multidirectional&STYLES=&CRS=EPSG:3857&WIDTH=256&HEIGHT=256&BBOX=-8256270,5033681,-8255813,5033988

Producing an image like this:

enter image description here

but Osmand requires a format like this:

To create a raster map source you need to know the tile URL. This is URL that can distribute tiles in Mercator Projection. Here is a tile example URL https://tile.osmand.net/hd/6/55/25.png, where is the base part https://tile.osmand.net/hd/.

I'm using this URL to view them in iD editor for OpenStreetMap:

https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?FORMAT=image/png32&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=3DEPElevation:Hillshade%20Multidirectional&STYLES=&CRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}

ChatGPT said this URL format would work in Osmand:

https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?FORMAT=image/png32&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=3DEPElevation:Hillshade%20Multidirectional&STYLES=&CRS=EPSG:3857&WIDTH=256&HEIGHT=256&BBOX={bbox}

But it seems to do nothing, the background is just grey.

It said I should check https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?request=GetCapabilities&service=WMS to see if it supports EPSG:3857, and it seems to:

…
<Layer>
<Name>0</Name>
<Title>3DEPElevation</Title>
<Abstract>
The USGS 3D Elevation Program (3DEP) Bare Earth DEM Dynamic service is based on multi-resolution USGS DEM sources and provides dynamic functions for visualization. These functions include: Hillshade, Aspect Map, Hillshade Stretched, Multi-directional Hillshade, Slope Map, Elevation Tinted Hillshade, Contour. In addition the OGC Web Map Service (WMS) and Web Coverage Service (WCS) interfaces are enabled. Data available in this map service reflects all 3DEP DEM data published as of May 15, 2023.
</Abstract>
<CRS>CRS:84</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:3857</CRS>
…
<EX_GeographicBoundingBox>
<westBoundLongitude>-179.999989</westBoundLongitude>
<eastBoundLongitude>179.999993</eastBoundLongitude>
<southBoundLatitude>-15.001663</southBoundLatitude>
<northBoundLatitude>84.001679</northBoundLatitude>
</EX_GeographicBoundingBox>
…
<BoundingBox CRS="EPSG:3857" minx="-20037507.067200" miny="-1689391.823360" maxx="20037507.532527" maxy="18809001.971900"/>
…

I found http://whoots.mapwarper.net/ but don't know how to use it. ChatGPT suggested a URL like this

http://whoots.mapwarper.net/tms/3/6/5/3DEPElevation/https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?FORMAT=image/png32&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=3DEPElevation:Hillshade%20Multidirectional&STYLES=&CRS=EPSG:3857&WIDTH=256&HEIGHT=256

but it just downloads a file called called WMSServer which contains

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
  <ServiceException code="InvalidLayers">
Parameter 'Layers' contains invalid values.
  </ServiceException>
</ServiceExceptionReport>

Previously asked here: https://github.com/osmandapp/OsmAnd/discussions/17256#discussioncomment-5991416

8

3 Answers 3

1

User mariush444 found a much simpler way: Set the .metainfo file like this:

[url_template]
https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?bbox={bbox}&format=image/jpeg&service=WMS&version=1.3.0&request=GetMap&CRS=CRS:84&width=256&height=256&layers=3DEPElevation:Hillshade%20Elevation%20Tinted&TRANSPARENT=TRUE&map=&styles=
[ext]
.jpg
[min_zoom]
1
[max_zoom]
19
[tile_size]
256
[img_density]
32
[avg_img_size]
18000
img_size]
18000

This is similar to the URLs I had been trying before, but it actually works. From my testing, it's due entirely to the use of CRS:84 (which is in degrees and long, lat order?) instead of EPSG:3857 (which is in meters and lat, long order?) ChatGPT also says I should select elliptical Mercator to go along with CRS:84, which appears to be wrong advice because everything is offset.

Anyway I was able to get all the map layers into Osmand this way, without a proxy server, by replacing Hillshade%20Elevation%20Tinted with the other layer names:

  • Hillshade%20Gray
    • "Provides a hillshaded surface generated dynamically using the hillshade server-side function on the elevation layer with a solar azimuth of 315 degrees and solar altitude of 45 degrees."
  • Aspect%20Map
    • "This server-side function will apply an on-the-fly process to the input elevation data to generate a color visualization of aspect."
  • Hillshade%20Elevation%20Tinted
    • "This server-side function will apply an on-the-fly process to the input elevation data to generate a tinted hillshade."
  • GreyHillshade_elevationFill
    • "Provides a hillshaded surface generated dynamically using the hillshade server-side function on the elevation layer, with the voids filled in. A solar azimuth of 315 degrees and solar altitude of 45 degrees has been applied."
  • Hillshade%20Multidirectional
    • "A raster function template."
  • Slope%20Map
    • "This server-side function will apply an on-the-fly process to the input elevation data to generate a color visualization of slope, where flat surfaces are gray, shallow slopes are yellow, and steep slopes are red-brown."
0

ESRI ImageServer has ExportImage REST API so requesting a Tile can be done as well as any raster image bbox and size

you can always try adding /tile/{z}/{y}/{x}.png to the end of ImageServer and MapServer URL's that can support it (cached)

Check out Map Data Explorer iOS and Android app it can download ImageServer as MBTILES Raster Tiles for offline use https://mapexplorer.techmaven.net

You maybe interested in GeoNames Map Explorer iOS app and you can also load offline GPKG and MBTILES and GeoJSON https://geonamesmapexplorer.techmaven.net

1
0

After a lot of back and forth with ChatGPT, I got a server set up on AWS, based on https://github.com/mapbox/whoots-js but hardcoding JPEG instead of PNG, and proxying the image instead of redirecting. Here's my fork:

https://github.com/endolith/whoots-js

and the changed files:

https://github.com/mapbox/whoots-js/compare/master...endolith:whoots-js:master

I was able to add all the USGS 3DEP elevation layers and import them into Osmand with URLs like this:

http://osmand.net/add-tile-source?name=3DEP%20Hillshade%20Multidirectional&min_zoom=1&max_zoom=18&url_template=http://[AWS server's IP]:8080/tms/%7B0%7D/%7B1%7D/%7B2%7D/3DEPElevation:Hillshade%20Multidirectional/https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.