Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BLSQ/geohealthaccess
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.0
Choose a base ref
...
head repository: BLSQ/geohealthaccess
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Aug 4, 2021

  1. fixed raster display bug, added basic citations

    Alex Kaldjian committed Aug 4, 2021
    Copy the full SHA
    41a418f View commit details

Commits on Aug 17, 2021

  1. updates to styling

    Alex Kaldjian committed Aug 17, 2021
    Copy the full SHA
    7c8b9e5 View commit details
  2. unignored credentials

    Alex Kaldjian committed Aug 17, 2021
    Copy the full SHA
    6771a9e View commit details

Commits on Oct 13, 2021

  1. rewrote without plotly_express, added information modals, added absol…

    …ute w/out access view, UI changes
    kaldjian committed Oct 13, 2021
    Copy the full SHA
    cf7ef73 View commit details

Commits on Nov 3, 2021

  1. Upgrade dependencies

    yannforget committed Nov 3, 2021
    Copy the full SHA
    125a078 View commit details
  2. Upgrade conda

    yannforget committed Nov 3, 2021
    Copy the full SHA
    155fd55 View commit details

Commits on Nov 4, 2021

  1. Strip input paths

    yannforget committed Nov 4, 2021
    Copy the full SHA
    1600ea8 View commit details
  2. Strip input paths fix

    yannforget committed Nov 4, 2021
    Copy the full SHA
    5cbb11f View commit details
  3. Fix path stripping

    yannforget committed Nov 4, 2021
    Copy the full SHA
    db2df12 View commit details

Commits on Nov 9, 2021

  1. dark mode + some UI changes

    kaldjian committed Nov 9, 2021
    Copy the full SHA
    81795d6 View commit details
  2. Copy the full SHA
    44276b0 View commit details

Commits on Nov 10, 2021

  1. Copy the full SHA
    9e7b514 View commit details
  2. with vs without :)

    kaldjian committed Nov 10, 2021
    Copy the full SHA
    0f710c5 View commit details
  3. Copy the full SHA
    c8fade3 View commit details
  4. Copy the full SHA
    acea98f View commit details
  5. improved loading interface

    kaldjian committed Nov 10, 2021
    Copy the full SHA
    5ad4a20 View commit details
  6. a few more UI tweaks

    kaldjian committed Nov 10, 2021
    Copy the full SHA
    0231f1e View commit details

Commits on Nov 12, 2021

  1. Merge branch 'main' into viz

    # Conflicts:
    #	.gitignore
    #	viz/app.py
    #	viz/assets/style.css
    pvanliefland committed Nov 12, 2021
    Copy the full SHA
    14bc53d View commit details
  2. Copy the full SHA
    34f928f View commit details
  3. Use demo bucket

    pvanliefland committed Nov 12, 2021
    Copy the full SHA
    6756bc1 View commit details
  4. Copy the full SHA
    0fd0a73 View commit details
  5. Merge pull request #20 from BLSQ/viz

    Merge viz updates for blog
    pvanliefland authored Nov 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1a0dd3f View commit details
  6. Copy the full SHA
    68bceb3 View commit details
  7. Copy the full SHA
    9bd1951 View commit details

Commits on Nov 15, 2021

  1. update colormap for population raster

    Population raster is now part of the `geohealthaccess` project in qgis-server. Colormap is also updated.
    yannforget authored Nov 15, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    898de00 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ff589c0 View commit details
  3. Fix travel time threshold

    yannforget authored Nov 15, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    99f4626 View commit details
  4. Fix density plot

    yannforget authored Nov 15, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d641602 View commit details

Commits on Nov 16, 2021

  1. Copy the full SHA
    0425d47 View commit details

Commits on Dec 6, 2021

  1. Copy the full SHA
    4d2b20e View commit details
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -130,3 +130,4 @@ dmypy.json
notebooks/
notes/

