Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Reload maps" takes a long time #647

Closed
Phobooky opened this issue Nov 26, 2023 · 33 comments
Closed

"Reload maps" takes a long time #647

Phobooky opened this issue Nov 26, 2023 · 33 comments
Labels
bug Something isn't working

Comments

@Phobooky
Copy link

Phobooky commented Nov 26, 2023

Describe the bug

"Reload maps" takes a long time

What have you done to circle down the problem?

The "Reload Maps" option is very slow compared to 1.16.1
In 1.16.1 it is practically instantaneous and in 1.17 it takes quite a few seconds depending on the number of maps. About 7 or 8 seconds
for six map paths.

To Reproduce

  1. Go to Maps Window
  2. Click on Reload Maps
  3. See error: Takes several seconds

Expected behavior

comment: # Instant response as 1.16.1

Screenshots

Captura de pantalla 2023-11-26 100358

Attachments

N/A

Tracebacks

Desktop

  • OS: Windows 11
  • QMapShack Version 1.17

Additional context

@Phobooky Phobooky added the bug Something isn't working label Nov 26, 2023
@wthaem
Copy link
Contributor

wthaem commented Nov 26, 2023

@kiozen: Does this operation imply cleaning of the map cache? In the given situation online maps are involved and reloading a lot of tiles may take quite some time. I observe a similar problem when starting QMS. With a big cache the start is rather slow.

@Phobooky
Copy link
Author

Phobooky commented Nov 26, 2023

No, the map cache is not cleared. I've just checked it. The problem must be something else. I think the delay in starting is related to the size of the workplace. In my case the startup time in 1.17 is a little longer than in 1.16.1

@frankystone
Copy link

Maybe related to the new rendering of DEM-Data? If DEM data with hillshading is used, see if deactivating hillshading decreases the time to reload maps. Just a guess though.

@Phobooky
Copy link
Author

The delay occurs when QMS looks for a new maps.... I do not see the relationship with DEMs

@kiozen
Copy link
Collaborator

kiozen commented Nov 27, 2023

I can't really reproduce the problem. Can you move one map after the other to single down if it is dependent on a single map.

@Phobooky
Copy link
Author

I can't really reproduce the problem. Can you move one map after the other to single down if it is dependent on a single map.

I send two videos. Although the cursor is not seen, what I do is the same. I reload maps and then try to scroll in the map window. In version 1.16.1 it is seen that immediately after reloading maps you can scroll. In version 1.17 after reloading maps, you cannot scroll for about seven seconds. This is because the map reloading process takes that long when in 1.16.1 it was immediate.

1.mp4
2.mp4

@mitxel-m
Copy link
Contributor

mitxel-m commented Nov 27, 2023

@Phobooky , You have a 2x2m DEM with hillshade active ( IGN MDT02), in my opinion this is what slows you down.

And now you will say that in version 1.16.1 you also have the same DEM with hillshading active. OK, but in 1.17.0 the shading is calculated with more detail and smoother, so it can take a bit longer.

To avoid this slowing down the redrawing of the map QMS allows you to limit the zoom range at which the DEM is displayed, and the shading is calculated. Let's call it ' smart use of DEMs'.

Think that in smaller scales (zoomed out) it makes no sense to calculate a shading with a 2x2m DEM because one pixel on screen occupies more surface than those 2x2m, therefore you will not be able to see all its details and you are slowing down unnecessarily.

The logical thing to do is to limit the range of the 2x2 DEM to a very close zoom, and use a 25x25 DEM that starts displaying the hillshading at the zoom level where the 2x2 DEM ends.

Basically, you limit the zoom ranges at which QMS will read DEM data for the whole screen area (and will display it) to avoid slowing down, and the magic is that although the DEM is not displayed, it does apply to the tracks you draw or edit.

DEM Zoom Range

Here is a tutorial on this topic in Spanish:
https://www.mendiak.net/viewtopic.php?t=63132&start=15#p778235

