Wednesday, February 24, 2021

OAC integration with XYZ Tiled Web Maps

Tiled web maps or XYZ tile layers are maps that are displayed in a web browser by joining dozens of individually requested image or vector tiles from a web server. Along with WMS, XYZ tiled web maps are one of the most popular techniques used to display maps and to enable user interactions such as panning and zooming. 


The above picture shows a tiled web map of OpenSteetMap style focusing on Melbourne, Australia. At this particular zoom level, the map is sliced into various number of smaller tiles and the requests are sent to the webserver to fetch and render the appropriate tiles.  

Though both WMS and XYZ tiled web maps ultimately helps in a displaying a map in a browser, there are some fundamental differences between these two.

Performance:
Tiled web maps are generally much faster and more performant than WMS. This is because the entire map is split into various number of small tiles and the time taken to request and display the tiles is computationally less demanding than fetching then entire map to be shown in the viewport in a few image requests. The latter is how WMS is designed to work. Also the user experience while panning is superior in Tiled web maps. Each time the user pans, most of the tiles are still relevant and can be kept displayed, while new tiles are fetched. This is in stark contrast to WMS where each time a user pans a map, new requests will be sent to the web server to display the map images corresponding to the view port which is highly time consuming. 

Server Communication:
Number of parameters that a user needs to fill out in order to establish a communication with WMS server is high. These include version number, coordinate system, URL of the web server, Layer names, format and other style parameters. So each request to the WMS server will be sent in the form of key-value pairs for the above parameters.
By contrast establishing a communication with a XYZ tiled web maps server only takes a URL to the web map server. Looking like this :
  

Z  - zoom level, X,Y- a numbering scheme used to identify the tile.
The defacto standard for fetching image tiles is PNG format and hence most of the urls for tiled web map server end with ".png" 

How to enable consumption of XYZ Tiled Maps in OAC ?

Map backgrounds coming from XYZ web services can easily be extended into Oracle Analytics Cloud : Go to Console -> Maps -> Background -> Add Map Background -> Tiled Web Map
This should open up the following dialog


For this example, let us take the ESRI image satellite map hosted on the XYZ Tile server https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}

Let's give a name for the new map background and add the above URL of  ESRI tile server to the URL text box. Also click on the checkbox to automatically add the domain name of the web server to the list of safe domains. The dialog will now look like this.



Click on Save to add the XYZ tiled web maps to the list of background maps. Once saved, you can inspect the background map and preview it.


That's all it takes, the user should now be able to use this newly added XYZ background map as a map background in an OAC project and interact with it like any other map background. 
There are additional options, if needed by your service, that can be entered as part of the parameters tab in the dialog box as well.

Thanks for reading this blog !

No comments:

Post a Comment