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

Update physical exposure and social fabric maps #41

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 20 additions & 33 deletions .github/workflows/build_check_links.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check for dead links on github pages
name: Check for dead links on GitHub Pages

on:
pull_request:
Expand All @@ -9,40 +9,27 @@ jobs:
name: Check for broken links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
ruby-version: 2.6
bundler-cache: true

- run: |
cd docs
bundle install
jekyll build
source: ./docs
destination: ./docs/_site

- name: Link Checker
uses: lycheeverse/[email protected]
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: ./docs/_site/* -b https://opendrr.github.io --exclude https://opendrr.github.io/assets/fontawesome/css/all.min.css

- name: Add comment if broken links
if: ${{ github.event_name == 'pull_request' && hashFiles('./lychee/out.md') != '' }}
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Broken links found, please check actions log.'
})
args: --verbose --no-progress --exclude '^https://www\.canada\.ca/' --fallback-extensions html 'docs/_site/**/*.html'
fail: false

- name: Display broken links and exit
if: hashFiles('./lychee/out.md') != ''
run: |
less ./lychee/out.md
exit 1

- name: Create Issue From File
if: steps.lychee.outputs.exit_code >= 2
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Physical Exposure Layer component of the National Human Settlement Layer (NH
The Social Vulnerability component of the National Human Settlement Layer (NHSL) includes information about broad spatial patterns of social vulnerability at the neighbourhood scale, and indicators about the capacities for a community to withstand and recover from disaster events based on intrinsic characteristics of housing, family structure, individual autonomy and financial agency.
These datasets have been developed to provide information about physical exposure and social vulnerability across Canada that can be used for quantitative risk assessment of natural hazards. The purpose is to support implementation of the Sendai Framework for Disaster Risk Reduction at the local, regional, and national scales. The information is not intended for use in site-specific studies.

https://opendrr.github.io/national-human-settlement/en
https://opendrr.github.io/national-human-settlement/en/

## Getting Started

Expand Down Expand Up @@ -52,7 +52,7 @@ L’élément Exposition physique de la couche ZPN délimite les régions habit
L’élément Vulnérabilité sociale de la couche ZPN comprend des renseignements sur les grandes tendances spatiales en matière de vulnérabilité sociale à l’échelle du quartier, ainsi que des indicateurs sur la capacité d’une collectivité à résister aux catastrophes, et à s’en rétablir, en fonction des caractéristiques intrinsèques du logement, de la structure familiale, de l’autonomie individuelle et des systèmes financiers.
Ces ensembles de données ont été élaborés pour fournir des renseignements sur l’exposition physique et la vulnérabilité sociale à travers le Canada qui peuvent être utilisés pour l’évaluation quantitative des risques naturels. L’objectif de ces ensembles de données consiste à appuyer la mise en œuvre du Cadre de Sendai pour la réduction des risques de catastrophe à l’échelle locale, régionale et nationale. L’information n’est pas destinée à être utilisée dans le cadre d’études propres à des sites.

https://opendrr.github.io/national-human-settlement/fr
https://opendrr.github.io/national-human-settlement/fr/

## Démarrage

Expand Down
8 changes: 5 additions & 3 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ exclude:
- SECURITY.md
- CNAME
- "*.tmp"
- api-publique.md
- docker-compose.yml
- Gemfile
- Gemfile.lock
- gcweb-jekyll.gemspec
Expand Down Expand Up @@ -196,13 +198,13 @@ defaults:
fr: Applications mobiles
tmpl-menu-footer-communications-mobile-link:
en: https://www.canada.ca/en/mobile.html
fr: ttps://www.canada.ca/fr/mobile.html
fr: https://www.canada.ca/fr/mobile.html
tmpl-menu-footer-communications-about-text:
en: About Canada.ca
fr: À propos de Canada.ca
tmpl-menu-footer-communications-about-link:
en: https://www1.canada.ca/en/newsite.html
fr: https://www1.canada.ca/fr/nouveausite.html
en: https://www.canada.ca/en/government/about.html
fr: https://www.canada.ca/fr/gouvernement/a-propos.html
tmpl-menu-footer-communications-terms-text:
en: Terms and conditions
fr: Avis
Expand Down
4 changes: 2 additions & 2 deletions docs/_includes/footers/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ <h2 class="wb-inv">{{ i18nText-footerSite }}</h2>
{%- if i18nText-lang == "fr" -%}
<li><a href="https://www.canada.ca/fr/sociaux.html">Médias sociaux</a></li>
<li><a href="https://www.canada.ca/fr/mobile.html">Applications mobiles</a></li>
<li><a href="https://www1.canada.ca/fr/nouveausite.html">À propos de Canada.ca</a></li>
<li><a href="https://www.canada.ca/fr/gouvernement/a-propos.html">À propos de Canada.ca</a></li>
<li><a href="https://www.canada.ca/fr/transparence/avis.html">Avis</a></li>
<li><a href="https://www.canada.ca/fr/transparence/confidentialite.html">Confidentialité</a></li>
{%- elsif i18nText-lang == "en" -%}
<li><a href="https://www.canada.ca/en/social.html">Social media</a></li>
<li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li>
<li><a href="https://www1.canada.ca/en/newsite.html">About Canada.ca</a></li>
<li><a href="https://www.canada.ca/en/government/about.html">About Canada.ca</a></li>
<li><a href="https://www.canada.ca/en/transparency/terms.html">Terms and conditions</a></li>
<li><a href="https://www.canada.ca/en/transparency/privacy.html">Privacy</a></li>
{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/resources-inc/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

gtag('config', '{{site.analytics_google}}');
</script>
<link href="../assets/fontawesome/css/all.min.css" rel="stylesheet">
<link href="{{ "/assets/fontawesome/css/all.min.css" | prepend: site.baseurl }}" rel="stylesheet">
8 changes: 5 additions & 3 deletions docs/_pages/en/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
authorName: Natural Resources Canada
authorUrl:
dateModified: 2022-10-19
dateModified: 2025-01-21
pageclass: wb-prettify all-pre
subject:
en: [GV Government and Politics, Government services]
fr: [GV Gouvernement et vie politique, Services gouvernementaux]
title: Human Settlement and Natural Hazards in Canada
lang: en
altLangPage: ../fr
altLangPage: ../fr/
nositesearch: true
nomenu: true
nofooter: true
breadcrumbs:
- title: "OpenDRR"
link: "https://www.github.com/OpenDRR/"
- title: "OpenDRR Downloads"
link: "../downloads/en"
link: "../downloads/en/"
- title: "Human Settlement and Natural Hazards in Canada"
---
<link href='../assets/css/app.css' rel='stylesheet'/>
Expand Down Expand Up @@ -103,6 +103,8 @@ breadcrumbs:
{% include nhsl-resources.html lang = page.lang layer = layer %}
</div>

<br clear="both">

{% endfor %}

{% assign var_length = variables.size | minus: 3 %}
Expand Down
88 changes: 6 additions & 82 deletions docs/_pages/en/nhsl_physical_exposure_indicators_map.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
authorName: Natural Resources Canada
authorUrl:
dateModified: 2021-07-26
dateModified: 2025-01-21
noContentTitle: true
pageclass: wb-prettify all-pre
subject:
Expand All @@ -17,11 +17,11 @@ breadcrumbs:
- title: "OpenDRR"
link: "https://www.github.com/OpenDRR/"
- title: "OpenDRR Downloads"
link: "../downloads/en"
link: "../downloads/en/"
- title: "Human Settlement and Natural Hazards in Canada"
link: "/en/"
link: "en/"
- title: "Physical Exposure"
link: "/en/index#nhsl_physical_exposure_indicators-a"
link: "en/#nhsl_physical_exposure_indicators-a"
---
<!-- Load Leaflet from CDN -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
Expand Down Expand Up @@ -69,7 +69,7 @@ crossorigin=""></script>
});

