IsraelHikingMap / Site

Israel Hiking Map has maps, route planning, and travel information for Israel. This repository holds the files needed for running the Israel Hiking Map site and apps.
https://israelhiking.osm.org.il/
Other
79 stars 32 forks source link

Missing map tiles for some ESRI sources #942

Closed zstadler closed 5 years ago

zstadler commented 5 years ago

Performance and Reliability

The current support for ESRI map sources uses OpenLayers' TileLayer with a TileArcGISRest source that uses the ESRI export API.

This approach enables simple client-side implementation and support of ESRI sources using CRSes other than Web-Mercator such as the New Israeli Grid. On the other hand, for some ESRI sources, the transition from the Leaflet infrastructure introduced occurrences of missing map tiles.

The goal of this issue is to discuss the options to improve the support for ESRI sources while considering reliable communication, performance, and coding complexity.

@jgravois, your view and thoughts would be greatly appreciated!

Aspect 1: OpenLayers' TileLayer vs. ImageLayer

In a comment on issue #860 I wrote:

In the above example, the base map is an ImageLayer and the overlay is a TileLayer. TileLayers have better performance and would be preferred.

The better performance was expected from requesting smaller images from the server, reducing the communication bandwidth to contain missing tiles only, and improving throughput by performing multiple tile downloads in parallel.

Indeed, #860 was implemented using TileLayer. It turns out that some ESRI Map servers perform unreliably with TileLayer. For example, having blank tiles when using https://gis.shual.org.il/arcgis/rest/services/MAPS/Orto2015v1/MapServer:

image

For comparison, there were no such issues with this source in the earlier Leaflet infrastructure of the site. That infrastructure downloaded the entire canvas, the equivalent of ImageLayer, using a single export API request.

Note: Both site versions were used with a 100 Gbps broadband connection.

Aspect 2: ESRI export API vs tile access

In another comment @jgravois wrote:

you should only use image if tiles either

  1. aren't present
  2. were cooked in a different CRS than the map you want to display.

Initially, I thought this comment also refers to the "OpenLayers' TileLayer vs. ImageLayer" aspect. I now believe it actually refers to the map download the MapServer - using tiles with MapServer/tile/{z}/{y}/{x} URLs vs. the use of the export API.

If this new understanding is correct, the current implementation does not follow the above recommendation. By always using the export API, the client side has simpler client-side code that avoids the evaluation of the two conditions on the server capabilities. AFAIK, similar code to is not available as part of OpenLayers' ESRI support.

@jgravois, I wonder what are the drawbacks of using the export API that lead to your recommendation and if it has anything to do with the missing tiles.

Options

1. Retry after download failures

The client could be enhanced to identify image download failures and retry.

2. Use ImageArcGISRest sources

It seems like this source type will restore the client-server communication as was with Leaflet.

What I did that caused the issue - step by step

My environment

jgravois commented 5 years ago

I wonder what are the drawbacks of using the export API that lead to your recommendation and if it has anything to do with the missing tiles.

the drawback of using export is that asking the server to generate a (possibly reprojected) image on the fly takes a lot longer than fetching tiles from a cache.

missing tiles are evidence that something is wrong with the published service.

HarelM commented 5 years ago

@zstadler any reason to keep this issue open?

zstadler commented 5 years ago

I was unable to reproduce the issue in the beta site. Closing