and also in the help and wiki in English:
https://github.com/Maproom/qmapshack/wiki/AdvMapDetails#user-content-range-of-use-of-elevation-data

Please try it and let us know if it is working for you.

@kiozen
Copy link
Collaborator

kiozen commented Nov 28, 2023

I can confirm there was a change in how raster maps (DEM as well as map) are rendered. Now the render process makes use of as many CPU cores as are available. Previously it was just a single core. On a modern CPU with 16 plus cores this is quite an increase in performance. Therefore more calculation power can be spent on rendering hill shading. On older CPUs this can backfire.

Also note there are two different shading modes. If you activate both it takes more time.

@Phobooky
Copy link
Author

First of all, I think I have to apologize because maybe I didn't express myself well. I don't have any problems with DEMs or rendering maps with the DEM. Maybe there are also changes or problems with the DEMs, but that is not the case for me. I opened this bug for another problem. I try to explain it again. In the Maps window, if I want QMS to check it again for new maps, I use the right-click function, pop-up menu and press "Reload Maps". This action takes about 6 or 7 seconds in 1.17 and nothing in 1.16.1. That is my only problem detected. I don't know if I have explained myself correctly.

@frankystone
Copy link

Reloading the maps causes a new rendering of the maps. And rendering of maps causes also new rendering of DEM hillshading, imho.

Why don't you just try it out by deactivating hillshading, or DEM at all? It would help to find the cause of your described problem. If the issue persists after deactivating DEM, then the cause is not hillshading, if it solves it then DEM hillshading is the cause.

@kiozen
Copy link
Collaborator

kiozen commented Nov 28, 2023

Deactivate all maps and DEM. And then activate one after another. After each activation try to reload. This is the only way to circle down what's causing the problem. None of us can reproduce it. Therefore it must be something special with your setup. The only way to find out is to circle down what's causing it.

@Phobooky
Copy link
Author

@frankystone @kiozen I have followed all the steps you have advised me to do. I have been removing DEMs until I have left none. The behavior was the same. I have removed the paths from the DEMs. The behavior was the same. As it was a good clue to deactivate, I continued with the maps. The behavior was the same until I removed all the maps folders. I no longer have any maps or DEM folders set up. Now I put them back in little by little and apparently the performance is better. But it is a false appearance. The issue is that I have 9 views and each online map takes about half a second, which multiplied by the views makes reloading the maps take about 5 or 6 seconds. Since 1.16.1 did not do that, I think it seems that something new does the reloading of maps that causes that if there are many maps online, the process slows down. I think there may be a new cache check for expired tiles or something similar. Thank you very much for the help.

@mitxel-m
Copy link
Contributor

mitxel-m commented Nov 28, 2023

@Phobooky Thanks for trying it out and your report.

Following your last indications I can reproduce it if I open 9 map views. Even if there is no map or DEM active in any of the views.

It is also evident how much slower QMS starts up when it have 9 views. (as pointed by @wthaem )

To reproduce:

  • Open a lot of new views. Do no activate any map in any of them.
  • Do "Reload maps" on th map pannel
  • Try to move the map list up/down in the map pannel, there is a delay.

Considering that that there are no active maps in any of the views: rather than the cache, Could it be related to the read/write of how each view is configured ?

Remark:

  • I can only reproduce it on windows (Win10 in a VM). QMS installed in C:\Users\myuser\AppData\Local
  • I can NOT reproduce it on Linux Mint21

@Phobooky , apart from that: keep in mind what we said about DEMS, since having them active at all zoom levels increases a lot the time needed to redraw each view in outer zooms .

as pointed by @frankystone reloading the maps causes a redraw of the active view

@kiozen
Copy link
Collaborator

kiozen commented Nov 29, 2023

Just tested on Linux. No delay. I wonder what might be the difference in Windows....

@mitxel-m
Copy link
Contributor

My test with windows has been on a VM, so resources are limited. This afternoon I will be able to do a new test on a laptop with windows10 and I will post here the result.

@Phobooky
Copy link
Author

Phobooky commented Nov 29, 2023