var natural_hazards_building_exposure_model = L.esri.featureLayer({
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/nhsl_en/MapServer/7',
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/physical_exposure_en/MapServer/0',
simplifyFactor: 0.25,
precision: 5,
minZoom: 10,
Expand All @@ -94,7 +94,7 @@ crossorigin=""></script>
});

var landuse = L.esri.featureLayer({
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/nhsl_en/MapServer/8',
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/physical_exposure_en/MapServer/1',
simplifyFactor: 0.25,
precision: 5,
minZoom: 10,
Expand All @@ -117,79 +117,6 @@ crossorigin=""></script>
showAttributes( e, landuse );
});

var population_density = L.esri.featureLayer({
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/nhsl_en/MapServer/9',
simplifyFactor: 0.25,
precision: 5,
minZoom: 10,
fields: [ 'OBJECTID', 'Et_PopNight___E_AreaHa' ]
}).on( 'load', function ( e ) {
this.metadata( function ( error, metadata ) {
buildLegend( metadata );
});
$( '#modal' ).remove();
}).on( 'loading', function ( e ) {
$( '#map' ).before( '<div id="modal"></div>' );
}).bindPopup( function ( layer ) {
return L.Util.template( '<p>Population density: <strong>{Et_PopNight___E_AreaHa}</strong></p>', layer.feature.properties );
}).on('add', function ( e ) {
if ( oldId && oldLayer) {
$( '#sidebar' ).html( '' );
oldLayer.resetFeatureStyle( oldId );
}
}).on('click', function ( e ) {
showAttributes( e, population_density );
});

