Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-0.2.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
defaye committed May 20, 2020
2 parents 89e6e2a + 1457089 commit 4f94f73
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 197 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ March 2020 stats updates

0.2.12

April 2020 stats updates
April 2020 stats updates

0.2.13

May 2020 stats updates i.a...
Some files have been renamed to reflect the
format on Sharepoint
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1. Clone repo
1. `Bundle install`
1. `yarn install`
1. Add the `.env` file (another developer should have this)
1. Run `rails s`
1. Run `webpack-dev-server`
2 changes: 1 addition & 1 deletion app/controllers/chapters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def chapter_2

@map_3 = {
id: "map_3",
tiles_url: 'https://tiles.arcgis.com/tiles/Mj0hjvkNtV7NRhA7/arcgis/rest/services/PP_Live_Ch2_Fg5_Apr20/VectorTileServer/tile/{z}/{y}/{x}.pbf',
tiles_url: 'https://tiles.arcgis.com/tiles/Mj0hjvkNtV7NRhA7/arcgis/rest/services/PP_Live_Ch2_Fg5_May20/VectorTileServer/tile/{z}/{y}/{x}.pbf',
layers: [
{
id: 'over-ten-' + random_number,
Expand Down
14 changes: 0 additions & 14 deletions lib/data/file/PP_Global_Monthly_Stats.csv

This file was deleted.

11 changes: 0 additions & 11 deletions lib/data/file/all_chapter_update_dates.csv

This file was deleted.

11 changes: 11 additions & 0 deletions lib/data/file/all_chapter_update_table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
chapter,last_updated,next_updated
1,May-20,Jun-20
2,May-20,Jun-20
3,Apr-20,Sep-20
4,Sep-19,Sep-20
5,May-20,Jun-20
6,Sep-19,Sep-20
7,Jul-18,Sep-20
8,Jul-18,Sep-20
9,Jul-18,Sep-20
10,May-20,Jun-20
14 changes: 14 additions & 0 deletions lib/data/file/chapter2_global_pa_statistics.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type,value
total_protected_areas,245
total_terrestrial_protected_areas,"228,205"
total_marine_protected_areas,"16,991"
total_land_pa_coverage_percentage,15.15
total_land_area_protected,"20,445,062"
total_ocean_pa_coverage_percentage,7.43
total_ocean_area_protected,"26,928,113"
national_waters_pa_coverage_percentage,17.22
national_waters_pa_coverage_area,"24,309,960"
high_seas_pa_coverage_percentage,1.18
high_seas_pa_coverage_area,"2,618,153"
national_waters_percentage,39
global_ocean_percentage,61

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/modules/csv_map_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
ch2_map2_categorical: {
boundaries: [0,5,10,17],
header_name: 'percentage_pa_land_cover',
csv: 'PP_National_Monthly_Stats.csv'
csv: 'chapter2_national_pa_statistics.csv'
},
ch5_map_categorical: {
boundaries: [0,10,30,60],
header_name: 'pame_percentage_pa_land_cover',
csv: 'PP_National_Monthly_Stats.csv'
csv: 'chapter2_national_pa_statistics.csv'
},
ch7_map1_categorical: {
boundaries: [4,8,12,17,25],
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/csv_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CsvParser
def self.chapter_dates
dates = {}
CSV.parse(file_reader('all_chapter_update_dates.csv'), headers: true) do |row|
CSV.parse(file_reader('all_chapter_update_table.csv'), headers: true) do |row|
dates["chapter_#{row['chapter']}"] = {
'last_updated' => row['last_updated'],
'next_updated' => row['next_updated']
Expand All @@ -14,7 +14,7 @@ def self.chapter_dates

def self.pp_global_monthly_stats
stats = {}
CSV.parse(file_reader('PP_Global_Monthly_Stats.csv'), headers: true) do |row|
CSV.parse(file_reader('chapter2_global_pa_statistics.csv'), headers: true) do |row|
stats[row['type']] = row['value']
end
stats
Expand Down
Loading

0 comments on commit 4f94f73

Please sign in to comment.