5

What I have:

  1. QGIS 3.18 on Win 10 containing a project with:

    • OpenStreetMap basemap
    • Point layer (Geopackage, 5.1 MB), representing centroids of buildings of a city
    • Point layer set to scale based visibility (only visible when zoomed in for more than 1:5000, corresponds to canvas extent of ca. 1km*1km and smaller) - so normally, just a few hundred (at max. ca. 1400) points are visible due to small canvas extent.
  2. Point layer consists of:

    • 54.000 features, extent ca. 12*12 km
    • Attributes contain two fields: fid and an additional integer field

What I want to do:

I want to make the project available as WebMap with qgis2web plugin, ver. 3.16. This works fine for other projects.

What the problem is:

The exported map loads extremely slow and the browser becomes unresponsive. The same is true for the plugin's preview. I get the warning:

A large number of features are present in the map. Generating the preview may take some time.

I guess this is because it tries to load all 54.000 point features, even if only a small section of the whole extent is inside the current canvas extent. Scale based visibility apparently can't be converted by qgis2web plugin.

What I tried: Changing the precision setting in the plugin, but with no success. I also looked to the other settings of the plugin (check the cluster checkbox for the point layer), but they don't resolve the problem.

I also tried splitting up the layer to several small layers, based on a grid. The problem persists. I guess that Leaflet/the Web site still tries to load all layers in the current canvas extent - so the site gets blocked before you even get the chance to zoom in.

The question:

How can this problem be solved so that I have a WebMap with OSM basemap + the point layer, loading in reasonable time (few seconds at max.)

Screenshots:

enter image description here

enter image description here

enter image description here

11
  • Your dataset is simply too large to be running smoothly. Setting scale limits won't help, because the whole dataset is loaded to the browser in any case. Unless you are able to reduce the size of the file (remove unnecessary features, minify GeoJSON in the settings and reduce precision as you've already done) I would say that you should look into other options in building an interactive map. One option is to serve your data via a server (e.g. WMS layer) or another could be to check out for example the Unfolded Studio plugin: github.com/UnfoldedInc/qgis-plugin
    – tjukanov
    Commented May 14, 2021 at 11:58
  • Test with 3.16 windows 10 / 65000 points: loading firefox (offline) in 9 seconds
    – juko
    Commented May 14, 2021 at 17:47
  • Please show your adjustments per screenshots within qgis2web.
    – juko
    Commented May 14, 2021 at 17:51
  • I must now cooking....I try to answer later. Excuse me please.
    – juko
    Commented May 14, 2021 at 18:04
  • 1
    Many points with labels are not possible. Test with 7500 points: Labels with cluster are possible/labels without cluster are not possible. Test with 26.000 points: Labels with cluster are possible, but a little bit to slow for users/without cluster is not possible. My result: Do not use labels. It is normal for users to click to get informations. Maybe you have the possibilty to categorize your building-points, so you get different colors or different svg-symbols for users within the legend - so the users have a preselection for their search.
    – juko
    Commented May 15, 2021 at 10:22

2 Answers 2

2

Your dataset is simply too large to be running smoothly. Setting scale limits won't help, because the whole dataset is loaded to the browser in any case. Unless you are able to reduce the size of the file (remove unnecessary features, minify GeoJSON in the settings and reduce precision as you've already done) I would say that you should look into other options in building an interactive map. One option is to serve your data via a server (e.g. WMS layer) or another could be to check out for example the Unfolded Studio plugin: github.com/UnfoldedInc/qgis-plugin

9
  • Thanks! That's what I suspected, unfotunately. The point is that I can't further reduce features or attributes without compromising the very idea of the project. So at least it's good to know that there is no mistake I did and no simple solution and I should head towards another solution.
    – Babel
    Commented May 14, 2021 at 12:11
  • By the way: can you estimate what would be an ideal size for the layer - ideal meaning: as big as possible, as small that the browser can still handle it. I'm just thinking of breaking up my points to several layers (maybe based on a grid) as a workaround.
    – Babel
    Commented May 14, 2021 at 12:15
  • 1
    Depends on many things: device you use to view the data and the bandwidth you have. However as a rule of thumb I'd say that loading >10 mb to your Leaflet/OpenLayers map at a time starts to make things run slow.
    – tjukanov
    Commented May 14, 2021 at 12:18
  • OK, I see. I will give it a try. Making it accessible online means you don't know who is accessing it under what circumstances (device, bandwidth...). For my own purpose, I installed QField, there the projects works fine and even offline - so that might be another option, but than everyone using it has to install QField. I see that the ideal solution would be using a WMS respectively WCS.
    – Babel
    Commented May 14, 2021 at 12:30
  • 1
    @bugmenot123 unfolded is a SaaS by default, so self-hosting that is not really an option (unlike with kepler, but then you'd have to work out the QGIS-kepler pipeline yourself :))
    – tjukanov
    Commented May 17, 2021 at 8:24
1

Many points with labels are not possible. Test with 7500 points: Labels with cluster are possible/labels without cluster are not possible. Test with 26.000 points: Labels with cluster are possible, but a little bit to slow for users/without cluster is not possible. My result: Do not use labels. It is normal for users to click to get informations. Maybe you have the possibilty to categorize your building-points, so you get different colors or different svg-symbols for users within the legend - so the users have a preselection for their search.

1
  • Thanks, I tried this. Unfortunately, it is still way too slow to be used productively. So I guess that qgis2web is not really useful for such an amount of data.
    – Babel
    Commented May 15, 2021 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.