/viz/*.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ RUN wget -O /usr/local/bin/minio \
RUN mkdir /app

# Install miniconda
ARG MINICONDA_VERSION="py38_4.9.2"
ARG MINICONDA_VERSION="py39_4.10.3"
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh \
&& mkdir -p /opt \
&& bash Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh -b -p /opt/conda \
28 changes: 14 additions & 14 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -5,25 +5,25 @@ channels:
- conda-forge

dependencies:
- python=3.8
- python=3.9
- pip=21
- gdal=3.1
- gdal=3.3
- appdirs=1.4
- beautifulsoup4=4.9
- click=7
- beautifulsoup4=4.10
- click=8.0
- fiona=1.8
- gcsfs=0.8
- geopandas=0.9
- gcsfs=2021.10
- geopandas=0.10
- loguru=0.5
- numpy=1.20
- pandas=1.2
- numpy=1.21
- pandas=1.3
- rasterio=1.2
- requests=2.25
- s3fs=0.6.0
- fsspec=0.9
- shapely=1.7
- tqdm=4.59
- rasterstats=0.14
- requests=2.26
- s3fs=2021.10
- fsspec=2021.10
- shapely=1.8
- tqdm=4.62
- rasterstats=0.16
- conda-build
- pytest=6.2
- pytest-cov
4 changes: 4 additions & 0 deletions geohealthaccess/cli.py
Original file line number Diff line number Diff line change
@@ -219,6 +219,7 @@ def access(

# update moving speeds if a custom file is provided
if moving_speeds:
moving_speeds = moving_speeds.strip()
with storage.open_(moving_speeds) as f:
gha.moving_speeds = json.load(f)

@@ -227,6 +228,7 @@ def access(
if areas:
# areas can be a local, s3 or gcs path
# and may be provided as a GeoJSON or GPKG
areas = areas.strip()
with TemporaryDirectory(prefix="geohealthaccess_") as tmp_dir:
areas_tmp = os.path.join(tmp_dir, os.path.basename(areas))
storage.cp(areas, areas_tmp)
@@ -261,6 +263,8 @@ def access(

for target_ in target:

target_ = target_.strip()

# load start_points as a geodataframe
with TemporaryDirectory(prefix="geohealthaccess_") as tmp_dir:
target_tmp = os.path.join(tmp_dir, os.path.basename(target_))
17 changes: 13 additions & 4 deletions geohealthaccess/geohealthaccess.py
Original file line number Diff line number Diff line change
@@ -46,10 +46,19 @@ def __init__(
logs_dir=None,
log_level="DEBUG",
):
self.raw_dir = raw_dir
self.input_dir = input_dir
self.output_dir = output_dir
self.logs_dir = logs_dir
self.raw_dir = None
self.input_dir = None
self.output_dir = None
self.logs_dir = None
if raw_dir:
self.raw_dir = raw_dir.strip()
if input_dir:
self.input_dir = input_dir.strip()
if output_dir:
self.output_dir = output_dir.strip()
if logs_dir:
self.logs_dir = logs_dir.strip()

self.log_level = log_level

if len(country) == 3:
24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -16,22 +16,22 @@ keywords = [
]

[tool.poetry.dependencies]
python = ">=3.7"
python = "^3.9.0"
appdirs = "^1.4.0"
beautifulsoup4 = "^4.9.0"
click = "^7.1.0"
beautifulsoup4 = "^4.10.0"
click = "^8.0.0"
fiona = "^1.8.0"
gcsfs = "^0.8.0"
geopandas = "^0.9.0"
gcsfs = "^2021.10.0"
geopandas = "^0.10.0"
loguru = "^0.5.0"
numpy = "^1.20.0"
pandas = "^1.2.0"
numpy = "^1.21.0"
pandas = "^1.3.0"
rasterio = "^1.2.0"
requests = "^2.24.0"
s3fs = "^0.6.0"
shapely = "^1.7.0"
tqdm = "^4.59.0"
rasterstats = "^0.14.0"
requests = "^2.26.0"
s3fs = "^2021.10.0"
shapely = "^1.8.0"
tqdm = "^4.62.0"
rasterstats = "^0.16.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.0"
4 changes: 3 additions & 1 deletion viz/Dockerfile
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
# - AWS_SECRET_ACCESS_KEY
# - STANDALONE=yes

FROM python:3
FROM python:3.9.6

RUN apt-get update
RUN apt-get install -y libgeos-dev libgdal-dev
@@ -17,3 +17,5 @@ COPY assets /code/assets

EXPOSE 8000
CMD python /code/app.py

WORKDIR /code
659 changes: 487 additions & 172 deletions viz/app.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions viz/assets/density.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This graphic shows the cumulative proportion of people in a health zone with access to care under increasing travel times. To change the health zone displayed, simply move the mouse to hover over another part of the map. (Note: this view is only available when 'Access estimates by health zone' is selected)
Such a cross-cutting view of travel times allows a better understanding of the question of access in a given area. Steep increases in the proportion with access might point to acute issues with stockouts of medication or lack of personnel, while a flatter curve may indicate an area that is chronically underserved.
Binary file added viz/assets/favicon.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions viz/assets/how_to_display.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
When the access estimates by health zone option is selected, it is possible to display the data in three different ways :
Percent of population with access in each zone : this is a good way to identify health districts with the lowest level of accessibility of health services.
Percent of population with access with zone population: this is a good way to identify most populous health districts and check the level of access to care.
Number of people without access to care : this is the best way to identify where people don’t have access to care and how many people are affected.
5 changes: 5 additions & 0 deletions viz/assets/landing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This visualization is designed to help understand the accessibility of malaria services in the DRC. It displays the results of a model that esimates the time it takes patients to reach a health facility where they can recieve basic malaria treatment, for each month of the years 2020 and 2021.The model takes different types of information into account:
Where patients are located, based on
Where health facilities are located, and what resources and services are available at each facility based on data from DRC's National Health Information System.
The physical environment that impacts travel (road networks, land cover, elevation, etc.) based on a mix of openly-available data sources.
More information on the modeling and the data used as well as the full source code can be found on
3 changes: 3 additions & 0 deletions viz/assets/lorem.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras laoreet ligula vel est fermentum efficitur. Maecenas a elementum orci, rutrum interdum magna. Fusce lobortis lectus id maximus tempor. Quisque nec porttitor ex. Vestibulum sit amet tortor vestibulum, hendrerit ipsum at, fringilla massa. Maecenas vitae est a quam fermentum laoreet ut vitae lectus. Donec ultrices semper elementum.
Mauris rutrum convallis lacus eget eleifend. Sed fringilla viverra est, nec dignissim nisi. Integer sed iaculis diam. Ut pharetra mauris vitae ligula maximus efficitur. Curabitur congue ante sit amet massa consequat egestas. Nam nec eros non turpis imperdiet blandit. Nam at massa posuere libero semper finibus. Curabitur non vulputate nisi. Praesent non lacinia dolor. Ut elementum, mi non finibus ultricies, ante nibh lobortis tortor, vel mattis elit eros quis leo.
Maecenas placerat urna non faucibus vehicula. Aenean interdum tortor ut tristique blandit. Ut sit amet metus pulvinar, dictum dui nec, egestas tellus. Proin aliquet, arcu eu sollicitudin dignissim, lorem eros pharetra dolor, nec aliquam sem nulla nec turpis. Quisque cursus enim porta lacus commodo, at lobortis sapien interdum. Nam lobortis neque ac eros pulvinar, nec ornare nisi egestas. Proin a maximus dolor. Aenean sit amet pulvinar felis. Nullam finibus risus in diam ultrices tincidunt.
155 changes: 128 additions & 27 deletions viz/assets/style.css
Original file line number Diff line number Diff line change
@@ -5,26 +5,6 @@ body {
overflow: hidden;
}

.rc-slider-mark-text {
transform: rotate(-45deg);

/* Legacy vendor prefixes that you probably don't need... */