var building_assets_per_hectare = L.esri.featureLayer({
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/nhsl_en/MapServer/10',
simplifyFactor: 0.25,
precision: 5,
minZoom: 10,
fields: [ 'OBJECTID', 'Et_AssetValue___E_AreaHa' ]
}).on( 'load', function ( e ) {
this.metadata( function ( error, metadata ) {
buildLegend( metadata );
});
$( '#modal' ).remove();
}).on( 'loading', function ( e ) {
$( '#map' ).before( '<div id="modal"></div>' );
}).bindPopup( function ( layer ) {
var assetval = L.Util.template( '{Et_AssetValue___E_AreaHa}', layer.feature.properties );
return '<p>Building assets per hectare: <strong>' + formatter.format(assetval) + '</strong></p>';
}).on('add', function ( e ) {
if ( oldId && oldLayer) {
$( '#sidebar' ).html( '' );
oldLayer.resetFeatureStyle( oldId );
}
}).on('click', function ( e ) {
showAttributes( e, building_assets_per_hectare );
});

var building_density = L.esri.featureLayer({
url: 'https://maps-cartes.services.geo.ca/server_serveur/rest/services/NRCan/nhsl_en/MapServer/11',
simplifyFactor: 0.25,
precision: 5,
minZoom: 10,
fields: [ 'OBJECTID', 'Et_BldgNum___E_AreaHa' ]
}).on( 'load', function ( e ) {
this.metadata( function ( error, metadata ) {
buildLegend( metadata );
});
$( '#modal' ).remove();
}).on( 'loading', function ( e ) {
$( '#map' ).before( '<div id="modal"></div>' );
}).bindPopup( function ( layer ) {
return L.Util.template( '<p>Building density: <strong>{Et_BldgNum___E_AreaHa}</strong></p>', layer.feature.properties );
}).on('add', function ( e ) {
if ( oldId && oldLayer) {
$( '#sidebar' ).html( '' );
oldLayer.resetFeatureStyle( oldId );
}
}).on('click', function ( e ) {
showAttributes( e, building_density );
});

var map = L.map( 'map', {
fullscreenControl: true,
center: [ 49.2827, -123.1207 ],
Expand All @@ -208,9 +135,6 @@ crossorigin=""></script>

var overlays = {
'Landuse': landuse,
'Population Density': population_density,
'Building Assets per Hectare': building_assets_per_hectare,
'Building Density': building_density,
// 'Natural Hazards Building Exposure Model': natural_hazards_building_exposure_model
};

Expand Down
Loading
Loading