My tests are with Windows 11 Pro 21H2, i7, 32.0 GB and obviously SSD.

@mitxel-m
Copy link
Contributor

mitxel-m commented Dec 1, 2023

This is the result of the last tests I have done:

Tests conditions:

  • 12 views
  • no map or dem active
  • no project in the workspace
  • only one maps path, pointing to a folder with 138 online maps ( TMS and WMTS)
  • Do "Reload maps" on the map pannel , and scroll up/down the map list

Results:

version OS Delay
QMS 1.17.0 Linux MINT21 / desktop PC No delay
QMS 1.17.0 Windows vista / desktop PC No delay
QMS 1.17.0 Windows10 / laptop No delay
QMS 1.17.0 Windows10 in a Virtual Machine
(!! maps path pointing to a shared folder out of the VM )
about 10 seconds
QMS 1.16.1 Windows10 in a Virtual Machine
(!! maps path pointing to a shared folder out of the VM)
about 10 seconds
QMS 1.17.0 Windows10 in a Virtual Machine
(maps path pointing to a folder inside the VM)
No delay
QMS 1.16.1 Windows10 in a Virtual Machine
(maps path pointing to a folder inside the VM)
No delay

Also:

  • For the only two cases I get a delay:

    • If I reduce the number of views, there is no delay.
    • If I point to a folder with few maps, even to a shared folder outside the VM, there is no delay.
  • For the cases with no delay

    • Adding more map paths, up to 10 different folders with lots of maps (TMS, WMTS, VRT, RMAP, JNX, IMG....), does not cause any delay.

Summary

The only way I can reproduce the problem is if all these circumstances are present:

Lots of views x Lots of maps x Maps path pointing to a shared folder in a VM

In my case it is the same result for both versions 1.16.1 and 1.17.0.

With this result, and unless someone gives more concrete hints, it seems to me that this issue is more dependent on the circumstances in which I play than on the QMS code.

@Phobooky , maybe you can try path by path to see if you can better circle down what is causing the delay for you.

@Phobooky
Copy link
Author

Phobooky commented Dec 1, 2023

@mitxel-m Thanks for the analysis. But I was a little surprised. My problems do not occur with a VM, so it is clear that I have to investigate more to try to focus the problem. I will keep you posted on my tests.

@Phobooky
Copy link
Author

Phobooky commented Dec 2, 2023

I've been doing a lot of testing, and I can't figure out the problem with the map loading delay. The most notable and amazing thing is what I tell you here.

Tests conditions:
• 9 views
• No map or dem active
• No project in the workspace
• None maps path.

Steps:
I point to a folder with 1 only online map (OSM map) and I activate the map in ONE view.
Do "Reload maps" on the map panel. As I don’t have scroll up/down bar the map list, I test the delay moving the map. The performance is perfect.
Now, I'm activating the map in the views. Every time I activate the map in a view, the reloading of maps (with a single folder with a single file in it) is increasingly slower. In the end, with all nine views with a map activated, the performance is bad. It takes about 5 seconds to recharge.

Summary
I experience a delay in loading maps having in 9 views a single activated online map that is the only file in a folder that is the only one that is pointed in QMS.

@Phobooky
Copy link
Author

Phobooky commented Dec 3, 2023

Since I was not satisfied with the little help I am giving you to locate the problem, I did another test.
I have taken a different Windows PC that has never run QMS. And I have done this test:

Tests conditions:
• New QMS 1.17 instalation in a new PC with Windows.
• No views
• No map or dem active
• No project in the workspace
• None maps path.

Steps:
I start QMS with -f option to get logfile
I point to a folder with 1 only online map (OSM map) and I activate the map in TEN views.
Do "Reload maps" on the map panel. The performance is bad.
Below I enclose the log when I "Reload maps":

Summary
I enclose logs.