/* Safari */
-webkit-transform: rotate(-45deg);

/* Firefox */
-moz-transform: rotate(-45deg);

/* IE */
-ms-transform: rotate(-45deg);

/* Opera */
-o-transform: rotate(-45deg);

/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
}

#app-main {
width: 100%;
@@ -33,23 +13,52 @@ body {
padding: none;
}

#map-main {
margin-left: 1%;

#map-container {
margin-left: 0.3%;
height: 100%;
width: 78.5%;
width: 79%;
display: inline-block;
position: absolute;
}

/* loading GIF + grey transparency */
.loader-wrapper {
height: inherit;
}

.loader-wrapper > div {
visibility: visible !important;
height: inherit;
}

.loader-wrapper > div > div {
background: rgba(0, 0, 0, 0.5);
}

#map-main {
height: 100%;
width: 100%;
}


/* controls UI */
#sidebar {
width: 20%;
width: 22%;
border-radius: 5px;
margin-top: 0.8%;
padding: 6px;
margin-top: 0.2%;
margin-left: 0.25%;
padding: 4px;
padding-top: none;
display: inline-block;
}

#title-container {
font-size: 1.2vw !important;
color: #2065ab;
/* font-weight: bold; */
}

#ctrls-container {
background-color: white;
padding: inherit;
@@ -58,20 +67,112 @@ body {

#ctrls-container > div {
padding: inherit;
font-size: 0.95vw;
}

