MaskMyPy: python tools for performing and analyzing geographic masks
- PMID: 40346675
- PMCID: PMC12065331
- DOI: 10.1186/s12942-025-00399-6
MaskMyPy: python tools for performing and analyzing geographic masks
Abstract
Background: Geographic masking is an important but under-utilized technique for protecting and disseminating sensitive geospatial health data. Geographic masks work by displacing static point locations such that the people those locations describe cannot be identified, while at the same time preserving important spatial patterns for analysis. Unfortunately, there is a lack of available tooling surrounding geographic masks which we believe creates an unnecessary barrier towards the adoption of these techniques. As such, this article presents a set of tools for performing, evaluating, and developing geographic masks, called MaskMyPy.
Results: MaskMyPy is an open-source Python package that includes functions for performing geographic masks, including donut, street, location swapping, and Voronoi masks. It also includes a range of tools for evaluating the results of these masks, both with regard to privacy and information loss. Finally, it includes a special class called the 'Atlas' that aims to dramatically streamline mask execution and evaluation. We conducted a short case study to illustrate the power of MaskMyPy in geographic masking research, and in doing so showed that mask performance can range widely due solely to randomization. As such, we recommend that masking researchers test their masks repeatedly across a variety of test datasets.
Conclusion: MaskMyPy makes it easy to apply a variety of geographic masks to a set of sensitive points and then measure which mask provided the most privacy while suffering the least information loss. We believe this style of tooling is important to not only make geographic masks accessible to non-experts, but to enable expert users to better interrogate the masks they develop, and in doing so drive the geographic masking discipline forward.
Keywords: Anonymization; Geographic masking; Geomasking; Geoprivacy; Privacy; Python; Tools.
© 2025. The Author(s).
Conflict of interest statement
Declarations. Ethics approval and consent to participate: Not applicable. Consent for publication: Not applicable. Competing interests: The authors declare no competing interests.
Figures
References
-
- Kounadi O, Leitner M. Why does geoprivacy matter? The scientific publication of confidential data presented on maps. J Empir Res Hum Res Ethics. 2014;9:34–45. 10.1177/1556264614544103. - PubMed
-
- Armstrong MP, Rushton G, Zimmerman DL. Geographically masking health data to preserve confidentiality. Stat Med. 1999;18:497–525. - PubMed
-
- Kounadi O, Leitner M. Adaptive areal elimination (AAE): a transparent way of disclosing protected spatial datasets. Comput Environ Urban Syst. 2016;57:59–67.
Publication types
MeSH terms
LinkOut - more resources
Full Text Sources
Research Materials