2023-12-03 8:55:23.580 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:23.580 [debug] ------------------------------
2023-12-03 8:55:23.580 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:23.580 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:23.580 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:23.860 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:23.860 [debug]  "" false
2023-12-03 8:55:23.860 [debug] ***Not valid!***
2023-12-03 8:55:23.892 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:23.892 [debug] ------------------------------
2023-12-03 8:55:23.892 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:23.892 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:23.892 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:24.168 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:24.168 [debug]  "" false
2023-12-03 8:55:24.168 [debug] ***Not valid!***
2023-12-03 8:55:24.189 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:24.189 [debug] ------------------------------
2023-12-03 8:55:24.189 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:24.204 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:24.204 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:24.470 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:24.470 [debug]  "" false
2023-12-03 8:55:24.470 [debug] ***Not valid!***
2023-12-03 8:55:24.498 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:24.498 [debug] ------------------------------
2023-12-03 8:55:24.498 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:24.513 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:24.513 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:24.836 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:24.836 [debug]  "" false
2023-12-03 8:55:24.836 [debug] ***Not valid!***
2023-12-03 8:55:24.869 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:24.879 [debug] ------------------------------
2023-12-03 8:55:24.879 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:24.879 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:24.879 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:25.737 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:25.737 [debug]  "" false
2023-12-03 8:55:25.737 [debug] ***Not valid!***
2023-12-03 8:55:25.821 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:25.835 [debug] ------------------------------
2023-12-03 8:55:25.835 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:25.843 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:25.843 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:26.515 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:26.515 [debug]  "" false
2023-12-03 8:55:26.515 [debug] ***Not valid!***
2023-12-03 8:55:26.552 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:26.556 [debug] ------------------------------
2023-12-03 8:55:26.556 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:26.559 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:26.559 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:26.871 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:26.871 [debug]  "" false
2023-12-03 8:55:26.871 [debug] ***Not valid!***
2023-12-03 8:55:26.898 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:26.898 [debug] ------------------------------
2023-12-03 8:55:26.898 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:26.914 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:26.914 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:27.415 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:27.415 [debug]  "" false
2023-12-03 8:55:27.415 [debug] ***Not valid!***
2023-12-03 8:55:27.474 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:27.476 [debug] ------------------------------
2023-12-03 8:55:27.476 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:27.488 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:27.488 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:27.895 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:27.895 [debug]  "" false
2023-12-03 8:55:27.895 [debug] ***Not valid!***
2023-12-03 8:55:27.940 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-03 8:55:27.940 [debug] ------------------------------
2023-12-03 8:55:27.940 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-03 8:55:27.940 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-03 8:55:27.940 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-03 8:55:28.323 [warning] Failed to create projection: " +type=crs" -> "+proj=longlat +datum=WGS84 +no_defs +type=crs"
2023-12-03 8:55:28.323 [debug]  "" false
2023-12-03 8:55:28.323 [debug] ***Not valid!***
2023-12-03 8:55:28.352 [debug] Col/row info: 69903 69906 45011 45014 3 3 9
2023-12-03 8:55:28.352 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69903/45011.png"
2023-12-03 8:55:28.352 [debug] cached url
2023-12-03 8:55:28.352 [debug] 11.9943 49.0036 QPointF(0.209388,0.855275) QPointF(0.209388,0.855244) QPointF(0.20934,0.855244)
2023-12-03 8:55:28.352 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69904/45011.png"
2023-12-03 8:55:28.352 [debug] cached url
2023-12-03 8:55:28.352 [debug] 11.9971 49.0036 QPointF(0.209436,0.855275) QPointF(0.209436,0.855244) QPointF(0.209388,0.855244)
2023-12-03 8:55:28.352 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69905/45011.png"
2023-12-03 8:55:28.352 [debug] cached url
2023-12-03 8:55:28.352 [debug] 11.9998 49.0036 QPointF(0.209484,0.855275) QPointF(0.209484,0.855244) QPointF(0.209436,0.855244)
2023-12-03 8:55:28.352 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69906/45011.png"
2023-12-03 8:55:28.352 [debug] cached url
2023-12-03 8:55:28.352 [debug] 12.0026 49.0036 QPointF(0.209532,0.855275) QPointF(0.209532,0.855244) QPointF(0.209484,0.855244)
2023-12-03 8:55:28.352 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69903/45012.png"
2023-12-03 8:55:28.368 [debug] cached url
2023-12-03 8:55:28.368 [debug] 11.9943 49.0018 QPointF(0.209388,0.855244) QPointF(0.209388,0.855212) QPointF(0.20934,0.855212)
2023-12-03 8:55:28.372 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69904/45012.png"
2023-12-03 8:55:28.373 [debug] cached url
2023-12-03 8:55:28.373 [debug] 11.9971 49.0018 QPointF(0.209436,0.855244) QPointF(0.209436,0.855212) QPointF(0.209388,0.855212)
2023-12-03 8:55:28.373 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69905/45012.png"
2023-12-03 8:55:28.384 [debug] cached url
2023-12-03 8:55:28.384 [debug] 11.9998 49.0018 QPointF(0.209484,0.855244) QPointF(0.209484,0.855212) QPointF(0.209436,0.855212)
2023-12-03 8:55:28.390 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69906/45012.png"
2023-12-03 8:55:28.390 [debug] cached url
2023-12-03 8:55:28.390 [debug] 12.0026 49.0018 QPointF(0.209532,0.855244) QPointF(0.209532,0.855212) QPointF(0.209484,0.855212)
2023-12-03 8:55:28.390 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69903/45013.png"
2023-12-03 8:55:28.390 [debug] cached url
2023-12-03 8:55:28.390 [debug] 11.9943 49 QPointF(0.209388,0.855212) QPointF(0.209388,0.855181) QPointF(0.20934,0.855181)
2023-12-03 8:55:28.406 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69904/45013.png"
2023-12-03 8:55:28.406 [debug] cached url
2023-12-03 8:55:28.406 [debug] 11.9971 49 QPointF(0.209436,0.855212) QPointF(0.209436,0.855181) QPointF(0.209388,0.855181)
2023-12-03 8:55:28.424 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69905/45013.png"
2023-12-03 8:55:28.424 [debug] cached url
2023-12-03 8:55:28.424 [debug] 11.9998 49 QPointF(0.209484,0.855212) QPointF(0.209484,0.855181) QPointF(0.209436,0.855181)
2023-12-03 8:55:28.427 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69906/45013.png"
2023-12-03 8:55:28.440 [debug] cached url
2023-12-03 8:55:28.440 [debug] 12.0026 49 QPointF(0.209532,0.855212) QPointF(0.209532,0.855181) QPointF(0.209484,0.855181)
2023-12-03 8:55:28.440 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69903/45014.png"
2023-12-03 8:55:28.455 [debug] cached url
2023-12-03 8:55:28.456 [debug] 11.9943 48.9982 QPointF(0.209388,0.855181) QPointF(0.209388,0.855149) QPointF(0.20934,0.855149)
2023-12-03 8:55:28.456 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69904/45014.png"
2023-12-03 8:55:28.457 [debug] cached url
2023-12-03 8:55:28.457 [debug] 11.9971 48.9982 QPointF(0.209436,0.855181) QPointF(0.209436,0.855149) QPointF(0.209388,0.855149)
2023-12-03 8:55:28.457 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69905/45014.png"
2023-12-03 8:55:28.457 [debug] cached url
2023-12-03 8:55:28.457 [debug] 11.9998 48.9982 QPointF(0.209484,0.855181) QPointF(0.209484,0.855149) QPointF(0.209436,0.855149)
2023-12-03 8:55:28.457 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69906/45014.png"
2023-12-03 8:55:28.457 [debug] cached url
2023-12-03 8:55:28.457 [debug] 12.0026 48.9982 QPointF(0.209532,0.855181) QPointF(0.209532,0.855149) 
```QPointF(0.209484,0.855149)

@wthaem
Copy link
Contributor

wthaem commented Dec 3, 2023

Sorry, some of my logfile test output made it into the installer!

Examples:

2023-12-03 8:55:28.440 [debug] 12.0026 49 QPointF(0.209532,0.855212) QPointF(0.209532,0.855181) QPointF(0.209484,0.855181)
2023-12-03 8:55:28.440 [debug] URL4draw: "https://c.tile.openstreetmap.org/17/69903/45014.png"
2023-12-03 8:55:28.455 [debug] cached url

I'll remove this additional output from the logfile and build a new installer!

Sorry again for this.

@Phobooky
Copy link
Author

Phobooky commented Dec 3, 2023

@wthaem No problem. We are here to help.

@kiozen
Copy link
Collaborator

kiozen commented Dec 4, 2023

In the logs there is one line that startles me: " Failed to create projection: " +type=crs"". " +type=crs" is no valid projection string. It's probably just a part of one.

I can't tell if that is the reason. At least i can not imagine how that should delay something. But you should get rid of that. Might be a bit of a search.

Updating the map list simply parses the given paths for known map file extensions and adds a list item. By that the file is opened, read and a MD5 hash is created from the content to identify the map. This is all secured by a mutex, therefore only one view at a time can do that. Usually this operation should be fast. If something delays the file I/O serializing the access for all views will add up to a delay that can be seen by the user.

But as said reading up to 16k form a file shouldn't be a problem on a modern OS.

@Phobooky
Copy link
Author

Phobooky commented Dec 4, 2023

Thanks. I'll try to investigate a little more to see if we can locate the problem.

@Phobooky
Copy link
Author

Phobooky commented Dec 4, 2023

The first test I have done is to use exactly the same configuration, but with 1.16.1 and the surprise is that with that version it works correctly. That's why I think it's a problem with 1.17.
The process takes 0.015 s and the failed process in 1.17 takes 0,450 s
Could this error be the cause of the delay?
0,450 s x 10 views = 4,5 s.

What do you think?

2023-12-04 17:03:15.041 [debug] ------------------------------
2023-12-04 17:03:15.041 [debug] TMS: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/OpenStreetMap.tms"
2023-12-04 17:03:15.041 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-04 17:03:15.041 [debug] tms: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-04 17:03:15.056 [debug] ------------------------------

@wthaem
Copy link
Contributor

wthaem commented Dec 4, 2023

@kiozen: Can the failing projection be caused by some missing or wrong proj files and therefore be caused by my Windows installer? If so, where to look for the missing files? On my machine, the 1.16 and the 1.17 file sets are equal with the exception of libz/zlib DLLs (MSYS==>MSYS2 change) and of course with the exception of the timestamps).

I tested the 1.17 version with a few TMS based OSM and other maps and didn't see any projection issues in the logfile. Loading of the tiles was from time to time rather slow, but this was certainly caused by a slow map server. Remark: I didn't change the projection used in the map window.

@mitxel-m
Copy link
Contributor

mitxel-m commented Dec 4, 2023

Hi @Phobooky
Thanks for your last tests and pasting the debug info.

It seems to me that the delay occurs in that line that surprises kiozen and that we don't know where it comes from.
Looking at your log it seems that the delay occurs when the TMS map is activated for the first time. This also happens when you do "reload maps" , but not when you are moving the map. If there are many maps x many views then the delay begins to be noticeable at starting QMS, or doing reload maps.

@Phobooky
To clarify, when you say bad performance, it would be fine to be more explicit:
How many seconds of delay for the total of those 9 views with a single TMS map?

Also, to limit where to look, can you do these tests please?

Test 1

  • Activate only Cabrera_mbtiles in all views. ( this a map for Cabrera island, near Mallorca)
  • Is there any delay when reloading maps?
  • Please copy paste the debug info please.

Test 2

  • Activate only the map called "World" in all views (this is an overall map, it will only be visible at a zoom scale for the whole Africa).
  • Is there any delay when reloading maps?
  • Please copy paste the debug info please.

This will help us to know if we limit the problem to TMS maps.
I've done the test on my VM, but I think it's a good idea to do it on yours to be sure.

@Phobooky
Copy link
Author

Phobooky commented Dec 5, 2023

I agree with you on diagnosing the problem and when it occurs.
When I talk about bad performance, it is when the application response is in the order of 5-6 seconds. Good performance is when the response is practically instantaneous. That is, as an answer to the question of "How many seconds of delay for the total of those 9 views with a single TMS map?", I can say that, about 5-6 seconds.

Regarding the tests, I have installed the zip that you provided me as you said and these are the results:

Summary: with your files it works correctly.

Test 1
Activate only Cabrera_mbtiles in all views. (this a map for Cabrera island, near Mallorca). Made.
Is there any delay when reloading maps? No
Please copy paste the debug info please.

2023-12-05 8:02:38.198 [debug] ------------------------------
2023-12-05 8:02:38.211 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:38.218 [debug] has overviews true
2023-12-05 8:02:38.227 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:38.227 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:38.227 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:39.952 [debug] ------------------------------
2023-12-05 8:02:39.952 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:39.963 [debug] has overviews true
2023-12-05 8:02:39.963 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:39.963 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:39.963 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:41.534 [debug] ------------------------------
2023-12-05 8:02:41.534 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:41.541 [debug] has overviews true
2023-12-05 8:02:41.541 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:41.541 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:41.541 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:43.042 [debug] ------------------------------
2023-12-05 8:02:43.042 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:43.057 [debug] has overviews true
2023-12-05 8:02:43.057 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:43.057 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:43.057 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:45.054 [debug] ------------------------------
2023-12-05 8:02:45.054 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:45.062 [debug] has overviews true
2023-12-05 8:02:45.070 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:45.070 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:45.070 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:46.864 [debug] ------------------------------
2023-12-05 8:02:46.864 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:46.864 [debug] has overviews true
2023-12-05 8:02:46.876 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:46.876 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:46.876 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:49.041 [debug] ------------------------------
2023-12-05 8:02:49.041 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:49.041 [debug] has overviews true
2023-12-05 8:02:49.041 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:49.041 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:49.041 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:51.071 [debug] ------------------------------
2023-12-05 8:02:51.071 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:51.076 [debug] has overviews true
2023-12-05 8:02:51.076 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:51.076 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:51.076 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)
2023-12-05 8:02:53.417 [debug] ------------------------------
2023-12-05 8:02:53.417 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:02:53.438 [debug] has overviews true
2023-12-05 8:02:53.443 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"
2023-12-05 8:02:53.443 [debug] FF QTransform(type=TxScale, 11=4.77731 12=0 13=0 21=0 22=-4.77731 23=0 31=313086 32=4.75499e+06 33=1)
2023-12-05 8:02:53.443 [debug] RR QTransform(type=TxScale, 11=0.209323 12=0 13=0 21=0 22=-0.209323 23=0 31=-65536 32=995328 33=1)

Test 2
Activate only the map called "World" in all views (this is an overall map, it will only be visible at a zoom scale for the whole Africa).
Is there any delay when reloading maps? No.
Please copy paste the debug info please.

2023-12-05 8:12:04.531 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.531 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.531 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.531 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.531 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.531 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.531 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.531 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.531 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.548 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.548 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.548 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.548 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.548 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.548 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.548 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.548 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.548 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.548 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.548 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.548 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.564 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.564 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.564 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.564 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.564 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.564 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.564 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.564 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.564 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.564 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.564 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.564 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.564 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.564 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.579 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.579 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.579 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.579 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.579 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.579 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.579 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.579 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.579 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.598 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.598 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.598 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.598 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.598 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.598 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.598 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.603 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.603 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.603 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.603 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.603 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.603 [debug] ignoring  "BRouterDownload"  (reason: no QMS cache)
2023-12-05 8:12:04.603 [debug] CMapGEMF: try to open  "W:/QMapShack/CARTO/Maps/WMTS-TMS/World.gemf"
2023-12-05 8:12:04.612 [debug] Create projection: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs" -> "EPSG:4326"
2023-12-05 8:12:04.612 [debug] CMapGEMF: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
2023-12-05 8:12:04.612 [debug] CMapGEMF: Read Source  0   "USGS National Map Satellite & Topo"
2023-12-05 8:12:04.612 [debug] CMapGEMF: Read  1 Ranges with  256  Tiles
2023-12-05 8:12:04.612 [debug] CMapGEMF: Found  1  ranges for zoomlevel  4
2023-12-05 8:12:04.612 [debug] ------------------------------
2023-12-05 8:12:04.612 [debug] VRT: try to open "W:/QMapShack/CARTO/Maps/WMTS-TMS/cabrera-mbtiles.vrt"
2023-12-05 8:12:04.620 [debug] has overviews true
2023-12-05 8:12:04.620 [debug] Create projection: "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]" -> "EPSG:4326"

As an example, I attach one of the files with which I have problems.

<TMS>
<Layer idx="0">
<Title>OpenStreetMap Mapnik</Title>
<MinZoomLevel>1</MinZoomLevel>
<MaxZoomLevel>19</MaxZoomLevel>
<ServerUrl>https://c.tile.openstreetmap.org/%1/%2/%3.png</ServerUrl>
</Layer>
<RawHeader>
<Value name="User-Agent">QMapShack</Value>
</RawHeader>
<Copyright>Map data: (c) OpenStreetMap contributors, ODbL | Rendering: (c) http://www.openstreetmap.org, CC-BY-SA</Copyright>
</TMS>```

