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

Augment country mask quality and bypass complex boundaries #1132

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

Conversation

ericboucher
Copy link
Collaborator

Description

This fixes two issues we were seeing with the mask feature of the print module.

  1. For smaller countries, the mask was not very precise. This PRs augments the details and quality of the outline boundary.
  2. certain complex geometries/boundaries would result in weird triangular shapes appearing over the mask. For those countries, we pull simpler outlines directly. I used https://cartographyvectors.com/. Affected countries are:
    'cambodia'
    'ecuador'
    'indonesia'
    'mozambique'
    'myanmar'
    'sierraleone'

How to test the feature:

  • [ ]
  • [ ]

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:

Copy link

github-actions bot commented Feb 23, 2024

Build succeeded and deployed at https://prism-1132.surge.sh
(hash 5f420da deployed at 2024-03-01T00:47:13)

@wadhwamatic
Copy link
Member

@ericboucher - we can get admin0 files and add them during the config process going forward. Generally, the most reliable source is HDX, ideally datasets tagged with 'COD'. The format is usually going to be a shapefile.

https://data.humdata.org/dataset/?cod_level=cod-standard&cod_level=cod-enhanced&ext_administrative_divisions=1&q=&sort=last_modified%20desc&ext_page_size=25

I'll add Mozambique to this PR and revisit others soon.

@wadhwamatic
Copy link
Member

wadhwamatic commented Feb 28, 2024

Hmmm. When I added an admin0 boundary for Mozambique using the HDX data, the stripe returns.
Screenshot 2024-02-28 at 14 55 59

The issue with using the boundary you included @ericboucher is that they are not fully aligned with the other admin boundaries, and since this is for a print feature, fidelity matters. We shouldn't see boundaries like this:
Screenshot 2024-02-28 at 15 01 49

@wadhwamatic
Copy link
Member

@ericboucher - the last moz boundary file I tried seems to work well. File size went up, but it's still under 2mb.

Here's what I did in QGIS:

  1. Dissolve admin1 layers
  2. Delete holes (this gets rids of small bodies of water)
  3. Multipart to single part. This seems to connect strays
  4. Delete unused features
  5. Export geojson w/ precision 6

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.

2 participants