OpenHistoricalMap / issues

File your issues here, regardless of repo until we get all our repos squared away; we don't want to miss anything.
Creative Commons Zero v1.0 Universal
17 stars 1 forks source link

Integrate USGS TopoView into iD #599

Open 1ec5 opened 1 year ago

1ec5 commented 1 year ago

iD currently features a USGS Topographic Maps layer courtesy of Caltopo (osmlab/editor-layer-index#290). This layer has been essential for expanding pre–2010s coverage of small towns in the United States. However, this mosaic has an ambiguous vintage, and at best it represents only a snapshot in time.

The USGS maintains its own TopoView service that makes it easy to find and preview georeferenced topographic maps all the way back to 1884. The service is primarily about accessing the original georeferenced scans, borders and all, which are also available individually from other USGS websites such as ScienceBase. However, we don’t need the borders, and we especially prefer a Web image format such as PNG over something desktop-oriented like GeoTIFF or PDF. The cropped overlays from the TopoView website itself would be more useful for tracing. It would be wonderful if we could somehow integrate these overlays into iD as a dynamic series of background layers to choose from.

/ref https://github.com/OpenHistoricalMap/issues/issues/582#issuecomment-1681090527

1ec5 commented 1 year ago

From taking a cursory look at TopoView, I don’t think they advertise a WMS or TMS for the imagery. However, the application does use a MapService under the hood to discover the overlay images. It calls the MapService’s identify endpoint with a point geometry and viewport, such as:

https://ngmdb.usgs.gov/arcgis/rest/services/topoview/ustOverlay/MapServer/identify?sr=4326&layers=all&tolerance=3&returnGeometry=true&imageDisplay=995%2C468%2C96&mapExtent=-93.30422401428224%2C44.854773605970244%2C-93.26152324676514%2C44.869009599324826&geometry=-93.28010559082033%2C44.8598235278391&geometryType=esriGeometryPoint&f=json

The response contains metadata such as results[0].attributes.map_state and results[0].attributes.drg_name that indicate an image URL:

https://ngmdb.usgs.gov/img4/ht_icons/overlay/MN/MN_Minneapolis_805505_1901_62500_geo.jpg

along with a polygon geometry for georeferencing purposes. This is not a tiled image, but openstreetmap/iD#9291 added support for loading georeferenced images that should be adequate for overlaying this image on the map canvas during editing.

If there is a WMS somewhere with tiled images of these scans, that would be preferable in terms of being confident in the endpoint’s stability.

1ec5 commented 1 year ago

This is not a tiled image, but openstreetmap/iD#9291 added support for loading georeferenced images that should be adequate for overlaying this image on the map canvas during editing.

Just kidding, that iD feature is about geotagging photos, not georeferencing images flat on the map. The images are already projected into Web Mercator in order to display them on a Mapbox GL JS map, but it would still require a bit of extra code to position the image correctly on the canvas. Another reason why a normal WMS would be wonderful.

1ec5 commented 1 year ago

Some additional possibilities in OSMUS Slack.

1ec5 commented 8 months ago

This ImageServer seems to have everything that’s on topoView already georectified and cropped. The public listing points to a different ImageServer that’s behind an ArcGIS login wall.

1ec5 commented 7 months ago

Esri also publishes a Topo Map Explorer application. The ImageServer would be closer to what iD needs to consume though.

1ec5 commented 2 months ago

This ImageServer seems to have everything that’s on topoView already georectified and cropped.

To use this ImageServer, adjust the time slider so that you see the topo map you want to trace from, then use your browser’s network inspector to see what the HTTP requests look like. The custom background URL template would look like any other WMS, except for the addition of a time parameter that takes two times in milliseconds since the Unix epoch (January 1, 1970, at midnight UTC). For example, this URL includes any topographic map from March 15, 1955, to January 1, 2006:

https\://historical1-stg.arcgis.com/arcgis/rest/services/USGS_Historical_Topographic_Maps/ImageServer/exportImage?bbox={bbox}&bboxSR={proj}&size={width},{height}&format=png&transparent=false&f=image&time=-467026560800,1136073600000

Bauer33333 commented 1 month ago

This integration would be awesome, there is more data than one can map in his lifetime ready to use. This would also make historic sources very easily accessable to newbies, what I feel like is one of the big hurdles to get new mappers in. There is just one point that should be considered. While the newer low scale maps are off about half a dozend meters the rectification on the larger scale maps has some rather large offsets in the 200-500 m range: grafik These warps can't be fixed by a simple offset either, here a rather tame example of the stretching: grafik Even if they were perfectly rectified I'm not sure if everything on the original maps has been measured, you can sometimes see objects iterating closer to their real position over the years. So they are not suitable for just blindly drawing everything you see like people do on aerials, you need to know that there are offsets and how to deal with them. So at least a warning should be considered.