From cec8e4133e6481869ac006b93e39dc73da91bec5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2019 04:50:16 +0000 Subject: [PATCH 01/11] Bump appsignal from 2.9.16 to 2.9.17 Bumps [appsignal](https://github.com/appsignal/appsignal-ruby) from 2.9.16 to 2.9.17. - [Release notes](https://github.com/appsignal/appsignal-ruby/releases) - [Changelog](https://github.com/appsignal/appsignal-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/appsignal/appsignal-ruby/compare/v2.9.16...v2.9.17) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index feae49361a..7e77283792 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,7 +81,7 @@ GEM annotate (3.0.2) activerecord (>= 3.2, < 7.0) rake (>= 10.4, < 13.0) - appsignal (2.9.16) + appsignal (2.9.17) rack arbre (1.2.1) activesupport (>= 3.0.0) From 001547c6db75fa4174cc7ee9361e601f5ab93727 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2019 04:51:08 +0000 Subject: [PATCH 02/11] Bump puma from 4.2.1 to 4.3.0 Bumps [puma](https://github.com/puma/puma) from 4.2.1 to 4.3.0. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v4.2.1...v4.3.0) Signed-off-by: dependabot-preview[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index ba8890ab91..01d403c5b4 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ gem 'scenic' gem 'pg_csv' gem 'pg_search' gem 'rubyzip' -gem 'puma', '~> 4.2' +gem 'puma', '~> 4.3' gem 'dotenv-rails', '~> 2.7' gem 'active_model_serializers', '~> 0.10.10' gem 'kaminari' diff --git a/Gemfile.lock b/Gemfile.lock index feae49361a..1048570df0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -254,7 +254,7 @@ GEM net-ssh (>= 2.6.5, < 6.0.0) net-ssh (5.2.0) newrelic_rpm (6.7.0.359) - nio4r (2.3.1) + nio4r (2.5.2) nokogiri (1.10.4) mini_portile2 (~> 2.4.0) oj (3.9.2) @@ -277,7 +277,7 @@ GEM polyamorous (2.3.0) activerecord (>= 5.0) public_suffix (3.0.3) - puma (4.2.1) + puma (4.3.0) nio4r (~> 2.0) rack (2.0.7) rack-cors (1.0.3) @@ -498,7 +498,7 @@ DEPENDENCIES pg (~> 0.18) pg_csv pg_search - puma (~> 4.2) + puma (~> 4.3) rack-cors (~> 1.0) rails (~> 5.2.3) rails-controller-testing From f29ed66b9617c09920c25ae25c7534a686129b19 Mon Sep 17 00:00:00 2001 From: sorodrigo Date: Fri, 8 Nov 2019 11:52:09 -0600 Subject: [PATCH 03/11] update contextual layers --- frontend/gis/cartodb/tool/templates.demo.json | 88 +------------------ 1 file changed, 1 insertion(+), 87 deletions(-) diff --git a/frontend/gis/cartodb/tool/templates.demo.json b/frontend/gis/cartodb/tool/templates.demo.json index d16c4c9e39..fe51488c70 100644 --- a/frontend/gis/cartodb/tool/templates.demo.json +++ b/frontend/gis/cartodb/tool/templates.demo.json @@ -1,87 +1 @@ -[ - { - "version": "0.0.1", - "name": "paraguay_ecoregions_2018_11_14", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT * FROM paraguay_ecoregions_2018_11_14", - "cartocss": "#layer { polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1; } #layer[zoom > 4]::labels { text-name: [simple_name]; text-face-name: 'Open Sans Regular'; text-size: 15; text-fill: #FFFFFF; text-allow-overlap: true; text-placement: interior; text-halo-fill: black; text-halo-radius: 1; text-character-spacing: 3; [zoom=5] { text-size: 11; [simple_name='Chaco Humedo'] { text-dy: -10; } [simple_name='Mata Atlantica'] { text-dy: 30; } } [zoom=6] { [simple_name='Chaco Humedo'] { text-dy: 5; } [simple_name='Mata Atlantica'] { text-dy: -15; } } [simple_name='Mata Atlantica'] { text-dy: 20; } [simple_name='Pantanal'] { text-dy: 30; text-dx: 5; } }", - "cartocss_version": "2.3.0" - } - } - ] - } - }, - { - "version": "0.0.1", - "name": "paraguay_protected_areas_2018_11_14", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT * FROM paraguay_protected_areas_2018_11_14", - "cartocss": "#paraguay_protected_areas_2018_11_14{ polygon-opacity: 0.5; polygon-fill:#B4D84F; line-color: #B4D84F; line-width: 1; line-opacity: 1;}", - "cartocss_version": "2.3.0" - } - } - ] - } - }, - { - "version": "0.0.1", - "name": "paraguay_indigenous_areas_2018_11_14", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT * FROM paraguay_indigenous_areas_2018_11_14", - "cartocss": "#paraguay_indigenous_areas_2018_11_14{ polygon-fill:#ECC35F; polygon-opacity: 0.5; line-color: #ECC35F; line-width: 1; line-opacity: 1;}", - "cartocss_version": "2.3.0" - } - } - ] - } - }, - { - "version": "0.0.1", - "name": "py_deforestation_2013_2017_20190131", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT * FROM py_deforestation_2013_2017_20190131", - "cartocss": "#layer { polygon-opacity: 0.8; line-width: 0.2; line-opacity: 1; [ year = 2013] { polygon-fill: #ecda9a; line-color: #ecda9a; } [ year = 2014] { polygon-fill: #f1b973; line-color: #f1b973; } [ year = 2015] { polygon-fill: #f7945d; line-color: #f7945d; } [ year = 2016] { polygon-fill: #f86f56; line-color: #f86f56; } [ year = 2017] { polygon-fill: #ee4d5a; line-color: #ee4d5a; } }", - "cartocss_version": "2.3.0" - } - } - ] - } - }, - { - "version": "0.0.1", - "name": "col_departments", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT the_geom_webmercator FROM col_adm1_1", - "cartocss": "#col_department_boundries { polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1;}", - "cartocss_version": "2.3.0" - } - } - ] - } - } -] +[] From e0a04f6ae9fb60e491936febc22c8490f2e1d307 Mon Sep 17 00:00:00 2001 From: sorodrigo Date: Fri, 8 Nov 2019 11:59:37 -0600 Subject: [PATCH 04/11] update ctx layers --- .../cartodb/tool/templates.development.json | 65 ++----------------- .../cartodb/tool/templates.production.json | 34 ++++++++++ .../named-maps/tool_named_maps_carto.js | 63 ++++++------------ .../react-components/tool/tool.actions.js | 2 +- 4 files changed, 61 insertions(+), 103 deletions(-) diff --git a/frontend/gis/cartodb/tool/templates.development.json b/frontend/gis/cartodb/tool/templates.development.json index e0bfa79547..ee3a5c09fa 100644 --- a/frontend/gis/cartodb/tool/templates.development.json +++ b/frontend/gis/cartodb/tool/templates.development.json @@ -8,8 +8,8 @@ { "type": "cartodb", "options": { - "sql": "SELECT * FROM brazil_states_context_layer", - "cartocss": "#s{ polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1;} #s[zoom>3]::labels { text-name: [abbr]; text-face-name: 'Open Sans Regular'; text-size: 12; text-allow-overlap: true; text-placement: interior; text-fill: #FFFFFF; text-halo-fill: #000000; text-halo-radius: 1; text-character-spacing: 0; [zoom>4] { text-name: [name_upper]; text-size: 14; text-allow-overlap: true; text-placement: interior; text-character-spacing: 3; [name_upper='DISTRITO FEDERAL'] { text-dy: -5; } [name_upper='GOIAS'] { text-dy: 10; } [name_upper='RIO GRANDE DO NORTE'] { text-dx: 1; } }}", + "sql": "SELECT * FROM brazil_states", + "cartocss": "#s{ polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1;} #s[zoom>3]::labels { text-name: [siglauf3]; text-face-name: 'Open Sans Regular'; text-size: 12; text-allow-overlap: true; text-placement: interior; text-fill: #000000; text-character-spacing: 0; [zoom>4] { text-name: [name]; text-size: 14; text-allow-overlap: true; text-placement: interior; text-character-spacing: 3; [name='DISTRITO FEDERAL'] { text-dy: -5; } [name='GOIAS'] { text-dy: 10; } [name='RIO GRANDE DO NORTE'] { text-dx: 1; } }}", "cartocss_version": "2.3.0" } } @@ -26,7 +26,7 @@ "type": "cartodb", "options": { "sql": "SELECT * FROM brazil_biomes", - "cartocss": "#brazil_biomes{ polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1;}#brazil_biomes[zoom>3]::labels { text-name: [name]; text-face-name: 'Open Sans Regular'; text-size: 15; text-fill: #FFFFFF; text-allow-overlap: true; text-placement: interior; text-halo-fill: black; text-halo-radius: 1; text-character-spacing: 3; [name='MATA ATLANTICA'] { text-horizontal-alignment: left; text-dx: 85; } [name='PANTANAL'] { text-horizontal-alignment: right; text-dx: -60; } [zoom=4] { text-size: 13; }}", + "cartocss": "#brazil_biomes{ polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1;}#brazil_biomes[zoom>3]::labels { text-name: [name]; text-face-name: 'Open Sans Regular'; text-size: 15; text-fill: #000000; text-allow-overlap: true; text-placement: interior; text-character-spacing: 3; [name='MATA ATLANTICA'] { text-horizontal-alignment: left; text-dx: 85; } [name='PANTANAL'] { text-horizontal-alignment: right; text-dx: -60; } [zoom=4] { text-size: 13; }}", "cartocss_version": "2.3.0" } } @@ -35,7 +35,7 @@ }, { "version": "0.0.1", - "name": "water_scarcity", + "name": "brazil_water_scarcity", "layergroup": { "version": "1.0.1", "layers": [ @@ -52,7 +52,7 @@ }, { "version": "0.0.1", - "name": "indigenous_areas", + "name": "brazil_indigenous_areas", "layergroup": { "version": "1.0.1", "layers": [ @@ -96,7 +96,7 @@ { "type": "cartodb", "options": { - "sql": "SELECT the_geom_webmercator, '2009' as year FROM deforestation_alerts_2009 union all SELECT the_geom_webmercator, '2010' as year FROM deforestation_alerts_2010 union all SELECT the_geom_webmercator, '2011' as year FROM deforestation_alerts_2011 union all SELECT the_geom_webmercator, '2012' as year FROM deforestation_alerts_2012 union all SELECT the_geom_webmercator, '2013' as year FROM deforestation_alerts_2013 union all SELECT the_geom_webmercator, '2014' as year FROM deforestation_alerts_2014 union all SELECT the_geom_webmercator, '2015' as year FROM deforestation_alerts_2015", + "sql": "SELECT * from brazil_deforestation_2017_20181001", "cartocss": "#deforestation_alerts_2013{ polygon-fill: #B40903; polygon-opacity: 1; line-color: #B40903; line-width: 0.2; line-opacity: 1; }", "cartocss_version": "2.3.0", "interactivity":["year"] @@ -105,40 +105,6 @@ ] } }, - { - "version": "0.0.1", - "name": "col_protected_areas", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT * FROM brazil_protected_areas", - "cartocss": "#brazil_protected_areas{ polygon-opacity: 0.5; polygon-fill:#B4D84F; line-color: #B4D84F; line-width: 1; line-opacity: 1;}", - "cartocss_version": "2.3.0" - } - } - ] - } - }, - { - "version": "0.0.1", - "name": "col_adm1_1", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT the_geom_webmercator FROM col_adm1_1", - "cartocss": "#col_department_boundries { polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1;}", - "cartocss_version": "2.3.0" - } - } - ] - } - }, { "version": "0.0.1", "name": "paraguay_ecoregions_2018_11_14", @@ -166,7 +132,7 @@ "type": "cartodb", "options": { "sql": "SELECT * FROM paraguay_protected_areas_2018_11_14", - "cartocss": "#paraguay_protected_areas_2018_11_14{ polygon-opacity: 0.5; polygon-fill: #B4D84F; line-color: #B4D84F; line-width: 1; line-opacity: 1;}", + "cartocss": "#paraguay_protected_areas_2018_11_14{ polygon-opacity: 0.5; polygon-fill:#B4D84F; line-color: #B4D84F; line-width: 1; line-opacity: 1;}", "cartocss_version": "2.3.0" } } @@ -207,23 +173,6 @@ ] } }, - { - "version": "0.0.1", - "name": "id_provinces", - "layergroup": { - "version": "1.0.1", - "layers": [ - { - "type": "cartodb", - "options": { - "sql": "SELECT * FROM indonesia_provinces_boundaries_20190614", - "cartocss": "#layer { polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1; ::outline { line-color: #FFFFFF; line-width: 1; line-opacity: 0.5; } [zoom>4]::labels { text-face-name: 'Open Sans Regular'; text-name: [prov]; text-size: 12; text-allow-overlap: true; text-placement: point; text-fill: #000000; text-character-spacing: 0; [prov='SULAWESI UTARA'] { text-dy: -10; } [prov='BENGKULU'] { text-dy: 10; } [prov='SULAWESI TENGGARA'] { text-dy: 10; } [prov='BANTEN'] { text-dx: -10; } [prov='DKI JAKARTA'] { text-dy: -10; } [prov='JAWA BARAT'] { text-dy: -10; } [prov='JAWA TIMUR'] { text-dx: 10; text-dy: -10; } [prov='NUSA TENGGARA BARAT'] { text-dy: 10; } [prov='NUSA TENGGARA TIMUR'] { text-dx: 5; } } } ", - "cartocss_version": "2.3.0" - } - } - ] - } - }, { "version": "0.0.1", "name": "colombia_regional_autonomous_corps", diff --git a/frontend/gis/cartodb/tool/templates.production.json b/frontend/gis/cartodb/tool/templates.production.json index 5b75f02a06..ee3a5c09fa 100644 --- a/frontend/gis/cartodb/tool/templates.production.json +++ b/frontend/gis/cartodb/tool/templates.production.json @@ -172,5 +172,39 @@ } ] } + }, + { + "version": "0.0.1", + "name": "colombia_regional_autonomous_corps", + "layergroup": { + "version": "1.0.1", + "layers": [ + { + "type": "cartodb", + "options": { + "sql": "SELECT * FROM colombia_regional_autonomous_corps", + "cartocss": "#layer { polygon-opacity: 0; line-color: #000000; line-width: 1; line-opacity: 1; ::outline { line-color: #FFFFFF; line-width: 1; line-opacity: 0.5; } [zoom>6]::labels { text-face-name: 'Open Sans Regular'; text-name: [label]; text-size: 12; text-allow-overlap: true; text-placement: point; text-fill: #000000; text-character-spacing: 0; [label='CORPOGUAVIO'] { text-dx: 10; } } }", + "cartocss_version": "2.3.0" + } + } + ] + } + }, + { + "version": "0.0.1", + "name": "colombia_protected_areas", + "layergroup": { + "version": "1.0.1", + "layers": [ + { + "type": "cartodb", + "options": { + "sql": "SELECT * FROM colombia_protected_areas", + "cartocss": "#layer { polygon-fill: #B4D84F; polygon-opacity: 0.9; ::outline { line-color: #B4D84F; line-width: 1; line-opacity: 0.5; } }", + "cartocss_version": "2.3.0" + } + } + ] + } } ] diff --git a/frontend/scripts/named-maps/tool_named_maps_carto.js b/frontend/scripts/named-maps/tool_named_maps_carto.js index 9b23285c75..66ffd99d49 100644 --- a/frontend/scripts/named-maps/tool_named_maps_carto.js +++ b/frontend/scripts/named-maps/tool_named_maps_carto.js @@ -40,24 +40,32 @@ module.exports = { py_deforestation_2013_2017_20190131: { uid: 'py_deforestation_2013_2017_20190131__production', layergroupid: 'p2cs-sei@9d6ad933@07588ca1af7caf72f3f838cdac1cac8f:1548926222884' + }, + colombia_regional_autonomous_corps: { + uid: 'colombia_regional_autonomous_corps__production', + layergroupid: 'p2cs-sei@503b6857@c4c1c3f71af8652b5e4a4ebf8ea6d344:1536313111531' + }, + colombia_protected_areas: { + uid: 'colombia_protected_areas__production', + layergroupid: 'p2cs-sei@bd5844b5@7068763bcb727c705c489c838b6deadb:1536312121956' } }, development: { brazil_states: { uid: 'brazil_states__development', - layergroupid: 'p2cs-sei@79d8b6c4@5d0ad8d7fce54c67b90308a8db45756f:1525368076102' + layergroupid: 'p2cs-sei@b06a355d@9de41b35f0a1b60b2aa10c17d425647a:1536754740910' }, brazil_biomes: { uid: 'brazil_biomes__development', - layergroupid: 'p2cs-sei@53496782@af95c2a43027d24c22f3fe1c6c55db63:1536754747512' + layergroupid: 'p2cs-sei@1392c7ac@ede5da577e49c54cae5f5d285a37839d:1536754747512' }, - water_scarcity: { - uid: 'water_scarcity__development', - layergroupid: 'p2cs-sei@99a5121a@402f2b1ec6819c0cabfea31443a30cf9:1536754755124' + brazil_water_scarcity: { + uid: 'brazil_water_scarcity__development', + layergroupid: 'p2cs-sei@f906de3a@dc3fa18c3568bdf183f83eceddeaa8f4:1536754755124' }, - indigenous_areas: { - uid: 'indigenous_areas__development', - layergroupid: 'p2cs-sei@969e9936@8c3a951aa209095a67b324ce57666eb4:1538034854446' + brazil_indigenous_areas: { + uid: 'brazil_indigenous_areas__development', + layergroupid: 'p2cs-sei@2bf1234d@b2952f7aa00e10ee10bb538fd5d5ab27:1538034854446' }, brazil_protected: { uid: 'brazil_protected__development', @@ -65,15 +73,7 @@ module.exports = { }, brazil_defor_alerts: { uid: 'brazil_defor_alerts__development', - layergroupid: 'p2cs-sei@8a7654c3@a916e3ed49a3a4095612d7ca6266c3ef:1525368094112' - }, - col_protected_areas: { - uid: 'col_protected_areas__development', - layergroupid: 'p2cs-sei@ef891231@00901bb55c96b2ce22481f4f643cd663:1537979981544' - }, - col_adm1_1: { - uid: 'col_adm1_1__development', - layergroupid: 'p2cs-sei@7bcc1cb8@79f63682d3c8a33bf661ad8ef0cb515b:1525368093739' + layergroupid: 'p2cs-sei@082e3a98@a2f2a0645bced22e2aaf17ddda69a24f:1538401614852' }, paraguay_ecoregions_2018_11_14: { uid: 'paraguay_ecoregions_2018_11_14__development', @@ -81,7 +81,7 @@ module.exports = { }, paraguay_protected_areas_2018_11_14: { uid: 'paraguay_protected_areas_2018_11_14__development', - layergroupid: 'p2cs-sei@b53762dd@1154d2027ca0c834ba9a8b845a898528:1542212474275' + layergroupid: 'p2cs-sei@58c20a29@fdf353b181f5b78df49f77e604882d26:1542212474275' }, paraguay_indigenous_areas_2018_11_14: { uid: 'paraguay_indigenous_areas_2018_11_14__development', @@ -91,10 +91,6 @@ module.exports = { uid: 'py_deforestation_2013_2017_20190131__development', layergroupid: 'p2cs-sei@c8b99dd7@cbb68d33432adf3f69b686127104af27:1548926222884' }, - id_provinces: { - uid: 'id_provinces__development', - layergroupid: 'p2cs-sei@083d0ae4@3b599909380f1dc1a6af506f9bcd5756:1560524731493' - }, colombia_regional_autonomous_corps: { uid: 'colombia_regional_autonomous_corps__development', layergroupid: 'p2cs-sei@358d2853@4a2c3386345ec46663b8e4cf799f379b:1536313111531' @@ -154,28 +150,7 @@ module.exports = { layergroupid: 'p2cs-sei@dba9560a@d9b798b42ae0e7bbb677bfbe46d49413:1536312121956' } }, - demo: { - paraguay_ecoregions_2018_11_14: { - uid: 'paraguay_ecoregions_2018_11_14__demo', - layergroupid: 'p2cs-sei@9de1a54d@5f0d8a6b5dd2699b1e73750baf8002a1:1543380503816' - }, - paraguay_protected_areas_2018_11_14: { - uid: 'paraguay_protected_areas_2018_11_14__demo', - layergroupid: 'p2cs-sei@4a6b05f7@ab6d3ac3380c73c9eddce074e6ddfb84:1542212474275' - }, - paraguay_indigenous_areas_2018_11_14: { - uid: 'paraguay_indigenous_areas_2018_11_14__demo', - layergroupid: 'p2cs-sei@57f269c7@875c2a005b56193dc66f5aafb3dd808b:1542212565695' - }, - py_deforestation_2013_2017_20190131: { - uid: 'py_deforestation_2013_2017_20190131__demo', - layergroupid: 'p2cs-sei@fd82ef5d@f47353ad4eedd4c437159751bd96fb78:1548926222884' - }, - col_departments: { - uid: 'col_departments__demo', - layergroupid: 'p2cs-sei@ac7a49be@5ae47ae98e8070dbc3983e87100857c9:1525368093739' - } - }, + demo: {}, indonesiademo: { id_provinces: { uid: 'id_provinces__indonesiademo', diff --git a/frontend/scripts/react-components/tool/tool.actions.js b/frontend/scripts/react-components/tool/tool.actions.js index a047aca811..82cd37f5e2 100644 --- a/frontend/scripts/react-components/tool/tool.actions.js +++ b/frontend/scripts/react-components/tool/tool.actions.js @@ -55,7 +55,7 @@ export function loadMapVectorData() { return fetch(vectorLayerURL) .then(res => res.json()) .then(topoJSON => { - const key = Object.keys(topoJSON.objects)[0]; + const [key] = Object.keys(topoJSON.objects); const geoJSON = topojsonFeature(topoJSON, topoJSON.objects[key]); setGeoJSONMeta( geoJSON, From 02c209ed24a58674251710cc8c68dee5dc203f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Gonz=C3=A1lez?= Date: Thu, 7 Nov 2019 19:49:40 +0100 Subject: [PATCH 05/11] Add service for getting node data --- app/services/api/public/node/filter.rb | 125 +++++++++++++++++++ spec/services/api/public/node/filter_spec.rb | 45 +++++++ 2 files changed, 170 insertions(+) create mode 100644 app/services/api/public/node/filter.rb create mode 100644 spec/services/api/public/node/filter_spec.rb diff --git a/app/services/api/public/node/filter.rb b/app/services/api/public/node/filter.rb new file mode 100644 index 0000000000..339db5743c --- /dev/null +++ b/app/services/api/public/node/filter.rb @@ -0,0 +1,125 @@ +module Api + module Public + module Node + class Filter + attr_reader :data + + def initialize(params = {}) + initialize_params(params) + end + + def call + initialize_query + + apply_filters + + @query.first + end + + private + + def initialize_params(params) + @node_id = params[:id] + @year = params[:year] + end + + def initialize_query + @query = Api::V3::Readonly::FlowNode. + select(*select_clause). + joins('INNER JOIN nodes_mv ON nodes_mv.id = flow_nodes_mv.node_id'). + joins('INNER JOIN contexts_mv ON contexts_mv.id = flow_nodes_mv.context_id'). + group(*group_clause). + order('flow_nodes_mv.node_id') + end + + def select_clause + [ + 'flow_nodes_mv.node_id', + 'nodes_mv.name', + 'nodes_mv.node_type', + 'nodes_mv.geo_id', + 'JSON_AGG(' \ + 'DISTINCT JSONB_BUILD_OBJECT(' \ + '\'country\', contexts_mv.iso2, ' \ + '\'commodity\', contexts_mv.commodity_name, ' \ + '\'years\', nodes_mv.years' \ + ')' \ + ') AS availability', + 'JSON_AGG(' \ + 'DISTINCT JSONB_BUILD_OBJECT(' \ + '\'country\', contexts_mv.iso2, ' \ + '\'commodity\', contexts_mv.commodity_name, ' \ + "'node_quants', #{select_node_clause('quants')}, " \ + "'node_quals', #{select_node_clause('quals')}, " \ + "'node_inds', #{select_node_clause('inds')}" \ + ')' \ + ') AS node_indicators', + 'JSON_AGG(' \ + 'DISTINCT JSONB_BUILD_OBJECT(' \ + '\'country\', contexts_mv.iso2, ' \ + '\'commodity\', contexts_mv.commodity_name, ' \ + '\'flow_id\', flow_nodes_mv.flow_id, ' \ + "'flow_quants', #{select_flow_clause('quants')}, " \ + "'flow_quals', #{select_flow_clause('quals')}, " \ + "'flow_inds', #{select_flow_clause('inds')}" \ + ')' \ + ') AS flow_indicators' + ] + end + + def select_node_clause(node_type) + 'ARRAY(' \ + 'SELECT JSONB_BUILD_OBJECT(' \ + "'name', #{node_type}.name, " \ + '\'year\', year, ' \ + '\'value\', value) ' \ + "FROM node_#{node_type} " \ + "INNER JOIN #{node_type} ON #{node_type}.id = node_#{node_type}.#{node_type.singularize}_id " \ + "WHERE node_#{node_type}.node_id = flow_nodes_mv.node_id AND " \ + "node_#{node_type}.year = flow_nodes_mv.year" \ + ')' + end + + def select_flow_clause(flow_type) + 'ARRAY(' \ + 'SELECT JSON_BUILD_OBJECT(' \ + "'name', #{flow_type}.name, " \ + '\'year\', year, ' \ + '\'value\', value) ' \ + "FROM flow_#{flow_type} " \ + "INNER JOIN #{flow_type} ON #{flow_type}.id = flow_#{flow_type}.#{flow_type.singularize}_id " \ + "WHERE flow_#{flow_type}.flow_id = flow_nodes_mv.flow_id" \ + ')' + end + + def group_clause + [ + 'flow_nodes_mv.node_id', + 'nodes_mv.name', + 'nodes_mv.node_type', + 'nodes_mv.geo_id', + 'contexts_mv.iso2', + 'contexts_mv.commodity_name' + ] + end + + def apply_filters + apply_node_id_filter + apply_year_filter + end + + def apply_node_id_filter + return unless @node_id + + @query = @query.where('flow_nodes_mv.node_id' => @node_id) + end + + def apply_year_filter + return unless @node_id + + @query = @query.where('flow_nodes_mv.year' => @year) + end + end + end + end +end diff --git a/spec/services/api/public/node/filter_spec.rb b/spec/services/api/public/node/filter_spec.rb new file mode 100644 index 0000000000..ddd89809da --- /dev/null +++ b/spec/services/api/public/node/filter_spec.rb @@ -0,0 +1,45 @@ +require 'rails_helper' + +RSpec.describe Api::Public::Node::Filter do + include_context 'api v3 quants' + include_context 'api v3 brazil flows quants' + + before(:each) do + Api::V3::Readonly::Context.refresh(sync: true) + Api::V3::Readonly::Node.refresh(sync: true) + Api::V3::Readonly::FlowNode.refresh(sync: true) + end + + context 'when filtering by node_id and year' do + it 'should return flow attributes for that country' do + builder = Api::Public::Node::Filter.new( + id: api_v3_biome_node.id, + year: 2015 + ) + query = builder.call + attrs = query.attributes + + node = api_v3_biome_node.readonly_attribute + expect(attrs['node_id']).to eql(api_v3_biome_node.id) + expect(attrs['name']).to eql(node.name) + expect(attrs['node_type']).to eql(node.node_type) + expect(attrs['geo_id']).to eql(node.geo_id) + + expect(attrs['availability'].first['country']).to eql(node.context.country.iso2) + expect(attrs['availability'].first['commodity']).to eql(node.context.commodity_name) + expect(attrs['availability'].first['years']).to eql(node.years) + + flows_ids = attrs['flow_indicators'].map { |fi| fi['flow_id'] } + expect(flows_ids).to eql( + Api::V3::Readonly::FlowNode.where(node_id: node.id).map(&:flow_id) + ) + flow_quants_values = attrs['flow_indicators']. + map { |fi| fi['flow_quants'] }. + flatten. + map { |fq| fq['value'] } + expect(flow_quants_values).to match_array( + Api::V3::FlowQuant.where(flow_id: flows_ids).map(&:value).map(&:to_i) + ) + end + end +end From f88ad94bf5b4ff56df4ecec8bf95ecce2c08e262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Gonz=C3=A1lez?= Date: Thu, 7 Nov 2019 19:51:12 +0100 Subject: [PATCH 06/11] Add endpoint for getting node data information --- .../api/public/nodes_controller.rb | 27 ++ .../api/public/node/node_serializer.rb | 14 + config/routes.rb | 3 + spec/responses/api/public/node_data_spec.rb | 21 + spec/support/schemas/public_node_data.json | 374 ++++++++++++++++++ 5 files changed, 439 insertions(+) create mode 100644 app/controllers/api/public/nodes_controller.rb create mode 100644 app/serializers/api/public/node/node_serializer.rb create mode 100644 spec/responses/api/public/node_data_spec.rb create mode 100644 spec/support/schemas/public_node_data.json diff --git a/app/controllers/api/public/nodes_controller.rb b/app/controllers/api/public/nodes_controller.rb new file mode 100644 index 0000000000..c0074754ad --- /dev/null +++ b/app/controllers/api/public/nodes_controller.rb @@ -0,0 +1,27 @@ +module Api + module Public + class NodesController < ApiController + skip_before_action :load_context + + def data + ensure_required_param_present(:id) + ensure_required_param_present(:year) + + @result = Api::Public::Node::Filter.new(filter_params).call + + render json: @result, + root: 'data', + serializer: Api::Public::Node::NodeSerializer + end + + private + + def filter_params + { + id: params[:id], + year: params[:year] + } + end + end + end +end diff --git a/app/serializers/api/public/node/node_serializer.rb b/app/serializers/api/public/node/node_serializer.rb new file mode 100644 index 0000000000..211127ef02 --- /dev/null +++ b/app/serializers/api/public/node/node_serializer.rb @@ -0,0 +1,14 @@ +module Api + module Public + module Node + class NodeSerializer < ActiveModel::Serializer + attributes :name, + :node_type, + :geo_id, + :availability, + :node_indicators, + :flow_indicators + end + end + end +end diff --git a/config/routes.rb b/config/routes.rb index b16a710651..190e7d8292 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -134,6 +134,9 @@ namespace :public do resources :attributes, only: [:index] resources :flows, only: [:index] + resources :nodes, only: [] do + get :data, on: :member + end namespace :nodes do resources :sources, only: [:index] resources :exporters, only: [:index] diff --git a/spec/responses/api/public/node_data_spec.rb b/spec/responses/api/public/node_data_spec.rb new file mode 100644 index 0000000000..43f6d99b77 --- /dev/null +++ b/spec/responses/api/public/node_data_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +RSpec.describe 'Node data', type: :request do + include_context 'api v3 quants' + include_context 'api v3 brazil flows quants' + + before(:each) do + Api::V3::Readonly::Context.refresh(sync: true) + Api::V3::Readonly::Node.refresh(sync: true) + Api::V3::Readonly::FlowNode.refresh(sync: true) + end + + describe 'GET /api/public/nodes/:id/data' do + it 'has the correct response structure' do + get "/api/public/nodes/#{api_v3_biome_node.id}/data?year=2015" + + expect(@response).to have_http_status(:ok) + expect(@response).to match_response_schema('public_node_data') + end + end +end diff --git a/spec/support/schemas/public_node_data.json b/spec/support/schemas/public_node_data.json new file mode 100644 index 0000000000..9e787b0a07 --- /dev/null +++ b/spec/support/schemas/public_node_data.json @@ -0,0 +1,374 @@ +{ + "$id": "http://example.com/example.json", + "type": "object", + "definitions": {}, + "$schema": "http://json-schema.org/draft-06/schema#", + "properties": { + "data": { + "$id": "/properties/data", + "type": "object", + "properties": { + "nodeId": { + "$id": "/properties/data/properties/nodeId", + "type": "integer", + "title": "Node ID", + "description": "Node Id", + "examples": [ + 1 + ] + }, + "name": { + "$id": "/properties/data/properties/name", + "type": "string", + "title": "Node name", + "description": "Node name", + "examples": [ + "Node name" + ] + }, + "nodeType": { + "$id": "/properties/data/properties/nodeType", + "type": "string", + "title": "Node type name", + "description": "Node type name", + "examples": [ + "Node type name" + ] + }, + "geoId": { + "$id": "/properties/data/properties/geoId", + "type": "string", + "title": "Node Geo ID", + "description": "Node Geo ID", + "examples": [ + "Node Geo Id" + ] + }, + "availability": { + "$id": "/properties/data/properties/availability", + "type": "array", + "items": { + "$id": "/properties/data/properties/availability/items", + "type": "object", + "properties": { + "commodity": { + "$id": "/properties/data/properties/availability/items/commodity", + "type": "string", + "title": "Commodity name", + "description": "Commodity name", + "examples": [ + "name" + ] + }, + "country": { + "$id": "/properties/data/properties/availability/items/country", + "type": "string", + "title": "Country iso2", + "description": "Country iso2", + "examples": [ + "iso2" + ] + }, + "years": { + "$id": "/properties/data/properties/availability/items/years", + "type": "array", + "title": "Years", + "description": "Array of years", + "examples": [ + [2015, 2017] + ] + } + } + } + }, + "flowIndicators": { + "$id": "/properties/data/properties/flowIndicators", + "type": "array", + "items": { + "$id": "/properties/data/properties/flowIndicators/items", + "type": "object", + "properties": { + "commodity": { + "$id": "/properties/data/properties/flowIndicators/items/commodity", + "type": "string", + "title": "Commodity name", + "description": "Commodity name", + "examples": [ + "name" + ] + }, + "country": { + "$id": "/properties/data/properties/flowIndicators/items/country", + "type": "string", + "title": "Country iso2", + "description": "Country iso2", + "examples": [ + "iso2" + ] + }, + "flowId": { + "$id": "/properties/data/properties/flowIndicators/items/flowId", + "type": "integer", + "title": "Flow Id", + "description": "ID of the flow", + "examples": [ + 2015 + ] + }, + "flowInds": { + "$id": "/properties/data/properties/flowIndicators/items/flowInds", + "type": "array", + "items": { + "$id": "/properties/data/properties/flowIndicators/items/flowInds/items", + "type": "object", + "properties": { + "name": { + "$id": "/properties/data/properties/flowIndicators/items/flowInds/items/name", + "type": "string", + "title": "Flow ind name", + "description": "Flow ind name", + "examples": [ + "name" + ] + }, + "year": { + "$id": "/properties/data/properties/flowIndicators/items/flowInds/items/year", + "type": "integer", + "title": "Flow ind year", + "description": "Flow ind year", + "examples": [ + 2017 + ] + }, + "value": { + "$id": "/properties/data/properties/flowIndicators/items/flowInds/items/value", + "type": "number", + "title": "Flow ind value", + "description": "Flow ind value", + "examples": [ + 11 + ] + } + } + } + }, + "flowQuals": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuals", + "type": "array", + "items": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items", + "type": "object", + "properties": { + "name": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items/name", + "type": "string", + "title": "Flow ind name", + "description": "Flow ind name", + "examples": [ + "name" + ] + }, + "year": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items/year", + "type": "integer", + "title": "Flow ind year", + "description": "Flow ind year", + "examples": [ + 2017 + ] + }, + "value": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items/value", + "type": "number", + "title": "Flow ind value", + "description": "Flow ind value", + "examples": [ + 11 + ] + } + } + } + }, + "flowQuants": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuants", + "type": "array", + "items": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items", + "type": "object", + "properties": { + "name": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items/name", + "type": "string", + "title": "Flow ind name", + "description": "Flow ind name", + "examples": [ + "name" + ] + }, + "year": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items/year", + "type": "integer", + "title": "Flow ind year", + "description": "Flow ind year", + "examples": [ + 2017 + ] + }, + "value": { + "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items/value", + "type": "number", + "title": "Flow ind value", + "description": "Flow ind value", + "examples": [ + 11 + ] + } + } + } + } + } + } + }, + "nodeIndicators": { + "$id": "/properties/data/properties/nodeIndicators", + "type": "array", + "items": { + "$id": "/properties/data/properties/nodeIndicators/items", + "type": "object", + "properties": { + "commodity": { + "$id": "/properties/data/properties/nodeIndicators/items/commodity", + "type": "string", + "title": "Commodity name", + "description": "Commodity name", + "examples": [ + "name" + ] + }, + "country": { + "$id": "/properties/data/properties/nodeIndicators/items/country", + "type": "string", + "title": "Country iso2", + "description": "Country iso2", + "examples": [ + "iso2" + ] + }, + "nodeInds": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeInds", + "type": "array", + "items": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items", + "type": "object", + "properties": { + "name": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items/name", + "type": "string", + "title": "Flow ind name", + "description": "Flow ind name", + "examples": [ + "name" + ] + }, + "year": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items/year", + "type": "integer", + "title": "Flow ind year", + "description": "Flow ind year", + "examples": [ + 2017 + ] + }, + "value": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items/value", + "type": "number", + "title": "Flow ind value", + "description": "Flow ind value", + "examples": [ + 11 + ] + } + } + } + }, + "nodeQuals": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals", + "type": "array", + "items": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items", + "type": "object", + "properties": { + "name": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items/name", + "type": "string", + "title": "Flow ind name", + "description": "Flow ind name", + "examples": [ + "name" + ] + }, + "year": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items/year", + "type": "integer", + "title": "Flow ind year", + "description": "Flow ind year", + "examples": [ + 2017 + ] + }, + "value": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items/value", + "type": "number", + "title": "Flow ind value", + "description": "Flow ind value", + "examples": [ + 11 + ] + } + } + } + }, + "nodeQuants": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants", + "type": "array", + "items": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items", + "type": "object", + "properties": { + "name": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items/name", + "type": "string", + "title": "Flow ind name", + "description": "Flow ind name", + "examples": [ + "name" + ] + }, + "year": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items/year", + "type": "integer", + "title": "Flow ind year", + "description": "Flow ind year", + "examples": [ + 2017 + ] + }, + "value": { + "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items/value", + "type": "number", + "title": "Flow ind value", + "description": "Flow ind value", + "examples": [ + 11 + ] + } + } + } + } + } + } + } + } + } + } +} From 8a1ad042e94c192a25eaf716635516d0112b68bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Gonz=C3=A1lez?= Date: Fri, 8 Nov 2019 19:16:13 +0100 Subject: [PATCH 07/11] Upgrade response of node data endpoint --- .../api/public/node/node_serializer.rb | 4 +- app/services/api/public/node/filter.rb | 34 ++- spec/services/api/public/node/filter_spec.rb | 21 +- spec/support/schemas/public_node_data.json | 226 +++--------------- 4 files changed, 72 insertions(+), 213 deletions(-) diff --git a/app/serializers/api/public/node/node_serializer.rb b/app/serializers/api/public/node/node_serializer.rb index 211127ef02..4854eaa900 100644 --- a/app/serializers/api/public/node/node_serializer.rb +++ b/app/serializers/api/public/node/node_serializer.rb @@ -6,8 +6,8 @@ class NodeSerializer < ActiveModel::Serializer :node_type, :geo_id, :availability, - :node_indicators, - :flow_indicators + :node_attributes, + :flow_attributes end end end diff --git a/app/services/api/public/node/filter.rb b/app/services/api/public/node/filter.rb index 339db5743c..ccf6ba80fd 100644 --- a/app/services/api/public/node/filter.rb +++ b/app/services/api/public/node/filter.rb @@ -49,45 +49,51 @@ def select_clause 'DISTINCT JSONB_BUILD_OBJECT(' \ '\'country\', contexts_mv.iso2, ' \ '\'commodity\', contexts_mv.commodity_name, ' \ - "'node_quants', #{select_node_clause('quants')}, " \ - "'node_quals', #{select_node_clause('quals')}, " \ - "'node_inds', #{select_node_clause('inds')}" \ + "'values', #{select_node_attributes_clause}" \ ')' \ - ') AS node_indicators', + ') AS node_attributes', 'JSON_AGG(' \ 'DISTINCT JSONB_BUILD_OBJECT(' \ '\'country\', contexts_mv.iso2, ' \ '\'commodity\', contexts_mv.commodity_name, ' \ '\'flow_id\', flow_nodes_mv.flow_id, ' \ - "'flow_quants', #{select_flow_clause('quants')}, " \ - "'flow_quals', #{select_flow_clause('quals')}, " \ - "'flow_inds', #{select_flow_clause('inds')}" \ + "'values', #{select_flow_attributes_clause}" \ ')' \ - ') AS flow_indicators' + ') AS flow_attributes' ] end + def select_node_attributes_clause + "#{select_node_clause('quants')} || " \ + "#{select_node_clause('quals')} || " \ + "#{select_node_clause('inds')}" + end + def select_node_clause(node_type) 'ARRAY(' \ 'SELECT JSONB_BUILD_OBJECT(' \ - "'name', #{node_type}.name, " \ + "'id', node_#{node_type}.#{node_type.singularize}_id, " \ '\'year\', year, ' \ '\'value\', value) ' \ "FROM node_#{node_type} " \ - "INNER JOIN #{node_type} ON #{node_type}.id = node_#{node_type}.#{node_type.singularize}_id " \ "WHERE node_#{node_type}.node_id = flow_nodes_mv.node_id AND " \ "node_#{node_type}.year = flow_nodes_mv.year" \ ')' end + def select_flow_attributes_clause + "#{select_flow_clause('quants')} || " \ + "#{select_flow_clause('quals')} || " \ + "#{select_flow_clause('inds')}" + end + def select_flow_clause(flow_type) 'ARRAY(' \ 'SELECT JSON_BUILD_OBJECT(' \ - "'name', #{flow_type}.name, " \ + "'id', flow_#{flow_type}.#{flow_type.singularize}_id, " \ '\'year\', year, ' \ '\'value\', value) ' \ "FROM flow_#{flow_type} " \ - "INNER JOIN #{flow_type} ON #{flow_type}.id = flow_#{flow_type}.#{flow_type.singularize}_id " \ "WHERE flow_#{flow_type}.flow_id = flow_nodes_mv.flow_id" \ ')' end @@ -117,7 +123,9 @@ def apply_node_id_filter def apply_year_filter return unless @node_id - @query = @query.where('flow_nodes_mv.year' => @year) + @query = @query.where( + 'flow_nodes_mv.year IS NULL OR flow_nodes_mv.year = ?', @year + ) end end end diff --git a/spec/services/api/public/node/filter_spec.rb b/spec/services/api/public/node/filter_spec.rb index ddd89809da..d81892909f 100644 --- a/spec/services/api/public/node/filter_spec.rb +++ b/spec/services/api/public/node/filter_spec.rb @@ -28,17 +28,16 @@ expect(attrs['availability'].first['country']).to eql(node.context.country.iso2) expect(attrs['availability'].first['commodity']).to eql(node.context.commodity_name) expect(attrs['availability'].first['years']).to eql(node.years) - - flows_ids = attrs['flow_indicators'].map { |fi| fi['flow_id'] } - expect(flows_ids).to eql( - Api::V3::Readonly::FlowNode.where(node_id: node.id).map(&:flow_id) - ) - flow_quants_values = attrs['flow_indicators']. - map { |fi| fi['flow_quants'] }. - flatten. - map { |fq| fq['value'] } - expect(flow_quants_values).to match_array( - Api::V3::FlowQuant.where(flow_id: flows_ids).map(&:value).map(&:to_i) + flows_ids = Api::V3::Readonly::FlowNode.where( + node_id: api_v3_biome_node.id + ).map(&:flow_id).uniq + flow_values = attrs['flow_attributes']. + map { |fi| fi['values'] }.flatten. + map { |fq| fq['value'] }.flatten + expect(flow_values).to match_array( + Api::V3::FlowQuant.where(flow_id: flows_ids).map(&:value).map(&:to_i) + + Api::V3::FlowQual.where(flow_id: flows_ids).map(&:value).map(&:to_i) + + Api::V3::FlowInd.where(flow_id: flows_ids).map(&:value).map(&:to_i) ) end end diff --git a/spec/support/schemas/public_node_data.json b/spec/support/schemas/public_node_data.json index 9e787b0a07..51eea55a32 100644 --- a/spec/support/schemas/public_node_data.json +++ b/spec/support/schemas/public_node_data.json @@ -81,15 +81,15 @@ } } }, - "flowIndicators": { - "$id": "/properties/data/properties/flowIndicators", + "flowAttributes": { + "$id": "/properties/data/properties/flowAttributes", "type": "array", "items": { - "$id": "/properties/data/properties/flowIndicators/items", + "$id": "/properties/data/properties/flowAttributes/items", "type": "object", "properties": { "commodity": { - "$id": "/properties/data/properties/flowIndicators/items/commodity", + "$id": "/properties/data/properties/flowAttributes/items/commodity", "type": "string", "title": "Commodity name", "description": "Commodity name", @@ -98,7 +98,7 @@ ] }, "country": { - "$id": "/properties/data/properties/flowIndicators/items/country", + "$id": "/properties/data/properties/flowAttributes/items/country", "type": "string", "title": "Country iso2", "description": "Country iso2", @@ -107,118 +107,44 @@ ] }, "flowId": { - "$id": "/properties/data/properties/flowIndicators/items/flowId", + "$id": "/properties/data/properties/flowAttributes/items/flowId", "type": "integer", - "title": "Flow Id", + "title": "Flow ID", "description": "ID of the flow", "examples": [ - 2015 + 111 ] }, - "flowInds": { - "$id": "/properties/data/properties/flowIndicators/items/flowInds", + "values": { + "$id": "/properties/data/properties/flowAttributes/items/values", "type": "array", "items": { - "$id": "/properties/data/properties/flowIndicators/items/flowInds/items", + "$id": "/properties/data/properties/flowAttributes/items/values/items", "type": "object", "properties": { "name": { - "$id": "/properties/data/properties/flowIndicators/items/flowInds/items/name", - "type": "string", - "title": "Flow ind name", - "description": "Flow ind name", - "examples": [ - "name" - ] - }, - "year": { - "$id": "/properties/data/properties/flowIndicators/items/flowInds/items/year", + "$id": "/properties/data/properties/flowAttributes/items/values/items/id", "type": "integer", - "title": "Flow ind year", - "description": "Flow ind year", - "examples": [ - 2017 - ] - }, - "value": { - "$id": "/properties/data/properties/flowIndicators/items/flowInds/items/value", - "type": "number", - "title": "Flow ind value", - "description": "Flow ind value", - "examples": [ - 11 - ] - } - } - } - }, - "flowQuals": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuals", - "type": "array", - "items": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items", - "type": "object", - "properties": { - "name": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items/name", - "type": "string", - "title": "Flow ind name", - "description": "Flow ind name", - "examples": [ - "name" - ] - }, - "year": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items/year", - "type": "integer", - "title": "Flow ind year", - "description": "Flow ind year", - "examples": [ - 2017 - ] - }, - "value": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuals/items/value", - "type": "number", - "title": "Flow ind value", - "description": "Flow ind value", - "examples": [ - 11 - ] - } - } - } - }, - "flowQuants": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuants", - "type": "array", - "items": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items", - "type": "object", - "properties": { - "name": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items/name", - "type": "string", - "title": "Flow ind name", - "description": "Flow ind name", + "title": "Attribute ID", + "description": "ID of the attribute", "examples": [ - "name" + 10 ] }, "year": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items/year", + "$id": "/properties/data/properties/flowAttributes/items/values/items/year", "type": "integer", - "title": "Flow ind year", - "description": "Flow ind year", + "title": "Flow attribute year", + "description": "Flow attribute year", "examples": [ 2017 ] }, "value": { - "$id": "/properties/data/properties/flowIndicators/items/flowQuants/items/value", + "$id": "/properties/data/properties/flowAttributes/items/values/items/value", "type": "number", - "title": "Flow ind value", - "description": "Flow ind value", + "title": "Flow attribute value", + "description": "Flow attribute value", "examples": [ 11 ] @@ -229,15 +155,15 @@ } } }, - "nodeIndicators": { - "$id": "/properties/data/properties/nodeIndicators", + "nodeAttributes": { + "$id": "/properties/data/properties/nodeAttributes", "type": "array", "items": { - "$id": "/properties/data/properties/nodeIndicators/items", + "$id": "/properties/data/properties/nodeAttributes/items", "type": "object", "properties": { "commodity": { - "$id": "/properties/data/properties/nodeIndicators/items/commodity", + "$id": "/properties/data/properties/nodeAttributes/items/commodity", "type": "string", "title": "Commodity name", "description": "Commodity name", @@ -246,7 +172,7 @@ ] }, "country": { - "$id": "/properties/data/properties/nodeIndicators/items/country", + "$id": "/properties/data/properties/nodeAttributes/items/country", "type": "string", "title": "Country iso2", "description": "Country iso2", @@ -254,110 +180,36 @@ "iso2" ] }, - "nodeInds": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeInds", + "values": { + "$id": "/properties/data/properties/nodeAttributes/items/values", "type": "array", "items": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items", + "$id": "/properties/data/properties/nodeAttributes/items/values/items", "type": "object", "properties": { - "name": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items/name", - "type": "string", - "title": "Flow ind name", - "description": "Flow ind name", - "examples": [ - "name" - ] - }, - "year": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items/year", + "id": { + "$id": "/properties/data/properties/nodeAttributes/items/values/items/id", "type": "integer", - "title": "Flow ind year", - "description": "Flow ind year", - "examples": [ - 2017 - ] - }, - "value": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeInds/items/value", - "type": "number", - "title": "Flow ind value", - "description": "Flow ind value", + "title": "Flow attribute id", + "description": "Flow attribute id", "examples": [ 11 ] - } - } - } - }, - "nodeQuals": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals", - "type": "array", - "items": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items", - "type": "object", - "properties": { - "name": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items/name", - "type": "string", - "title": "Flow ind name", - "description": "Flow ind name", - "examples": [ - "name" - ] - }, - "year": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items/year", - "type": "integer", - "title": "Flow ind year", - "description": "Flow ind year", - "examples": [ - 2017 - ] - }, - "value": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuals/items/value", - "type": "number", - "title": "Flow ind value", - "description": "Flow ind value", - "examples": [ - 11 - ] - } - } - } - }, - "nodeQuants": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants", - "type": "array", - "items": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items", - "type": "object", - "properties": { - "name": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items/name", - "type": "string", - "title": "Flow ind name", - "description": "Flow ind name", - "examples": [ - "name" - ] }, "year": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items/year", + "$id": "/properties/data/properties/nodeAttributes/items/values/items/year", "type": "integer", - "title": "Flow ind year", - "description": "Flow ind year", + "title": "Flow attribute year", + "description": "Flow attribute year", "examples": [ 2017 ] }, "value": { - "$id": "/properties/data/properties/nodeIndicators/items/nodeQuants/items/value", + "$id": "/properties/data/properties/nodeAttributes/items/values/items/value", "type": "number", - "title": "Flow ind value", - "description": "Flow ind value", + "title": "Flow attribute value", + "description": "Flow attribute value", "examples": [ 11 ] From 85122918361c490f4a0b7499ed3e278cc1f3a66d Mon Sep 17 00:00:00 2001 From: sorodrigo Date: Fri, 8 Nov 2019 13:02:04 -0600 Subject: [PATCH 08/11] fix: indonesia ports layer --- frontend/gis/vector_maps/main.sh | 2 +- .../INDONESIA_PORT_OF_EXPORT.topo.json | 1642 ++++++++++++++++- .../tool/map/map.component.js | 6 +- 3 files changed, 1645 insertions(+), 5 deletions(-) diff --git a/frontend/gis/vector_maps/main.sh b/frontend/gis/vector_maps/main.sh index c6a1c89cce..42efb1b044 100755 --- a/frontend/gis/vector_maps/main.sh +++ b/frontend/gis/vector_maps/main.sh @@ -25,7 +25,7 @@ ${BIN}/mapshaper tmp/PARAGUAY_DEPARTMENT.json -simplify rdp 30% planar keep-shap ${BIN}/cartodb -u p2cs-sei -f geojson 'SELECT the_geom, simple_name as name, geoid FROM paraguay_ecoregions_2018_11_14' > tmp/PARAGUAY_BIOME.json ${BIN}/mapshaper tmp/PARAGUAY_BIOME.json -simplify rdp 30% planar keep-shapes -o public/vector_layers/PARAGUAY_BIOME.topo.json format=topojson -# ${BIN}/cartodb -u p2cs-sei -f topojson 'SELECT distinct on (geoid, port, latitude, longitude) the_geom, geoid, port as name FROM indonesia_ports_20190620' > public/vector_layers/INDONESIA_PORT_OF_EXPORT.topo.json +#${BIN}/cartodb -u p2cs-sei -f topojson 'SELECT distinct on (geoid, port, latitude, longitude) the_geom, geoid, port as name FROM indonesia_ports_20191031' > public/vector_layers/INDONESIA_PORT_OF_EXPORT.topo.json ${BIN}/cartodb -u p2cs-sei -f geojson 'SELECT the_geom, kab as name, geoid FROM indonesia_kabupaten_boundaries_2016_20190613' > tmp/INDONESIA_KABUPATEN.json ${BIN}/mapshaper tmp/INDONESIA_KABUPATEN.json -simplify rdp 30% planar keep-shapes -o public/vector_layers/INDONESIA_KABUPATEN.topo.json format=topojson diff --git a/frontend/public/vector_layers/INDONESIA_PORT_OF_EXPORT.topo.json b/frontend/public/vector_layers/INDONESIA_PORT_OF_EXPORT.topo.json index 8c73054605..c859099b9f 100644 --- a/frontend/public/vector_layers/INDONESIA_PORT_OF_EXPORT.topo.json +++ b/frontend/public/vector_layers/INDONESIA_PORT_OF_EXPORT.topo.json @@ -1 +1,1641 @@ -{"type":"Topology","arcs":[],"objects":{"indonesia_ports_7_nov_2018":{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[116.816667,-1.25],"properties":{"CD_NAME":"BALIKPAPAN","LATITUDE":-1.25,"LONGITUDE":116.81667,"ORIG_ID":"16919","GEO_ID":"WPI-51840"}},{"type":"Point","coordinates":[104.038078,1.167589],"properties":{"CD_NAME":"BATAM ISLAND","LATITUDE":1.16759,"LONGITUDE":104.03808,"ORIG_ID":"16924","GEO_ID":"ID-PORT-1008"}},{"type":"Point","coordinates":[98.683333,3.783333],"properties":{"CD_NAME":"BELAWAN","LATITUDE":3.78333,"LONGITUDE":98.68333,"ORIG_ID":"16929","GEO_ID":"WPI-50730"}},{"type":"Point","coordinates":[117.505548,0.132065],"properties":{"CD_NAME":"BERAU","LATITUDE":0.13206,"LONGITUDE":117.50555,"ORIG_ID":"16931","GEO_ID":"ID-PORT-1014"}},{"type":"Point","coordinates":[125.183333,1.433333],"properties":{"CD_NAME":"BITUNG","LATITUDE":1.43333,"LONGITUDE":125.18333,"ORIG_ID":"16963","GEO_ID":"WPI-52065"}},{"type":"Point","coordinates":[105.783333,-1.633333],"properties":{"CD_NAME":"BLINYU","LATITUDE":-1.63333,"LONGITUDE":105.78333,"ORIG_ID":"16967","GEO_ID":"WPI-50180"}},{"type":"Point","coordinates":[101.45,1.683333],"properties":{"CD_NAME":"DUMAI","LATITUDE":1.68333,"LONGITUDE":101.45,"ORIG_ID":"17093","GEO_ID":"WPI-50785"}},{"type":"Point","coordinates":[112.65,-7.15],"properties":{"CD_NAME":"GRESIK","LATITUDE":-7.15,"LONGITUDE":112.65,"ORIG_ID":"17243","GEO_ID":"WPI-51120"}},{"type":"Point","coordinates":[103.659715,-1.533524],"properties":{"CD_NAME":"JAMBI","LATITUDE":-1.53352,"LONGITUDE":103.65972,"ORIG_ID":"17348","GEO_ID":"ID-PORT-1028"}},{"type":"Point","coordinates":[104.135104,1.072841],"properties":{"CD_NAME":"KABIL/PANAU","LATITUDE":1.07284,"LONGITUDE":104.1351,"ORIG_ID":"17380","GEO_ID":"ID-PORT-1032"}},{"type":"Point","coordinates":[116.216667,-3.233333],"properties":{"CD_NAME":"KOTA BARU","LATITUDE":-3.23333,"LONGITUDE":116.21667,"ORIG_ID":"17420","GEO_ID":"WPI-51860"}},{"type":"Point","coordinates":[99.466667,3.35],"properties":{"CD_NAME":"KUALA TANJUNG","LATITUDE":3.35,"LONGITUDE":99.46667,"ORIG_ID":"17424","GEO_ID":"WPI-50518"}},{"type":"Point","coordinates":[111.716667,-2.75],"properties":{"CD_NAME":"KUMAI","LATITUDE":-2.75,"LONGITUDE":111.71667,"ORIG_ID":"17426","GEO_ID":"WPI-51920"}},{"type":"Point","coordinates":[118.931083,-2.695528],"properties":{"CD_NAME":"MAMUJU","LATITUDE":-2.69553,"LONGITUDE":118.93108,"ORIG_ID":"18620","GEO_ID":"ID-PORT-1050"}},{"type":"Point","coordinates":[108.289649,-2.846932],"properties":{"CD_NAME":"MANGGAR","LATITUDE":-2.84693,"LONGITUDE":108.28965,"ORIG_ID":"18624","GEO_ID":"ID-PORT-1051"}},{"type":"Point","coordinates":[117.666502,4.137294],"properties":{"CD_NAME":"NUNUKAN","LATITUDE":4.13729,"LONGITUDE":117.6665,"ORIG_ID":"17757","GEO_ID":"ID-PORT-1061"}},{"type":"Point","coordinates":[104.7928355,-2.997040625],"properties":{"CD_NAME":"PALEMBANG","LATITUDE":-2.99704,"LONGITUDE":104.79284,"ORIG_ID":"17807","GEO_ID":"WPI-50330"}},{"type":"Point","coordinates":[105.316667,-5.466667],"properties":{"CD_NAME":"PANJANG","LATITUDE":-5.46667,"LONGITUDE":105.31667,"ORIG_ID":"17814","GEO_ID":"WPI-50380"}},{"type":"Point","coordinates":[119.855399,-0.710857],"properties":{"CD_NAME":"PANTOLOAN","LATITUDE":-0.71086,"LONGITUDE":119.8554,"ORIG_ID":"18689","GEO_ID":"ID-PORT-1070"}},{"type":"Point","coordinates":[116.15,-3.3],"properties":{"CD_NAME":"PULAU LAUT","LATITUDE":-3.3,"LONGITUDE":116.15,"ORIG_ID":"18704","GEO_ID":"ID-PORT-1133"}},{"type":"Point","coordinates":[102.548115,-0.372535],"properties":{"CD_NAME":"RENGAT","LATITUDE":-0.37254,"LONGITUDE":102.54811,"ORIG_ID":"17941","GEO_ID":"ID-PORT-1086"}},{"type":"Point","coordinates":[117.116667,-0.516667],"properties":{"CD_NAME":"SAMARINDA","LATITUDE":-0.51667,"LONGITUDE":117.11667,"ORIG_ID":"18732","GEO_ID":"WPI-51820"}},{"type":"Point","coordinates":[113,-2.516667],"properties":{"CD_NAME":"SAMPIT","LATITUDE":-2.51667,"LONGITUDE":113,"ORIG_ID":"17980","GEO_ID":"WPI-51910"}},{"type":"Point","coordinates":[117.984427,0.983863],"properties":{"CD_NAME":"SANGKULIRANG","LATITUDE":0.98386,"LONGITUDE":117.98443,"ORIG_ID":"18735","GEO_ID":"ID-PORT-1091"}},{"type":"Point","coordinates":[112.787332,-7.379391],"properties":{"CD_NAME":"SURABAYA","LATITUDE":-7.37939,"LONGITUDE":112.78733,"ORIG_ID":"18777","GEO_ID":"WPI-51130"}},{"type":"Point","coordinates":[110.425306,-6.952292],"properties":{"CD_NAME":"TANJUNG EMAS","LATITUDE":-6.95229,"LONGITUDE":110.42531,"ORIG_ID":"18128","GEO_ID":"ID-PORT-1112"}},{"type":"Point","coordinates":[106.941111,-6.148722],"properties":{"CD_NAME":"TANJUNG PERAK","LATITUDE":-6.14872,"LONGITUDE":106.94111,"ORIG_ID":"18129","GEO_ID":"ID-PORT-1115"}},{"type":"Point","coordinates":[106.881651,-6.1023],"properties":{"CD_NAME":"TANJUNG PRIOK","LATITUDE":-6.1023,"LONGITUDE":106.88165,"ORIG_ID":"18130","GEO_ID":"ID-PORT-1117"}},{"type":"Point","coordinates":[107.629795,-2.739615],"properties":{"CD_NAME":"TANJUNGPANDAN","LATITUDE":-2.73962,"LONGITUDE":107.6298,"ORIG_ID":"18131","GEO_ID":"WPI-50250"}},{"type":"Point","coordinates":[105.3609885,-5.546749595],"properties":{"CD_NAME":"TARAHAN","LATITUDE":-5.54675,"LONGITUDE":105.36099,"ORIG_ID":"18132","GEO_ID":"ID-PORT-1130"}},{"type":"Point","coordinates":[116.1133005,-3.27900088],"properties":{"CD_NAME":"TARJUN","LATITUDE":-3.279,"LONGITUDE":116.1133,"ORIG_ID":"18133","GEO_ID":"ID-PORT-1131"}},{"type":"Point","coordinates":[100.333333,-0.95],"properties":{"CD_NAME":"TELUK BAYUR","LATITUDE":-0.95,"LONGITUDE":100.33333,"ORIG_ID":"18142","GEO_ID":"WPI-50450"}},{"type":"Point","coordinates":[115.167771,-8.747279],"properties":{"CD_NAME":"DENPASAR / NGURAH RAI (U)","LATITUDE":-8.74728,"LONGITUDE":115.16777,"ORIG_ID":"17077","GEO_ID":"ID-PORT-1060"}},{"type":"Point","coordinates":[98.68254,3.769393],"properties":{"CD_NAME":"MEDAN / POLONIA (U)","LATITUDE":3.76939,"LONGITUDE":98.68254,"ORIG_ID":"17661","GEO_ID":"ID-PORT-1054"}},{"type":"Point","coordinates":[104.700395,-2.897433],"properties":{"CD_NAME":"SM. BADARUDDIN (U)","LATITUDE":-2.89743,"LONGITUDE":104.7004,"ORIG_ID":"18046","GEO_ID":"ID-PORT-1100"}},{"type":"Point","coordinates":[106.65589,-6.12508],"properties":{"CD_NAME":"SOEKARNO-HATTA (U)","LATITUDE":-6.12508,"LONGITUDE":106.65589,"ORIG_ID":"18055","GEO_ID":"ID-PORT-1101"}}]}},"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}} +{"type":"Topology","transform":{"scale":[0.00420401310131013,0.0012828784878487847],"translate":[98.677366,-8.745783]},"objects": { "indonesia_ports": { "type":"GeometryCollection","geometries": [ + { + "type": "Point", + "coordinates": [ + 2848, + 4649 + ], + "properties": { + "geoid": "ID-PORT-0001", + "name": "AIR HITAM" + } + }, + { + "type": "Point", + "coordinates": [ + 9928, + 1634 + ], + "properties": { + "geoid": "ID-PORT-0002", + "name": "ASIKE" + } + }, + { + "type": "Point", + "coordinates": [ + 3390, + 4697 + ], + "properties": { + "geoid": "ID-PORT-0003", + "name": "BAGENDANG" + } + }, + { + "type": "Point", + "coordinates": [ + 5470, + 5122 + ], + "properties": { + "geoid": "ID-PORT-0004", + "name": "BAHUMBELU" + } + }, + { + "type": "Point", + "coordinates": [ + 4315, + 5839 + ], + "properties": { + "geoid": "ID-PORT-0005", + "name": "BALIKPAPAN" + } + }, + { + "type": "Point", + "coordinates": [ + 3739, + 481 + ], + "properties": { + "geoid": "ID-PORT-0006", + "name": "BANYUWANGI" + } + }, + { + "type": "Point", + "coordinates": [ + 1266, + 7729 + ], + "properties": { + "geoid": "ID-PORT-0007", + "name": "BATU AMPAR" + } + }, + { + "type": "Point", + "coordinates": [ + 4122, + 4117 + ], + "properties": { + "geoid": "ID-PORT-0008", + "name": "BATULICIN" + } + }, + { + "type": "Point", + "coordinates": [ + 958, + 6442 + ], + "properties": { + "geoid": "ID-PORT-0009", + "name": "BAYAS" + } + }, + { + "type": "Point", + "coordinates": [ + 4, + 9767 + ], + "properties": { + "geoid": "ID-PORT-0010", + "name": "BELAWAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1678, + 5546 + ], + "properties": { + "geoid": "ID-PORT-0011", + "name": "BELINJU" + } + }, + { + "type": "Point", + "coordinates": [ + 2965, + 6896 + ], + "properties": { + "geoid": "ID-PORT-0012", + "name": "BELITANG" + } + }, + { + "type": "Point", + "coordinates": [ + 2132, + 4673 + ], + "properties": { + "geoid": "ID-PORT-0013", + "name": "BELITUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 862, + 3771 + ], + "properties": { + "geoid": "ID-PORT-0014", + "name": "BENGKULU" + } + }, + { + "type": "Point", + "coordinates": [ + 3932, + 3 + ], + "properties": { + "geoid": "ID-PORT-0015", + "name": "BENOA" + } + }, + { + "type": "Point", + "coordinates": [ + 6299, + 7939 + ], + "properties": { + "geoid": "ID-PORT-0016", + "name": "BITUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 4903, + 5530 + ], + "properties": { + "geoid": "ID-PORT-0017", + "name": "BONE MANJING" + } + }, + { + "type": "Point", + "coordinates": [ + 4475, + 6958 + ], + "properties": { + "geoid": "ID-PORT-0018", + "name": "BONTANG" + } + }, + { + "type": "Point", + "coordinates": [ + 745, + 7400 + ], + "properties": { + "geoid": "ID-PORT-0019", + "name": "BUATAN" + } + }, + { + "type": "Point", + "coordinates": [ + 4290, + 5869 + ], + "properties": { + "geoid": "ID-PORT-0020", + "name": "BULUMINUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 3121, + 4770 + ], + "properties": { + "geoid": "ID-PORT-0021", + "name": "BUMI HARJO" + } + }, + { + "type": "Point", + "coordinates": [ + 3843, + 5479 + ], + "properties": { + "geoid": "ID-PORT-0022", + "name": "BUNTOK" + } + }, + { + "type": "Point", + "coordinates": [ + 5410, + 7746 + ], + "properties": { + "geoid": "ID-PORT-0023", + "name": "BUOL" + } + }, + { + "type": "Point", + "coordinates": [ + 1712, + 4157 + ], + "properties": { + "geoid": "ID-PORT-0024", + "name": "CENGAL" + } + }, + { + "type": "Point", + "coordinates": [ + 2353, + 1586 + ], + "properties": { + "geoid": "ID-PORT-0025", + "name": "CIREBON" + } + }, + { + "type": "Point", + "coordinates": [ + 1730, + 2123 + ], + "properties": { + "geoid": "ID-PORT-0026", + "name": "CIWANDAN" + } + }, + { + "type": "Point", + "coordinates": [ + 658, + 8131 + ], + "properties": { + "geoid": "ID-PORT-0027", + "name": "DUMAI" + } + }, + { + "type": "Point", + "coordinates": [ + 3326, + 1240 + ], + "properties": { + "geoid": "ID-PORT-0028", + "name": "GRESIK" + } + }, + { + "type": "Point", + "coordinates": [ + 1952, + 1932 + ], + "properties": { + "geoid": "ID-PORT-0029", + "name": "HALIM PERDANA KUSUMA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 1295, + 4779 + ], + "properties": { + "geoid": "ID-PORT-0030", + "name": "HINDOLI SUNGAI LILIN" + } + }, + { + "type": "Point", + "coordinates": [ + 9999, + 4833 + ], + "properties": { + "geoid": "ID-PORT-0031", + "name": "JAYAPURA" + } + }, + { + "type": "Point", + "coordinates": [ + 2782, + 1386 + ], + "properties": { + "geoid": "ID-PORT-0032", + "name": "JENDERAL ACHMAD YANI (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 3388, + 4690 + ], + "properties": { + "geoid": "ID-PORT-0033", + "name": "JETTY WILMAR - BAGENDANG" + } + }, + { + "type": "Point", + "coordinates": [ + 704, + 8104 + ], + "properties": { + "geoid": "ID-PORT-0034", + "name": "JETTY WILMAR - PELINTUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 4493, + 9410 + ], + "properties": { + "geoid": "ID-PORT-0035", + "name": "JUWATA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 1297, + 7653 + ], + "properties": { + "geoid": "ID-PORT-0036", + "name": "KABIL" + } + }, + { + "type": "Point", + "coordinates": [ + 3347, + 5169 + ], + "properties": { + "geoid": "ID-PORT-0038", + "name": "KABUAU" + } + }, + { + "type": "Point", + "coordinates": [ + 4308, + 5898 + ], + "properties": { + "geoid": "ID-PORT-0039", + "name": "KARIANGAU" + } + }, + { + "type": "Point", + "coordinates": [ + 2519, + 7899 + ], + "properties": { + "geoid": "ID-PORT-0040", + "name": "KARTIASA" + } + }, + { + "type": "Point", + "coordinates": [ + 2927, + 5148 + ], + "properties": { + "geoid": "ID-PORT-0041", + "name": "KELAMPAI" + } + }, + { + "type": "Point", + "coordinates": [ + 4279, + 9645 + ], + "properties": { + "geoid": "ID-PORT-0042", + "name": "KELAPIS" + } + }, + { + "type": "Point", + "coordinates": [ + 4295, + 5953 + ], + "properties": { + "geoid": "ID-PORT-0043", + "name": "KENANGAN" + } + }, + { + "type": "Point", + "coordinates": [ + 5447, + 3660 + ], + "properties": { + "geoid": "ID-PORT-0044", + "name": "KOLAKA" + } + }, + { + "type": "Point", + "coordinates": [ + 954, + 6449 + ], + "properties": { + "geoid": "ID-PORT-0045", + "name": "KUALA CENAKU" + } + }, + { + "type": "Point", + "coordinates": [ + 3705, + 4209 + ], + "properties": { + "geoid": "ID-PORT-0046", + "name": "KUALA KAPUAS" + } + }, + { + "type": "Point", + "coordinates": [ + 47, + 9651 + ], + "properties": { + "geoid": "ID-PORT-0047", + "name": "KUALA NAMU (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 181, + 9443 + ], + "properties": { + "geoid": "ID-PORT-0048", + "name": "KUALA TANJUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 1137, + 6183 + ], + "properties": { + "geoid": "ID-PORT-0049", + "name": "KUALA TUNGKAL" + } + }, + { + "type": "Point", + "coordinates": [ + 3110, + 4699 + ], + "properties": { + "geoid": "ID-PORT-0050", + "name": "KUMAI" + } + }, + { + "type": "Point", + "coordinates": [ + 2598, + 7913 + ], + "properties": { + "geoid": "ID-PORT-0051", + "name": "KUMBA" + } + }, + { + "type": "Point", + "coordinates": [ + 4434, + 8448 + ], + "properties": { + "geoid": "ID-PORT-0052", + "name": "LABANAN" + } + }, + { + "type": "Point", + "coordinates": [ + 5617, + 4248 + ], + "properties": { + "geoid": "ID-PORT-0053", + "name": "LAMERURU" + } + }, + { + "type": "Point", + "coordinates": [ + 4372, + 6359 + ], + "properties": { + "geoid": "ID-PORT-0054", + "name": "LOA DURI" + } + }, + { + "type": "Point", + "coordinates": [ + 639, + 8183 + ], + "properties": { + "geoid": "ID-PORT-0055", + "name": "LUBUK GAUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 4931, + 2827 + ], + "properties": { + "geoid": "ID-PORT-0056", + "name": "MAKASSAR" + } + }, + { + "type": "Point", + "coordinates": [ + 4592, + 7534 + ], + "properties": { + "geoid": "ID-PORT-0057", + "name": "MALOY" + } + }, + { + "type": "Point", + "coordinates": [ + 4808, + 4734 + ], + "properties": { + "geoid": "ID-PORT-0058", + "name": "MAMUJU" + } + }, + { + "type": "Point", + "coordinates": [ + 2286, + 4597 + ], + "properties": { + "geoid": "ID-PORT-0059", + "name": "MANGGAR" + } + }, + { + "type": "Point", + "coordinates": [ + 8420, + 6140 + ], + "properties": { + "geoid": "ID-PORT-0060", + "name": "MANOKWARI" + } + }, + { + "type": "Point", + "coordinates": [ + 3826, + 4496 + ], + "properties": { + "geoid": "ID-PORT-0061", + "name": "MARABAHAN" + } + }, + { + "type": "Point", + "coordinates": [ + 2734, + 5962 + ], + "properties": { + "geoid": "ID-PORT-0062", + "name": "MATAN JAYA" + } + }, + { + "type": "Point", + "coordinates": [ + 2761, + 6734 + ], + "properties": { + "geoid": "ID-PORT-0063", + "name": "MELIAU" + } + }, + { + "type": "Point", + "coordinates": [ + 4304, + 7220 + ], + "properties": { + "geoid": "ID-PORT-0066", + "name": "MUARA BENGKAL" + } + }, + { + "type": "Point", + "coordinates": [ + 1230, + 5936 + ], + "properties": { + "geoid": "ID-PORT-0067", + "name": "MUARA SABAK" + } + }, + { + "type": "Point", + "coordinates": [ + 3140, + 7618 + ], + "properties": { + "geoid": "ID-PORT-0068", + "name": "NANGA BADAU" + } + }, + { + "type": "Point", + "coordinates": [ + 3922, + 0 + ], + "properties": { + "geoid": "ID-PORT-0069", + "name": "NGURAH RAI (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 1097, + 6942 + ], + "properties": { + "geoid": "ID-PORT-0070", + "name": "NYATO/PULAI" + } + }, + { + "type": "Point", + "coordinates": [ + 3345, + 5022 + ], + "properties": { + "geoid": "ID-PORT-0071", + "name": "PALANGAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1451, + 4493 + ], + "properties": { + "geoid": "ID-PORT-0072", + "name": "PALEMBANG" + } + }, + { + "type": "Point", + "coordinates": [ + 4200, + 4919 + ], + "properties": { + "geoid": "ID-PORT-0073", + "name": "PAMUKAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1771, + 5185 + ], + "properties": { + "geoid": "ID-PORT-0074", + "name": "PANGKAL BALAM" + } + }, + { + "type": "Point", + "coordinates": [ + 3137, + 4872 + ], + "properties": { + "geoid": "ID-PORT-0075", + "name": "PANGKALAN BANTENG" + } + }, + { + "type": "Point", + "coordinates": [ + 809, + 7978 + ], + "properties": { + "geoid": "ID-PORT-0076", + "name": "PANGKALAN BATANG" + } + }, + { + "type": "Point", + "coordinates": [ + 0, + 9597 + ], + "properties": { + "geoid": "ID-PORT-0077", + "name": "PANGKALAN UDARA SOEWONDO/POLONIA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 1579, + 2550 + ], + "properties": { + "geoid": "ID-PORT-0078", + "name": "PANJANG" + } + }, + { + "type": "Point", + "coordinates": [ + 5037, + 6263 + ], + "properties": { + "geoid": "ID-PORT-0079", + "name": "PANTOLOAN" + } + }, + { + "type": "Point", + "coordinates": [ + 3359, + 5235 + ], + "properties": { + "geoid": "ID-PORT-0080", + "name": "PARENGGEAN" + } + }, + { + "type": "Point", + "coordinates": [ + 4551, + 7771 + ], + "properties": { + "geoid": "ID-PORT-0081", + "name": "PENGADAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1475, + 4510 + ], + "properties": { + "geoid": "ID-PORT-0082", + "name": "PERAJEN" + } + }, + { + "type": "Point", + "coordinates": [ + 706, + 7348 + ], + "properties": { + "geoid": "ID-PORT-0083", + "name": "PERAWANG, SUMATRA" + } + }, + { + "type": "Point", + "coordinates": [ + 1163, + 4676 + ], + "properties": { + "geoid": "ID-PORT-0084", + "name": "PINAGO UTAMA" + } + }, + { + "type": "Point", + "coordinates": [ + 4310, + 6595 + ], + "properties": { + "geoid": "ID-PORT-0086", + "name": "PMM JETTY, MUARA KAMAN" + } + }, + { + "type": "Point", + "coordinates": [ + 4180, + 5410 + ], + "properties": { + "geoid": "ID-PORT-0087", + "name": "PONDONG" + } + }, + { + "type": "Point", + "coordinates": [ + 2529, + 6820 + ], + "properties": { + "geoid": "ID-PORT-0088", + "name": "PONTIANAK" + } + }, + { + "type": "Point", + "coordinates": [ + 1065, + 6916 + ], + "properties": { + "geoid": "ID-PORT-0089", + "name": "PT. THIP NYATO" + } + }, + { + "type": "Point", + "coordinates": [ + 1065, + 6916 + ], + "properties": { + "geoid": "ID-PORT-0090", + "name": "PT. THIP NYATO PULAI" + } + }, + { + "type": "Point", + "coordinates": [ + 1068, + 6983 + ], + "properties": { + "geoid": "ID-PORT-0091", + "name": "PT. THIP PULAI" + } + }, + { + "type": "Point", + "coordinates": [ + 3704, + 4664 + ], + "properties": { + "geoid": "ID-PORT-0092", + "name": "PULANG PISAU" + } + }, + { + "type": "Point", + "coordinates": [ + 4562, + 7749 + ], + "properties": { + "geoid": "ID-PORT-0093", + "name": "RANTAU BAHAN, SANGKULIRANG" + } + }, + { + "type": "Point", + "coordinates": [ + 920, + 6525 + ], + "properties": { + "geoid": "ID-PORT-0094", + "name": "RENGAT" + } + }, + { + "type": "Point", + "coordinates": [ + 869, + 6542 + ], + "properties": { + "geoid": "ID-PORT-0095", + "name": "RENGAT/ JAPURA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 4440, + 9107 + ], + "properties": { + "geoid": "ID-PORT-0096", + "name": "SALIM BATU" + } + }, + { + "type": "Point", + "coordinates": [ + 4400, + 6379 + ], + "properties": { + "geoid": "ID-PORT-0097", + "name": "SAMARINDA" + } + }, + { + "type": "Point", + "coordinates": [ + 25, + 8165 + ], + "properties": { + "geoid": "ID-PORT-0098", + "name": "SAMBAS" + } + }, + { + "type": "Point", + "coordinates": [ + 3398, + 4839 + ], + "properties": { + "geoid": "ID-PORT-0099", + "name": "SAMPIT" + } + }, + { + "type": "Point", + "coordinates": [ + 2724, + 6776 + ], + "properties": { + "geoid": "ID-PORT-0100", + "name": "SANGGAU" + } + }, + { + "type": "Point", + "coordinates": [ + 3983, + 3881 + ], + "properties": { + "geoid": "ID-PORT-0101", + "name": "SATUI" + } + }, + { + "type": "Point", + "coordinates": [ + 4424, + 9999 + ], + "properties": { + "geoid": "ID-PORT-0102", + "name": "SEBAKIS" + } + }, + { + "type": "Point", + "coordinates": [ + 4361, + 6596 + ], + "properties": { + "geoid": "ID-PORT-0103", + "name": "SEBULU" + } + }, + { + "type": "Point", + "coordinates": [ + 2515, + 6609 + ], + "properties": { + "geoid": "ID-PORT-0104", + "name": "SEI DERAS" + } + }, + { + "type": "Point", + "coordinates": [ + 4150, + 5085 + ], + "properties": { + "geoid": "ID-PORT-0105", + "name": "SEI KERANG" + } + }, + { + "type": "Point", + "coordinates": [ + 1464, + 4483 + ], + "properties": { + "geoid": "ID-PORT-0106", + "name": "SEI LAIS PALEMBANG" + } + }, + { + "type": "Point", + "coordinates": [ + 2773, + 6737 + ], + "properties": { + "geoid": "ID-PORT-0107", + "name": "SEI MAYAM" + } + }, + { + "type": "Point", + "coordinates": [ + 2556, + 6799 + ], + "properties": { + "geoid": "ID-PORT-0108", + "name": "SEI TEMPAYAN" + } + }, + { + "type": "Point", + "coordinates": [ + 2976, + 6880 + ], + "properties": { + "geoid": "ID-PORT-0109", + "name": "SEKADAU" + } + }, + { + "type": "Point", + "coordinates": [ + 4398, + 9376 + ], + "properties": { + "geoid": "ID-PORT-0111", + "name": "SEKATAK" + } + }, + { + "type": "Point", + "coordinates": [ + 267, + 9145 + ], + "properties": { + "geoid": "ID-PORT-0112", + "name": "SEKUMULTI NABATI ASAHAN , PTNG" + } + }, + { + "type": "Point", + "coordinates": [ + 4173, + 4849 + ], + "properties": { + "geoid": "ID-PORT-0113", + "name": "SELABAK" + } + }, + { + "type": "Point", + "coordinates": [ + 2795, + 1399 + ], + "properties": { + "geoid": "ID-PORT-0114", + "name": "SEMARANG" + } + }, + { + "type": "Point", + "coordinates": [ + 805, + 7436 + ], + "properties": { + "geoid": "ID-PORT-0115", + "name": "SIAK" + } + }, + { + "type": "Point", + "coordinates": [ + 3063, + 6984 + ], + "properties": { + "geoid": "ID-PORT-0116", + "name": "SINTANG" + } + }, + { + "type": "Point", + "coordinates": [ + 2468, + 7751 + ], + "properties": { + "geoid": "ID-PORT-0117", + "name": "SINTETE" + } + }, + { + "type": "Point", + "coordinates": [ + 1897, + 2041 + ], + "properties": { + "geoid": "ID-PORT-0118", + "name": "SOEKARNO-HATTA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 4165, + 4269 + ], + "properties": { + "geoid": "ID-PORT-0119", + "name": "STAGEN" + } + }, + { + "type": "Point", + "coordinates": [ + 2683, + 5419 + ], + "properties": { + "geoid": "ID-PORT-0120", + "name": "SUKA BANGUN" + } + }, + { + "type": "Point", + "coordinates": [ + 1433, + 4559 + ], + "properties": { + "geoid": "ID-PORT-0121", + "name": "SULTAN MAHMUD BADARUDDIN (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 1181, + 5544 + ], + "properties": { + "geoid": "ID-PORT-0122", + "name": "SULTAN THAHA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 2584, + 6803 + ], + "properties": { + "geoid": "ID-PORT-0123", + "name": "SUNGAI AMBAWANG" + } + }, + { + "type": "Point", + "coordinates": [ + 2550, + 6742 + ], + "properties": { + "geoid": "ID-PORT-0124", + "name": "SUNGAI DURIAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1172, + 7044 + ], + "properties": { + "geoid": "ID-PORT-0125", + "name": "SUNGAI GUNTUNG" + } + }, + { + "type": "Point", + "coordinates": [ + 4419, + 6372 + ], + "properties": { + "geoid": "ID-PORT-0126", + "name": "SUNGAI MERIAM" + } + }, + { + "type": "Point", + "coordinates": [ + 3857, + 4526 + ], + "properties": { + "geoid": "ID-PORT-0128", + "name": "SUNGAI SALAI" + } + }, + { + "type": "Point", + "coordinates": [ + 2551, + 6702 + ], + "properties": { + "geoid": "ID-PORT-0129", + "name": "SUPADIO (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 3357, + 1067 + ], + "properties": { + "geoid": "ID-PORT-0130", + "name": "SURABAYA /JUANDA (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 1185, + 5621 + ], + "properties": { + "geoid": "ID-PORT-0131", + "name": "TALANG DUKU" + } + }, + { + "type": "Point", + "coordinates": [ + 4156, + 5396 + ], + "properties": { + "geoid": "ID-PORT-0132", + "name": "TANAH MERAH/GROGOT" + } + }, + { + "type": "Point", + "coordinates": [ + 5697, + 5874 + ], + "properties": { + "geoid": "ID-PORT-0133", + "name": "TANGKIANG" + } + }, + { + "type": "Point", + "coordinates": [ + 4320, + 6566 + ], + "properties": { + "geoid": "ID-PORT-0134", + "name": "TANJUNG KARAS, BENUA PUHUN" + } + }, + { + "type": "Point", + "coordinates": [ + 2129, + 4677 + ], + "properties": { + "geoid": "ID-PORT-0135", + "name": "TANJUNG PANDAN" + } + }, + { + "type": "Point", + "coordinates": [ + 3345, + 1200 + ], + "properties": { + "geoid": "ID-PORT-0136", + "name": "TANJUNG PERAK" + } + }, + { + "type": "Point", + "coordinates": [ + 1951, + 2061 + ], + "properties": { + "geoid": "ID-PORT-0137", + "name": "TANJUNG PRIOK" + } + }, + { + "type": "Point", + "coordinates": [ + 4476, + 8499 + ], + "properties": { + "geoid": "ID-PORT-0138", + "name": "TANJUNG REDEP" + } + }, + { + "type": "Point", + "coordinates": [ + 2192, + 4406 + ], + "properties": { + "geoid": "ID-PORT-0139", + "name": "TANJUNG RESING" + } + }, + { + "type": "Point", + "coordinates": [ + 5120, + 4489 + ], + "properties": { + "geoid": "ID-PORT-0140", + "name": "TANJUNG RINGGIT" + } + }, + { + "type": "Point", + "coordinates": [ + 4444, + 9027 + ], + "properties": { + "geoid": "ID-PORT-0141", + "name": "TANJUNG SELOR" + } + }, + { + "type": "Point", + "coordinates": [ + 1317, + 7656 + ], + "properties": { + "geoid": "ID-PORT-0142", + "name": "TANJUNG UBAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1587, + 2509 + ], + "properties": { + "geoid": "ID-PORT-0143", + "name": "TARAHAN" + } + }, + { + "type": "Point", + "coordinates": [ + 4148, + 4267 + ], + "properties": { + "geoid": "ID-PORT-0144", + "name": "TARJUN" + } + }, + { + "type": "Point", + "coordinates": [ + 2713, + 6786 + ], + "properties": { + "geoid": "ID-PORT-0145", + "name": "TAYAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1420, + 7638 + ], + "properties": { + "geoid": "ID-PORT-0146", + "name": "TELUK BAKAU" + } + }, + { + "type": "Point", + "coordinates": [ + 403, + 6040 + ], + "properties": { + "geoid": "ID-PORT-0147", + "name": "TELUK BAYUR" + } + }, + { + "type": "Point", + "coordinates": [ + 1009, + 6414 + ], + "properties": { + "geoid": "ID-PORT-0148", + "name": "TEMBILAHAN" + } + }, + { + "type": "Point", + "coordinates": [ + 3780, + 4247 + ], + "properties": { + "geoid": "ID-PORT-0149", + "name": "TRISAKTI" + } + }, + { + "type": "Point", + "coordinates": [ + 2946, + 4740 + ], + "properties": { + "geoid": "ID-PORT-0150", + "name": "UAI" + } + }, + { + "type": "Point", + "coordinates": [ + 4964, + 2858 + ], + "properties": { + "geoid": "ID-PORT-0151", + "name": "UJUNG PANDANG / HASANUDDIN (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 2522, + 6826 + ], + "properties": { + "geoid": "ID-PORT-0152", + "name": "WAJOK" + } + }, + { + "type": "Point", + "coordinates": [ + 2796, + 747 + ], + "properties": { + "geoid": "ID-PORT-0153", + "name": "YOGYAKARTA / ADI SUCIPTO (U)" + } + }, + { + "type": "Point", + "coordinates": [ + 4499, + 9375 + ], + "properties": { + "geoid": "ID-PORT-0160", + "name": "LINGKAS TARAKAN" + } + }, + { + "type": "Point", + "coordinates": [ + 1119, + 6424 + ], + "properties": { + "geoid": "ID-PORT-0161", + "name": "KUALA ENOK" + } + } +]}},"arcs":[]} diff --git a/frontend/scripts/react-components/tool/map/map.component.js b/frontend/scripts/react-components/tool/map/map.component.js index ef180bd6b5..4548e6545d 100644 --- a/frontend/scripts/react-components/tool/map/map.component.js +++ b/frontend/scripts/react-components/tool/map/map.component.js @@ -197,8 +197,9 @@ export default class MapComponent { const boundsCenterZoom = this.map._getBoundsCenterZoom(bounds); this._setMapViewDebounced(boundsCenterZoom.center, boundsCenterZoom.zoom); } else { - const singlePoint = this.vectorOutline.getBounds().getCenter(); - this.map.setView(singlePoint); + const bounds = this.vectorOutline.getBounds(); + const boundsCenterZoom = this.map._getBoundsCenterZoom(bounds); + this.map.setView(bounds.getCenter(), boundsCenterZoom.zoom - 6); } } } @@ -376,7 +377,6 @@ export default class MapComponent { topoLayer.isPoint = isPoint; this._setEventsForTopoLayer(topoLayer); - return topoLayer; } From 00d2b2eb6d46bb615eee696cd7075bfbb29bacb4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2019 05:06:03 +0000 Subject: [PATCH 09/11] Bump annotate from 3.0.2 to 3.0.3 Bumps [annotate](https://github.com/ctran/annotate_models) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/ctran/annotate_models/releases) - [Changelog](https://github.com/ctran/annotate_models/blob/develop/CHANGELOG.rdoc) - [Commits](https://github.com/ctran/annotate_models/compare/v3.0.2...v3.0.3) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 08f5de30d4..9d23f3855c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,9 +78,9 @@ GEM public_suffix (>= 2.0.2, < 4.0) airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) - annotate (3.0.2) + annotate (3.0.3) activerecord (>= 3.2, < 7.0) - rake (>= 10.4, < 13.0) + rake (>= 10.4, < 14.0) appsignal (2.9.17) rack arbre (1.2.1) @@ -246,7 +246,7 @@ GEM mimemagic (0.3.3) mini_mime (1.0.1) mini_portile2 (2.4.0) - minitest (5.12.2) + minitest (5.13.0) msgpack (1.3.1) multipart-post (2.0.0) naught (1.1.0) @@ -314,7 +314,7 @@ GEM rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.0.0) - rake (12.3.3) + rake (13.0.0) ransack (2.3.0) actionpack (>= 5.0) activerecord (>= 5.0) From 747f11d6232bbddf252a90035209f2f361c6ffc9 Mon Sep 17 00:00:00 2001 From: Agnieszka Figiel Date: Mon, 11 Nov 2019 12:25:42 +0100 Subject: [PATCH 10/11] Moved countries & commodities endpoints under public API namespace --- .../api/public/commodities_controller.rb | 29 +++++++++++++++++++ .../{v3 => public}/countries_controller.rb | 8 ++--- .../api/v3/commodities_controller.rb | 20 ------------- .../v3/dashboards/commodities_controller.rb | 4 +-- .../api/v3/dashboards/countries_controller.rb | 4 +-- .../api/public/commodity_serializer.rb | 12 ++++++++ .../api/public/country_serializer.rb | 7 +++++ .../api/v3/dashboards/commodity_serializer.rb | 14 --------- .../api/v3/dashboards/country_serializer.rb | 9 ------ .../api/v3/dashboards/template_serializer.rb | 4 +-- .../api/{v3 => public}/filter_commodities.rb | 4 +-- .../api/{v3 => public}/filter_countries.rb | 4 +-- config/routes.rb | 11 +++++-- frontend/docs/swagger.yaml | 4 +++ .../commodities_controller_spec.rb | 4 +-- .../countries_controller_spec.rb | 6 ++-- 16 files changed, 79 insertions(+), 65 deletions(-) create mode 100644 app/controllers/api/public/commodities_controller.rb rename app/controllers/api/{v3 => public}/countries_controller.rb (70%) create mode 100644 app/serializers/api/public/commodity_serializer.rb create mode 100644 app/serializers/api/public/country_serializer.rb delete mode 100644 app/serializers/api/v3/dashboards/commodity_serializer.rb delete mode 100644 app/serializers/api/v3/dashboards/country_serializer.rb rename app/services/api/{v3 => public}/filter_commodities.rb (93%) rename app/services/api/{v3 => public}/filter_countries.rb (93%) rename spec/controllers/api/{v3 => public}/commodities_controller_spec.rb (82%) rename spec/controllers/api/{v3 => public}/countries_controller_spec.rb (83%) diff --git a/app/controllers/api/public/commodities_controller.rb b/app/controllers/api/public/commodities_controller.rb new file mode 100644 index 0000000000..cff49307ea --- /dev/null +++ b/app/controllers/api/public/commodities_controller.rb @@ -0,0 +1,29 @@ +module Api + module Public + class CommoditiesController < ApiController + include Api::V3::ParamHelpers + + skip_before_action :load_context + before_action :set_collection, only: [:index] + + def index + render json: @collection, + each_serializer: Api::Public::CommoditySerializer + end + + private + + def set_collection + @collection = Api::Public::FilterCommodities.new(filter_params).call + end + + def filter_params + { + countries_ids: cs_string_to_int_array(params[:countries_ids]), + commodities_ids: cs_string_to_int_array(params[:commodities_ids]), + include: params[:include] + } + end + end + end +end diff --git a/app/controllers/api/v3/countries_controller.rb b/app/controllers/api/public/countries_controller.rb similarity index 70% rename from app/controllers/api/v3/countries_controller.rb rename to app/controllers/api/public/countries_controller.rb index d7aa7d2c17..17dcd9e0aa 100644 --- a/app/controllers/api/v3/countries_controller.rb +++ b/app/controllers/api/public/countries_controller.rb @@ -1,20 +1,20 @@ module Api - module V3 + module Public class CountriesController < ApiController include Api::V3::ParamHelpers skip_before_action :load_context - before_action :set_collection, only: %i[index] + before_action :set_collection, only: [:index] def index render json: @collection, - each_serializer: Api::V3::Dashboards::CountrySerializer + each_serializer: Api::Public::CountrySerializer end private def set_collection - @collection = Api::V3::FilterCountries.new(filter_params).call + @collection = Api::Public::FilterCountries.new(filter_params).call end def filter_params diff --git a/app/controllers/api/v3/commodities_controller.rb b/app/controllers/api/v3/commodities_controller.rb index fd597ba667..a8c8bd57fe 100644 --- a/app/controllers/api/v3/commodities_controller.rb +++ b/app/controllers/api/v3/commodities_controller.rb @@ -1,16 +1,8 @@ module Api module V3 class CommoditiesController < ApiController - include Api::V3::ParamHelpers - skip_before_action :load_context before_action :load_commodity, only: [:countries_facts] - before_action :set_collection, only: [:index] - - def index - render json: @collection, - each_serializer: Api::V3::Dashboards::CommoditySerializer - end def countries_facts facts = Api::V3::SupplyChainCountriesFacts.new( @@ -31,18 +23,6 @@ def countries_facts private - def set_collection - @collection = Api::V3::FilterCommodities.new(filter_params).call - end - - def filter_params - { - countries_ids: cs_string_to_int_array(params[:countries_ids]), - commodities_ids: cs_string_to_int_array(params[:commodities_ids]), - include: params[:include] - } - end - def load_commodity @commodity = Api::V3::Commodity.find(params[:id]) end diff --git a/app/controllers/api/v3/dashboards/commodities_controller.rb b/app/controllers/api/v3/dashboards/commodities_controller.rb index 77653d7fcb..7406388f0d 100644 --- a/app/controllers/api/v3/dashboards/commodities_controller.rb +++ b/app/controllers/api/v3/dashboards/commodities_controller.rb @@ -11,7 +11,7 @@ def index render json: @collection, root: 'data', - each_serializer: Api::V3::Dashboards::CommoditySerializer + each_serializer: Api::Public::CommoditySerializer end def search @@ -20,7 +20,7 @@ def search render json: @collection, root: 'data', - each_serializer: Api::V3::Dashboards::CommoditySerializer + each_serializer: Api::Public::CommoditySerializer end private diff --git a/app/controllers/api/v3/dashboards/countries_controller.rb b/app/controllers/api/v3/dashboards/countries_controller.rb index df763fb3ac..fc3f414448 100644 --- a/app/controllers/api/v3/dashboards/countries_controller.rb +++ b/app/controllers/api/v3/dashboards/countries_controller.rb @@ -11,7 +11,7 @@ def index render json: @collection, root: 'data', - each_serializer: Api::V3::Dashboards::CountrySerializer + each_serializer: Api::Public::CountrySerializer end def search @@ -20,7 +20,7 @@ def search render json: @collection, root: 'data', - each_serializer: Api::V3::Dashboards::CountrySerializer + each_serializer: Api::Public::CountrySerializer end private diff --git a/app/serializers/api/public/commodity_serializer.rb b/app/serializers/api/public/commodity_serializer.rb new file mode 100644 index 0000000000..ee945f4a5d --- /dev/null +++ b/app/serializers/api/public/commodity_serializer.rb @@ -0,0 +1,12 @@ +module Api + module Public + class CommoditySerializer < ActiveModel::Serializer + attributes :id, :name + attribute :country_ids, if: :include_countries? + + def include_countries? + @instance_options[:include_countries] + end + end + end +end diff --git a/app/serializers/api/public/country_serializer.rb b/app/serializers/api/public/country_serializer.rb new file mode 100644 index 0000000000..14720be238 --- /dev/null +++ b/app/serializers/api/public/country_serializer.rb @@ -0,0 +1,7 @@ +module Api + module Public + class CountrySerializer < ActiveModel::Serializer + attributes :id, :name + end + end +end diff --git a/app/serializers/api/v3/dashboards/commodity_serializer.rb b/app/serializers/api/v3/dashboards/commodity_serializer.rb deleted file mode 100644 index b6158ca395..0000000000 --- a/app/serializers/api/v3/dashboards/commodity_serializer.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Api - module V3 - module Dashboards - class CommoditySerializer < ActiveModel::Serializer - attributes :id, :name - attribute :country_ids, if: :include_countries? - - def include_countries? - @instance_options[:include_countries] - end - end - end - end -end diff --git a/app/serializers/api/v3/dashboards/country_serializer.rb b/app/serializers/api/v3/dashboards/country_serializer.rb deleted file mode 100644 index 625ade81d6..0000000000 --- a/app/serializers/api/v3/dashboards/country_serializer.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Api - module V3 - module Dashboards - class CountrySerializer < ActiveModel::Serializer - attributes :id, :name - end - end - end -end diff --git a/app/serializers/api/v3/dashboards/template_serializer.rb b/app/serializers/api/v3/dashboards/template_serializer.rb index 11f8aac60d..e3dfff15fe 100644 --- a/app/serializers/api/v3/dashboards/template_serializer.rb +++ b/app/serializers/api/v3/dashboards/template_serializer.rb @@ -17,11 +17,11 @@ class TemplateSerializer < ActiveModel::Serializer key: :destinations has_many :commodities, - serializer: Api::V3::Dashboards::CommoditySerializer, + serializer: Api::Public::CommoditySerializer, key: :commodities has_many :countries, - serializer: Api::V3::Dashboards::CountrySerializer, + serializer: Api::Public::CountrySerializer, key: :countries attribute :image_url do diff --git a/app/services/api/v3/filter_commodities.rb b/app/services/api/public/filter_commodities.rb similarity index 93% rename from app/services/api/v3/filter_commodities.rb rename to app/services/api/public/filter_commodities.rb index 240a58eaa5..dbc24d7b6d 100644 --- a/app/services/api/v3/filter_commodities.rb +++ b/app/services/api/public/filter_commodities.rb @@ -1,5 +1,5 @@ module Api - module V3 + module Public class FilterCommodities def initialize(params) @meta = {} @@ -40,7 +40,7 @@ def include_countries country_ids = @query.map(&:country_ids).flatten.uniq countries = Api::V3::Country.where(id: country_ids) @meta[:countries] = ActiveModel::Serializer::CollectionSerializer.new( - countries, serializer: Api::V3::Dashboards::CountrySerializer + countries, serializer: Api::Public::CountrySerializer ).as_json end end diff --git a/app/services/api/v3/filter_countries.rb b/app/services/api/public/filter_countries.rb similarity index 93% rename from app/services/api/v3/filter_countries.rb rename to app/services/api/public/filter_countries.rb index a81b9e39f7..66bb9dc3b8 100644 --- a/app/services/api/v3/filter_countries.rb +++ b/app/services/api/public/filter_countries.rb @@ -1,5 +1,5 @@ module Api - module V3 + module Public class FilterCountries def initialize(params) @meta = {} @@ -40,7 +40,7 @@ def include_commodities commodity_ids = @query.map(&:commodity_ids).flatten.uniq commodities = Api::V3::Commodity.where(id: commodity_ids) @meta[:commodities] = ActiveModel::Serializer::CollectionSerializer.new( - commodities, serializer: Api::V3::Dashboards::CommoditySerializer + commodities, serializer: Api::Public::CommoditySerializer ).as_json end end diff --git a/config/routes.rb b/config/routes.rb index 190e7d8292..42d693a886 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -105,11 +105,10 @@ end resources :parametrised_charts, only: [:index] end - resources :countries, only: [:index] - resources :commodities, only: [:index] do + + resources :commodities, only: [] do get :countries_facts, on: :member end - #resources :countries_facts, only: [:index] resources :sankey_card_links, only: [:index] end namespace :v2 do @@ -131,7 +130,13 @@ get '/get_actor_node_attributes', to: 'actor_factsheet#actor_data' get '/get_node_attributes', to: 'nodes#node_attributes' end + + get '/v3/countries', to: 'public/countries#index' + get '/v3/commodities', to: 'public/commodities#index' + namespace :public do + resources :countries, only: [:index] + resources :commodities, only: [:index] resources :attributes, only: [:index] resources :flows, only: [:index] resources :nodes, only: [] do diff --git a/frontend/docs/swagger.yaml b/frontend/docs/swagger.yaml index d0fffe9824..9e4d320436 100644 --- a/frontend/docs/swagger.yaml +++ b/frontend/docs/swagger.yaml @@ -722,7 +722,9 @@ paths: get: tags: - "countries" + deprecated: true summary: Countries matching selected filters + description: Use /api/public/countries instead parameters: - $ref: "#/components/parameters/commodities_ids" - $ref: "#/components/parameters/include" @@ -748,7 +750,9 @@ paths: get: tags: - "commodities" + deprecated: true summary: Commodities matching selected filters + description: Use /api/public/commodities instead parameters: - $ref: "#/components/parameters/countries_ids" - $ref: "#/components/parameters/include" diff --git a/spec/controllers/api/v3/commodities_controller_spec.rb b/spec/controllers/api/public/commodities_controller_spec.rb similarity index 82% rename from spec/controllers/api/v3/commodities_controller_spec.rb rename to spec/controllers/api/public/commodities_controller_spec.rb index ffeb4f16d6..48dc3ca096 100644 --- a/spec/controllers/api/v3/commodities_controller_spec.rb +++ b/spec/controllers/api/public/commodities_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Api::V3::CommoditiesController, type: :controller do +RSpec.describe Api::Public::CommoditiesController, type: :controller do include_context 'api v3 brazil flows quants' include_context 'api v3 brazil beef flows' @@ -17,7 +17,7 @@ get :index, params: {countries_ids: api_v3_brazil.id, include: 'countries'} expect(assigns(:collection)[:meta][:countries].first).to eq( - Api::V3::Dashboards::CountrySerializer.new(api_v3_brazil).as_json + Api::Public::CountrySerializer.new(api_v3_brazil).as_json ) end end diff --git a/spec/controllers/api/v3/countries_controller_spec.rb b/spec/controllers/api/public/countries_controller_spec.rb similarity index 83% rename from spec/controllers/api/v3/countries_controller_spec.rb rename to spec/controllers/api/public/countries_controller_spec.rb index 6d8c9b6e7b..d57d8d7ff1 100644 --- a/spec/controllers/api/v3/countries_controller_spec.rb +++ b/spec/controllers/api/public/countries_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Api::V3::CountriesController, type: :controller do +RSpec.describe Api::Public::CountriesController, type: :controller do include_context 'api v3 brazil flows quants' include_context 'api v3 paraguay flows quants' @@ -19,7 +19,7 @@ ) end - context 'when include countries' do + context 'when include commodities' do it 'return list in alphabetical order with countries information' do get :index, params: { commodities_ids: api_v3_soy.id, @@ -27,7 +27,7 @@ } expect(assigns(:collection)[:meta][:commodities].first).to eq( - Api::V3::Dashboards::CommoditySerializer.new(api_v3_soy).as_json + Api::Public::CommoditySerializer.new(api_v3_soy).as_json ) end end From fc36280068e35a491f488861495ac86dd0073db8 Mon Sep 17 00:00:00 2001 From: sorodrigo Date: Mon, 11 Nov 2019 10:39:13 -0600 Subject: [PATCH 11/11] updates contextual layers --- frontend/gis/cartodb/named-maps.js | 46 +++++++++---- .../named-maps/tool_named_maps_carto.js | 64 +++++++++---------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/frontend/gis/cartodb/named-maps.js b/frontend/gis/cartodb/named-maps.js index 3fad0b67c9..0704444dcd 100644 --- a/frontend/gis/cartodb/named-maps.js +++ b/frontend/gis/cartodb/named-maps.js @@ -12,12 +12,25 @@ const getCartoUrl = endpoint => const spinner = ora(); +function readEnv() { + const envFlag = process.argv[2]; + if (!envFlag || !envFlag.includes('--env=')) { + throw new Error('You need to define --env'); + } + const env = envFlag.split('--env=')[1]; + const typeFlag = process.argv[3]; + const type = (typeFlag && typeFlag.split('--type=')[1]) || DEFAULT_TYPE; + return { env, type }; +} + function classifyTemplates(templates) { + const { env } = readEnv(); spinner.start('Fetching existing templates'); const getTemplates = (existingTemplates = []) => { + const envTemplates = existingTemplates.filter(template => template.endsWith(`__${env}`)); const result = templates.reduce( (acc, next) => { - const exists = existingTemplates.find(t => next.name === t); + const exists = envTemplates.find(t => next.name === t); return { ...acc, toUpdate: exists ? [...acc.toUpdate, next] : acc.toUpdate, @@ -26,6 +39,8 @@ function classifyTemplates(templates) { }, { toUpdate: [], toCreate: [] } ); + const toKeep = [...result.toUpdate, result.toCreate].map(i => i.name); + result.toRemove = envTemplates.filter(template => !toKeep.includes(template)); spinner.succeed(); return result; }; @@ -36,17 +51,6 @@ function classifyTemplates(templates) { .catch(e => console.error(e)); } -function readEnv() { - const envFlag = process.argv[2]; - if (!envFlag || !envFlag.includes('--env=')) { - throw new Error('You need to define --env'); - } - const env = envFlag.split('--env=')[1]; - const typeFlag = process.argv[3]; - const type = (typeFlag && typeFlag.split('--type=')[1]) || DEFAULT_TYPE; - return { env, type }; -} - function getTemplatesByEnvironment() { const { env, type } = readEnv(); spinner.start(`Reading templates from file system env: ${env} type: ${type}`); @@ -104,6 +108,21 @@ function instanciate(templates) { return Promise.all(updates).then(res => spinner.succeed() && res); } +function remove(templateNames) { + spinner.start(`Removing templates: ${JSON.stringify(templateNames, null, ' ')}`); + const updates = templateNames.map(templateName => + fetch(getCartoUrl(`api/v1/map/named/${templateName}`), { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json' + } + }) + .then(res => res.text()) + .catch(console.error) + ); + return Promise.all(updates).then(res => spinner.succeed() && res); +} + function saveTemplates(templates, namedMaps) { spinner.start('Saving templates to file system'); const { env, type } = readEnv(); @@ -142,10 +161,11 @@ function saveTemplates(templates, namedMaps) { } function applyTemplates(classified) { - const { toUpdate, toCreate } = classified; + const { toUpdate, toCreate, toRemove } = classified; console.log(toUpdate); const updated = toUpdate.length > 0 ? update(toUpdate) : []; const created = toCreate.length > 0 ? create(toCreate) : []; + if (toRemove.length > 0) remove(toRemove).catch(console.error); Promise.all([updated, created]) .then(() => instanciate([...toUpdate, ...toCreate])) .then(namedMaps => saveTemplates([...toUpdate, ...toCreate], namedMaps)) diff --git a/frontend/scripts/named-maps/tool_named_maps_carto.js b/frontend/scripts/named-maps/tool_named_maps_carto.js index 66ffd99d49..1b424bac67 100644 --- a/frontend/scripts/named-maps/tool_named_maps_carto.js +++ b/frontend/scripts/named-maps/tool_named_maps_carto.js @@ -5,10 +5,6 @@ module.exports = { uid: 'brazil_states__production', layergroupid: 'p2cs-sei@4f456911@94bb9db1cc2bbb6f823b52891ea85a4b:1536754740910' }, - brazil_biomes: { - uid: 'brazil_biomes__production', - layergroupid: 'p2cs-sei@ee8b4bf2@53eff313f97bb4d6e956f5078a2ce178:1536754747512' - }, brazil_water_scarcity: { uid: 'brazil_water_scarcity__production', layergroupid: 'p2cs-sei@ce96a651@bd75df185965352f558793d64c6c76af:1536754755124' @@ -25,18 +21,10 @@ module.exports = { uid: 'brazil_defor_alerts__production', layergroupid: 'p2cs-sei@c4807a94@9495c323e40ff63e0c59e0fc6ffbebcd:1538401614852' }, - paraguay_ecoregions_2018_11_14: { - uid: 'paraguay_ecoregions_2018_11_14__production', - layergroupid: 'p2cs-sei@8bc16e3e@920a70ce8cd9698d474541a13571868e:1543380503816' - }, paraguay_protected_areas_2018_11_14: { uid: 'paraguay_protected_areas_2018_11_14__production', layergroupid: 'p2cs-sei@7fb7d231@e3a7e457c532b2340f2fa76d05c84160:1542212474275' }, - paraguay_indigenous_areas_2018_11_14: { - uid: 'paraguay_indigenous_areas_2018_11_14__production', - layergroupid: 'p2cs-sei@93c53b34@286bbb73f3bcdfa206205acef80ec835:1542212565695' - }, py_deforestation_2013_2017_20190131: { uid: 'py_deforestation_2013_2017_20190131__production', layergroupid: 'p2cs-sei@9d6ad933@07588ca1af7caf72f3f838cdac1cac8f:1548926222884' @@ -48,6 +36,18 @@ module.exports = { colombia_protected_areas: { uid: 'colombia_protected_areas__production', layergroupid: 'p2cs-sei@bd5844b5@7068763bcb727c705c489c838b6deadb:1536312121956' + }, + brazil_biomes: { + uid: 'brazil_biomes__production', + layergroupid: 'p2cs-sei@ee8b4bf2@53eff313f97bb4d6e956f5078a2ce178:1536754747512' + }, + paraguay_ecoregions_2018_11_14: { + uid: 'paraguay_ecoregions_2018_11_14__production', + layergroupid: 'p2cs-sei@8bc16e3e@920a70ce8cd9698d474541a13571868e:1543380503816' + }, + paraguay_indigenous_areas_2018_11_14: { + uid: 'paraguay_indigenous_areas_2018_11_14__production', + layergroupid: 'p2cs-sei@93c53b34@286bbb73f3bcdfa206205acef80ec835:1542212565695' } }, development: { @@ -101,22 +101,34 @@ module.exports = { } }, sandbox: { - brazil_states: { - uid: 'brazil_states__sandbox', - layergroupid: 'p2cs-sei@813fddd3@cc7c9866165bd98a1fdd4113ec31ac49:1536754740910' - }, brazil_biomes: { uid: 'brazil_biomes__sandbox', layergroupid: 'p2cs-sei@c93b6cad@5a3d352564249dd7eaf1f5a2271b471d:1536754747512' }, - brazil_water_scarcity: { - uid: 'brazil_water_scarcity__sandbox', - layergroupid: 'p2cs-sei@51aab8e1@4ee3434d572f8071c4ee8395cd84c069:1536754755124' - }, brazil_indigenous_areas: { uid: 'brazil_indigenous_areas__sandbox', layergroupid: 'p2cs-sei@99f56118@ef8eae3b879a710a3772c7a5f1e34eae:1538034854446' }, + paraguay_ecoregions_2018_11_14: { + uid: 'paraguay_ecoregions_2018_11_14__sandbox', + layergroupid: 'p2cs-sei@8d7b2903@e25bfafe50ad1cde7cee552c474151bb:1543380503816' + }, + colombia_regional_autonomous_corps: { + uid: 'colombia_regional_autonomous_corps__sandbox', + layergroupid: 'p2cs-sei@ac06e412@8920938abbeed970d70f57bec86dcd00:1536313111531' + }, + colombia_protected_areas: { + uid: 'colombia_protected_areas__sandbox', + layergroupid: 'p2cs-sei@dba9560a@d9b798b42ae0e7bbb677bfbe46d49413:1536312121956' + }, + brazil_states: { + uid: 'brazil_states__sandbox', + layergroupid: 'p2cs-sei@813fddd3@cc7c9866165bd98a1fdd4113ec31ac49:1536754740910' + }, + brazil_water_scarcity: { + uid: 'brazil_water_scarcity__sandbox', + layergroupid: 'p2cs-sei@51aab8e1@4ee3434d572f8071c4ee8395cd84c069:1536754755124' + }, brazil_protected: { uid: 'brazil_protected__sandbox', layergroupid: 'p2cs-sei@94358e00@27478e79b3971e23f86bccc8aae4b0e1:1537979981544' @@ -125,10 +137,6 @@ module.exports = { uid: 'brazil_defor_alerts__sandbox', layergroupid: 'p2cs-sei@d3572a6b@119855d12a08daf809c7911fb721a04c:1538401614852' }, - paraguay_ecoregions_2018_11_14: { - uid: 'paraguay_ecoregions_2018_11_14__sandbox', - layergroupid: 'p2cs-sei@8d7b2903@e25bfafe50ad1cde7cee552c474151bb:1543380503816' - }, paraguay_protected_areas_2018_11_14: { uid: 'paraguay_protected_areas_2018_11_14__sandbox', layergroupid: 'p2cs-sei@6f1f4672@d067ffc51eb3571426f0270c531418f4:1542212474275' @@ -140,14 +148,6 @@ module.exports = { py_deforestation_2013_2017_20190131: { uid: 'py_deforestation_2013_2017_20190131__sandbox', layergroupid: 'p2cs-sei@1d3f021a@0117a7789472bd8d3ec12e4d5600e7ab:1548926222884' - }, - colombia_regional_autonomous_corps: { - uid: 'colombia_regional_autonomous_corps__sandbox', - layergroupid: 'p2cs-sei@ac06e412@8920938abbeed970d70f57bec86dcd00:1536313111531' - }, - colombia_protected_areas: { - uid: 'colombia_protected_areas__sandbox', - layergroupid: 'p2cs-sei@dba9560a@d9b798b42ae0e7bbb677bfbe46d49413:1536312121956' } }, demo: {},