div > label {
display: block;
font-size: 0.8vw;
}

#month {
margin-top: 10px;
margin-bottom: -25px;
}

#slider-output-container {
line-height: 34px;
border: 1px solid #ccc;
border-radius: 4px;
padding-left: 10px
}

.rc-slider-handle {
border-color: #007aff;
}

.rc-slider-handle:hover {
border-color: #007aff;
}

.rc-slider-handle-active:active {
border-color: #007aff;
}

.rc-slider-handle-click-focused:focus {
border-color: #007aff;
}

.rc-slider-handle-click-focused {
border-color: #007aff;
}


#density-container {
margin-top: 4%;
margin-top: 3%;
padding: inherit;
border-radius: 5px;
background-color: white;
}

#density-title-container {
display: flex;
padding: 1.5%;
font-size: 0.9vw
}


#density-title {
width: 90%;
}

#sources{
padding: inherit;
font-size: 10px;
}

.info-button {
color: white;
background-color: #a6a6a6;
border: 2px solid white;
border-radius: 25%;
width: 20px;
font-size: 14px;
font-weight: bold;
margin-left: 5px;
}

.info-button:hover {
filter: brightness(110%);
}


/* modal styling */

.modal {
position: fixed;
z-index: 1002; /* Sit on top, including modebar which has z=1001 */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
background-color: rgba(0, 0, 0, 0.6); /* Black w/ opacity */

}

.modal-content {
margin: 15%;
margin-top: 5%;
padding: 30px;
background-color: white;
text-align: center;
border-radius: 4px;
}

#modal-title, .modal-content > div > h2 {
color: #2065ab;
}

#modal-text {
text-align: left;
}
9 changes: 9 additions & 0 deletions viz/assets/what_to_display.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Depending on what you want to understand, you can look at the data in different ways.
Month: you can select the month for which you want to look at the accessibility of services.
Travel time: you can choose how fast you think patients should be able to access services.
Province: you can subset the access estimates to a specific province of the country.
What to display: to inform your analysis, you can look either at
Estimates of accessibility aggregated to the health zone level, such as the percentage of a zone’s population that lives under a given travel time from health services.
A high resolution display of the travel times to health facilities. This may help you checking the quality of these estimations, find places with specially low access to health care or analyse the main barriers to access.
A high resolution display of where populations live. This may help you see which places should be prioritised to reach the highest number of people.
To reset the map to its default zoom level, simply double click on the map.