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

Support pmtile based admin layers; COUNTRY=global #1417

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

gislawill
Copy link
Collaborator

@gislawill gislawill commented Jan 23, 2025

Description

This addresses #1404 by adding support PMTiles (vector tiles) for admin boundaries. This branch does not yet support running analysis (zonal stats) on these PMTiles. We will add support in a following PR that involves querying a S3-hosted geoparquet.

How to test the feature:

  • Open the surge deployment
  • Pan and scroll around loading the tiles
  • Try to find admin-level based functionality that I missed

Checklist - did you ...

Test your changes with

  • REACT_APP_COUNTRY=rbd yarn start
  • REACT_APP_COUNTRY=cambodia yarn start
  • REACT_APP_COUNTRY=mozambique yarn start
  • Add / update necessary tests?
  • Add / update outdated documentation?

Screenshot/video of feature:

https://www.loom.com/share/a7c80f04dbbb43a5b4cd68334886d088?sid=cda64d68-f6b3-4307-8b9e-3bf827a3faac

Copy link

github-actions bot commented Jan 23, 2025

Build succeeded and deployed at https://prism-1417.surge.sh
(hash 958a248 deployed at 2025-02-05T03:57:52)

@gislawill gislawill changed the title Draft: Support pmtile based admin layers; COUNTRY=global Support pmtile based admin layers; COUNTRY=global Jan 24, 2025
@gislawill gislawill linked an issue Feb 5, 2025 that may be closed by this pull request
@gislawill gislawill marked this pull request as ready for review February 5, 2025 03:38
@gislawill
Copy link
Collaborator Author

Heads up @ericboucher and @wadhwamatic, this is ready for review. I believe all features but the Analysis Layers are functional.

I did run into some performance issues with the loadBoundaryRelations functionality that is required for the Alerts module. We've have over 20000 admin level 2 regions in the dataset and that much data caused a slowdown in start up time. Are any deployments still using the alerts module??

Comment on lines +145 to +149
<Source
id={`source-${layer.id}`}
type="vector"
url={`pmtiles://${layer.path}`}
>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we might get some performance benefits by rendering one source per PMTiles even when we're pulling multiple layers from the same file.

@wadhwamatic
Copy link
Member

Are any deployments still using the alerts module??

@gislawill great! Look forward to digging into this later. No, there are no active deployments that are using alerts. But it's a feature that we need functioning in the next month for upcoming deployments.

@gislawill
Copy link
Collaborator Author

@wadhwamatic sounds good. @ericboucher it'd be helpful to get your thoughts on loadBoundaryRelations (in frontend/src/components/Common/BoundaryDropdown/utils.ts) and if there's any way it could be simplified while still supporting alerts. That function alone is taking about 22 seconds to run on my computer 😅

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

Successfully merging this pull request may close these issues.

[Feature Request]: make use of pmtiles for admin boundaries
2 participants