Offline map tiles from a remote server

853
3
Jump to solution
06-11-2021 12:50 AM
FatmaAkdemir
Occasional Contributor II

We are using ServiceImageTiledLayer to display our offline map tiles on local disk as below:

setTileUrl(tileKey, QUrl(QString("/home/fatma/world_imagery_arcgis/%1/%2/%3.png").arg(
                          QString::number(tileKey.level()),
                          QString::number(tileKey.column()),
                          QString::number(tileKey.row()))));

If the image tiles were on a remote computer or server on local network, how would I retrieve the image tiles? We do not want map tiles to reside on the same computer with the executable.

0 Kudos
1 Solution

Accepted Solutions
JamesBallard1
Esri Regular Contributor

Hi @FatmaAkdemir . In the case of local tile data (or over the local network), you would want to implement your own ImageTiledLayer which has the signals and method which will work for this scenario. As long as you can access the tile info over the network/filesystem, this will work.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-imagetiledlayer.html#creating-...

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-imagetiledlayer.html#setTileDa...

 

View solution in original post

0 Kudos
3 Replies
JamesBallard1
Esri Regular Contributor

Hi @FatmaAkdemir . In the case of local tile data (or over the local network), you would want to implement your own ImageTiledLayer which has the signals and method which will work for this scenario. As long as you can access the tile info over the network/filesystem, this will work.

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-imagetiledlayer.html#creating-...

https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-imagetiledlayer.html#setTileDa...

 

0 Kudos
FatmaAkdemir
Occasional Contributor II

Hi @JamesBallard1 ,

We have tried to get tile data from a remote computer over the local network by mounting the directory using Linux Samba . However Pan/Zoom on the map does not operate seamlessly which is not the case when we put the tiles on the local disk. How can we make things faster when the tiles are on a remote computer?

0 Kudos
JamesBallard1
Esri Regular Contributor

Hi @FatmaAkdemir ,

   If it works fine when the files are local, but is laggy when accessing the files over a network samba share, it sounds like a network latency issue.

If both computers are Linux, NFS might be better performance but that's a guess. You could implement some caching algorithms to store the images locally in /tmp as they're accessed, and retrieve them from local disk if they are accessed again. The first access would still be slow.

Another idea would be to index and store all your tile images into a database. Then in your method that gets the tile bytes, it would be a sql (or whatever db) call rather than accessing files over the network. That may not work depending on how many tiles you have.

https://doc.qt.io/qt-5/sql-driver.html 

Another thought would be to compress your tiles and store them at lower resolutions (so smaller file sizes) so they can be read quicker over the samba mount.

Lots of options, but the core issue sounds like the network latency and not the Runtime. You can likely measure the data read times and compare to local file access to see how much network latency you're dealing with to decide on the best course of action.

I hope this help.

0 Kudos