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

MVT questions and improvements #25

Open
nesnoj opened this issue Oct 22, 2024 · 6 comments
Open

MVT questions and improvements #25

nesnoj opened this issue Oct 22, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@nesnoj
Copy link
Member

nesnoj commented Oct 22, 2024

In epp-app I increased the zoom range to 8-15 by setting

MAP_ENGINE_MIN_ZOOM = 8
MAP_ENGINE_MAX_ZOOM = 16

(btw, MAP_ENGINE_MAX_ZOOM always needs to be desired zoom level+1 which could be fixed..)

Now tiles are loaded for the former zoom range (8-12), in levels >12 no data is shown at all.
(1) Is it possible to use the tiles from zoom 12 for 13-15 as well?

So I distilled the entire range by setting MAP_ENGINE_MAX_DISTILLED_ZOOM = 15 but this takes ages. I just used --parallel-render [number of threads] for parallelization but unfortunately this does not seem to speed up the process. My testing conditions: [threads: 1/4/12, duration: 5 min, indicator: number of created files, total size].
(2) Any idea why this does not work? Have you used django-distill parallelization?

The file size increases vastly with increasing zoom level, even in 13 one tile amounts up to some MB.
(3) Is there a way to define simplification/generalization thresholds for the geoms to reduce the size?

@nesnoj nesnoj added the question Further information is requested label Oct 22, 2024
@nesnoj
Copy link
Member Author

nesnoj commented Nov 5, 2024

@henhuy I tested this again with distilled MVTs for zoom levels 8-13.
Up to level 13 it works fine:

image

At level 14 the forests aint not rendered at all:

image

The gpkg size of pv_ground_criteria_forest.gpkg is around 4 MB in total.

My settings:

MAP_ENGINE_CENTER_AT_STARTUP = [14.2, 52.45]
MAP_ENGINE_ZOOM_AT_STARTUP = 8
MAP_ENGINE_MIN_ZOOM = 8
MAP_ENGINE_MAX_ZOOM = 16
MAP_ENGINE_MAX_BOUNDS = [[12.6, 51.8], [16.1, 53.1]]

# distill
MAP_ENGINE_X_AT_MIN_Z = 137
MAP_ENGINE_Y_AT_MIN_Z = 83
MAP_ENGINE_X_OFFSET = 1  # Defines how many tiles to the right are added at first level
MAP_ENGINE_Y_OFFSET = 1  # Defines how many tiles to the bottom are added at first level
MAP_ENGINE_MAX_DISTILLED_ZOOM = 13

I keep it in this issue as I think it is a general mapengine problem.

@nesnoj
Copy link
Member Author

nesnoj commented Nov 22, 2024

For the logs:

The high level zoom problem has been solved in 21d98df 👍 .
Also, now it is possible to use MVTs at higher zoom levels (e.g. 16) which has been distilled in lower levels (e.g. up to 13) by increasing MAP_ENGINE_MAX_DISTILLED_ZOOM to desired level (e.g. 16) after distilling. Drawback: When scrolling around at high zoom levels new layer data will not be loaded. It's necessary to zoom out at least to last rendered level (in this example 13) before to make it load for other parts.
Hence, distilling should be done up to the level which is used.

@nesnoj
Copy link
Member Author

nesnoj commented Nov 22, 2024

Another bug for the logs: Data is broken for layers with too many (2^16) vertices due to maplibre limitations:

image

image

The only solution is to simplify geometries.

@henhuy
Copy link
Contributor

henhuy commented Nov 22, 2024

looks crazy 👀 - what layer is causing this artifacts?

@nesnoj
Copy link
Member Author

nesnoj commented Nov 22, 2024

looks crazy 👀 - what layer is causing this artifacts?

pv_ground_criteria_merged.gpkg which has a lot of vertices, it is the merge of all PV neg. criteria. It took me some time to find a working values for min size of features and simplification tolerance.

@nesnoj
Copy link
Member Author

nesnoj commented Nov 26, 2024

Backlog:
This PR fixed distilling speed and tile size: empowerplan/epp-app#173
Distilling up to zoom 16 took 7 h on new WAM02, total tile size is only 2,4 GB.
🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants