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.
Solved! Go to Solution.
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.
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.
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?
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.