@mitxel-m
Copy link
Contributor

mitxel-m commented Dec 5, 2023

@Phobooky :Thank you. This confirms the same result I got in my VM.

@wthaem I think there is not a problem with missing proj files, because these last two tests use the same CRS than a TMS and don't give any errors. That was the purpose of the test.

The only difference with QMS 1.16.1 for windows, or even with QMS 1.17.0 compiled for linux, may be that your latest build uses a newer version of GDAL(3.7.2) / Proj (9.3.0), and that may create some difference in how it processes a CRS. Maybe that's why this problem hasn't been triggered until using this latest version of GDAL/Proj. I'm not sure, this is a guess because gdal warns that using proj strings to encode a CRS is no longer recommended.
See warning

PROJ strings to encode CRS should be considered as a a legacy solution. Using a AUTHORITY:CODE or WKT representation is the recommended way.

I checked the code and CMapTMS.cpp uses a proj string. As a first step we can try to replace it with EPSG code. I'm not sure if this will solve the problem because CMapGEMF.cpp for GEMF also contains the same string and doesn't fail, but since proj recommends to replace them it's a starting point that wouldn't hurt.

I can search if there are more such strings and replace them with EPSG code, and do a PR.
Then it would be necessary to recompile for win to test it

@kiozen , @wthaem what do you think?

@kiozen
Copy link
Collaborator

kiozen commented Dec 5, 2023

I still do not see why this adds delays, but we should give it a try. I would expect PROJ to fail or work. Parsing these strings is no witch craft. But EPSG code are a much more sane way to handle projections.

Btw the warning is from the QMS code:

qWarning() << "Failed to create projection:" << _strProjSrc << "->" << _strProjTar;

Therefore _strProjSrc is " +type=crs" and that is obviously no correct projection. This happens when a source projection is an empty string. The " +type=crs" is appended if it is missing. As there is nothing else the projection string must be empty aka no projection has been found.

@wthaem
Copy link
Contributor

wthaem commented Dec 5, 2023

@mitxel-m:

I think there is not a problem with missing proj files.

That makes me feel better.

Then it would be necessary to recompile for win to test it

Can do it, if necessary.

@Phobooky
Copy link
Author

Phobooky commented Dec 7, 2023

As I wrote in (#649) the problem has been solved.
Thank you very much!

@kiozen
Copy link
Collaborator

kiozen commented Dec 7, 2023

Nice. Thanks everyone for the patience and all the brilliant work! I will close this ticket and we proceed with #649.

@kiozen kiozen closed this as completed Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants