From ddd0c39632045bd39b8c421bad92732d46b6d250 Mon Sep 17 00:00:00 2001 From: jgaffuri Date: Fri, 29 Sep 2023 18:44:58 +0200 Subject: [PATCH] use new eurostat module --- docs/reference.md | 2 +- examples/DE.html | 5 +++-- examples/EUR.html | 5 +++-- examples/EUR_bu.html | 3 ++- examples/EUR_census_demo.html | 3 ++- examples/EUR_census_demo_capital.html | 5 +++-- examples/EUR_population.html | 5 +++-- examples/FR.html | 5 +++-- examples/FR_pop.html | 5 +++-- examples/FR_population.html | 5 +++-- examples/HR.html | 5 +++-- examples/NO.html | 3 ++- examples/stretching.html | 3 ++- examples/styles/composition_pop_FR.html | 5 +++-- examples/styles/dotdensity_random.html | 3 ++- examples/styles/joyplot_shading.html | 3 ++- examples/styles/lego_EUR.html | 3 ++- examples/styles/mosaic_full.html | 5 +++-- examples/styles/mosaic_full_FR.html | 5 +++-- examples/styles/pillar_simple.html | 5 +++-- examples/styles/squarecolorwgl_dark.html | 5 +++-- examples/styles/tanaka_full.html | 5 +++-- examples/test/old/EUR_test_zoom.html | 5 +++-- examples/test/old/NL_composition.html | 3 ++- examples/test/page_include test.html | 3 ++- examples/test/testGeoTIFF.html | 5 +++-- examples/test/ur/accessibility_educ_health.html | 3 ++- examples/test/ur/degurba.html | 3 ++- examples/test/ur/forest.html | 3 ++- examples/test/ur/land_cover.html | 3 ++- examples/test/ur/population.html | 3 ++- examples/test/ur/road_transport_perf.html | 3 ++- 32 files changed, 79 insertions(+), 48 deletions(-) diff --git a/docs/reference.md b/docs/reference.md index 41f882491..f4018a688 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1016,7 +1016,7 @@ new gviz.App(containerDiv) Input data need to be as a CSV table. Each row should correspond to a label, with a _x_ and _y_ column for the label position, and a _name_ column for the text to write. The data can be restructured on the fly after loading to meet this requirement using the **preprocess** function. -For European grids based on ETRS89-LAEA CRS, the **gviz.getEuronymeLabelLayer()** function returns ready-to-use label layer settings based on [Euronym](https://github.com/eurostat/euronym) which allow zoom dependant label selection. +For European grids based on ETRS89-LAEA CRS, the **gviz_es.getEuronymeLabelLayer()** function from [gridviz-eurostat](https://github.com/eurostat/gridviz-eurostat) module returns ready-to-use label layer settings based on [Euronym](https://github.com/eurostat/euronym) which allow zoom dependant label selection. The **setLabelLayer** method has the following parameters: diff --git a/examples/DE.html b/examples/DE.html index 0d3d39afe..ca752c69d 100644 --- a/examples/DE.html +++ b/examples/DE.html @@ -83,6 +83,7 @@ + @@ -95,8 +96,8 @@ const app = new gviz.App(containerDiv) .setGeoCenter({ x: 4301000, y: 3050000 }) .setZoomFactor(400) - .setLabelLayer(gviz.getEuronymeLabelLayer('DE', '20')) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('DE', '20')) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) .addBackgroundLayerWMS({ url: 'https://sgx.geodatenzentrum.de/wms_basemapde?&service=WMS&request=GetMap&layers=de_basemapde_web_raster_grau&styles=&format=image%2Fjpeg&transparent=false&version=1.1.1&srs=EPSG%3A3035', maxZoom: 50, diff --git a/examples/EUR.html b/examples/EUR.html index e324face5..02106983f 100644 --- a/examples/EUR.html +++ b/examples/EUR.html @@ -86,6 +86,7 @@ + @@ -95,8 +96,8 @@ .setGeoCenter({ x: 4313947, y: 2970049 }) .setZoomFactor(600) .setZoomFactorExtent([40, 7500]) - .setLabelLayer(gviz.getEuronymeLabelLayer()) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer()) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) //.setBackgroundColor("#d3eeff") .setViewFromURL() .addBackgroundLayer({ diff --git a/examples/EUR_bu.html b/examples/EUR_bu.html index 467f0c497..db131401a 100644 --- a/examples/EUR_bu.html +++ b/examples/EUR_bu.html @@ -9,13 +9,14 @@
+ + @@ -607,7 +608,7 @@ .setZoomFactor(600) .setZoomFactorExtent([40, 7500]) .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ccIn: [ 'AT', 'BE', diff --git a/examples/EUR_census_demo_capital.html b/examples/EUR_census_demo_capital.html index 07e8f1034..a8079cff7 100644 --- a/examples/EUR_census_demo_capital.html +++ b/examples/EUR_census_demo_capital.html @@ -164,6 +164,7 @@ + @@ -391,7 +392,7 @@ .setZoomFactor(600) .setZoomFactorExtent([40, 7500]) .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ccIn: [ 'AT', 'BE', @@ -435,7 +436,7 @@ }) ) .setBoundaryLayer( - gviz.getEurostatBoundariesLayer({ + gviz_es.getEurostatBoundariesLayer({ baseURL: nuts2jsonURL, showOth: false, color: (f, zf) => { diff --git a/examples/EUR_population.html b/examples/EUR_population.html index 3d21b979e..e558fce3a 100644 --- a/examples/EUR_population.html +++ b/examples/EUR_population.html @@ -93,6 +93,7 @@ + @@ -102,8 +103,8 @@ .setGeoCenter({ x: 4313947, y: 2970049 }) .setZoomFactor(600) .setZoomFactorExtent([40, 7500]) - .setLabelLayer(gviz.getEuronymeLabelLayer()) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer()) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) .setViewFromURL() //retrieve the selected year (the column to show) diff --git a/examples/FR.html b/examples/FR.html index 26494cf38..c12d98821 100644 --- a/examples/FR.html +++ b/examples/FR.html @@ -91,6 +91,7 @@ + @@ -101,8 +102,8 @@ .setGeoCenter({ x: 3763437, y: 2891045 }) .setZoomFactor(50.1) .setZoomFactorExtent([7, 2000]) - .setLabelLayer(gviz.getEuronymeLabelLayer('FR', '20')) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('FR', '20')) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) .setViewFromURL() .addBackgroundLayer({ //url: "https://gisco-services.ec.europa.eu/maps/tiles/GreyEarth/EPSG3035/", diff --git a/examples/FR_pop.html b/examples/FR_pop.html index 0342e413f..2aa39dd7d 100644 --- a/examples/FR_pop.html +++ b/examples/FR_pop.html @@ -104,6 +104,7 @@ + @@ -121,8 +122,8 @@ .setGeoCenter({ x: 3763437, y: 2891045 }) .setZoomFactor(50.1) .setZoomFactorExtent([10, 1500]) - .setLabelLayer(gviz.getEuronymeLabelLayer('FR', '20', { baseURL: euronymURL })) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer({ baseURL: nuts2jsonURL, showOth: false })) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('FR', '20', { baseURL: euronymURL })) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer({ baseURL: nuts2jsonURL, showOth: false })) .setViewFromURL() .addBackgroundLayer({ url: bgLayerURL, diff --git a/examples/FR_population.html b/examples/FR_population.html index e7748e813..ffef71148 100644 --- a/examples/FR_population.html +++ b/examples/FR_population.html @@ -85,6 +85,7 @@ + @@ -94,8 +95,8 @@ .setGeoCenter({ x: 3763437, y: 2891045 }) .setZoomFactor(50.1) .setZoomFactorExtent([10, 1500]) - .setLabelLayer(gviz.getEuronymeLabelLayer('FR', '20')) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('FR', '20')) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) .setViewFromURL() const tsFun = gviz.TextStyle.getCharLegendFun(['.', '-', '~', '+', '=', '#', '€', '@']) diff --git a/examples/HR.html b/examples/HR.html index a31602222..bd36d3f47 100644 --- a/examples/HR.html +++ b/examples/HR.html @@ -77,6 +77,7 @@ + @@ -87,8 +88,8 @@ .setGeoCenter({ x: 4806935, y: 2446234 }) .setZoomFactor(400.1) .setZoomFactorExtent([20, 2000]) - .setLabelLayer(gviz.getEuronymeLabelLayer('HR', '20')) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('HR', '20')) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) .setViewFromURL() .addBackgroundLayer({ //url: "https://gisco-services.ec.europa.eu/maps/tiles/GreyEarth/EPSG3035/", diff --git a/examples/NO.html b/examples/NO.html index 5bdfc2dea..ff4aae2f2 100644 --- a/examples/NO.html +++ b/examples/NO.html @@ -60,6 +60,7 @@ + @@ -92,7 +93,7 @@ const app = new gviz.App(containerDiv) .setGeoCenter({ x: 2179500, y: 6783250 }) .setZoomFactor(500) - .setLabelLayer(gviz.getEuronymeLabelLayer('NO', '20', { + .setLabelLayer(gviz_es.getEuronymeLabelLayer('NO', '20', { proj: proj })) //.setBoundaryLayer(gviz.getEurostatBoundariesLayer()) diff --git a/examples/stretching.html b/examples/stretching.html index fb8e6099f..efae9e362 100644 --- a/examples/stretching.html +++ b/examples/stretching.html @@ -54,6 +54,7 @@
+ @@ -65,7 +66,7 @@ .setZoomFactor(600) .setBackgroundColor('black') - .setLabelLayer(gviz.getEuronymeLabelLayer('EUR', '20', { dark: true })) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('EUR', '20', { dark: true })) .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) .addMultiScaleTiledGridLayer( diff --git a/examples/styles/composition_pop_FR.html b/examples/styles/composition_pop_FR.html index 400f3c932..7392a813e 100644 --- a/examples/styles/composition_pop_FR.html +++ b/examples/styles/composition_pop_FR.html @@ -65,6 +65,7 @@ + @@ -76,13 +77,13 @@ .setZoomFactor(100) .setZoomFactorExtent([5, 1500]) .setLabelLayer( - gviz.getEuronymeLabelLayer('FR', '20', { + gviz_es.getEuronymeLabelLayer('FR', '20', { haloWidth: () => 5, haloColor: () => '#FFFFFFDD', }) ) .setBoundaryLayer( - gviz.getEurostatBoundariesLayer({ + gviz_es.getEurostatBoundariesLayer({ color: (f, zf) => { const p = f.properties const col = '#888' diff --git a/examples/styles/dotdensity_random.html b/examples/styles/dotdensity_random.html index 055d16ca4..b9a579e60 100644 --- a/examples/styles/dotdensity_random.html +++ b/examples/styles/dotdensity_random.html @@ -16,6 +16,7 @@
+ @@ -29,7 +30,7 @@ .setBackgroundColor('#eaeaea') .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ex: 1.8, fontFamily: 'mf', exSize: 1.1, diff --git a/examples/styles/joyplot_shading.html b/examples/styles/joyplot_shading.html index baea0c539..cdeef3f48 100644 --- a/examples/styles/joyplot_shading.html +++ b/examples/styles/joyplot_shading.html @@ -9,6 +9,7 @@
+ + @@ -75,7 +76,7 @@ .setViewFromURL() .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ex: 1.6, fontFamily: 'mfLego', exSize: 1, diff --git a/examples/styles/mosaic_full.html b/examples/styles/mosaic_full.html index 16f8c83cb..a24be2400 100644 --- a/examples/styles/mosaic_full.html +++ b/examples/styles/mosaic_full.html @@ -52,6 +52,7 @@ + @@ -64,7 +65,7 @@ .setZoomFactorExtent([30, 7000]) .setViewFromURL() .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ex: 1.6, fontFamily: 'mf', exSize: 1.2, @@ -74,7 +75,7 @@ }) ) .setBoundaryLayer( - gviz.getEurostatBoundariesLayer({ + gviz_es.getEurostatBoundariesLayer({ scale: '10M', col: '#00000077', lineDash: () => [], diff --git a/examples/styles/mosaic_full_FR.html b/examples/styles/mosaic_full_FR.html index 15a85689a..5af82a45b 100644 --- a/examples/styles/mosaic_full_FR.html +++ b/examples/styles/mosaic_full_FR.html @@ -52,6 +52,7 @@ + @@ -65,7 +66,7 @@ .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) .setViewFromURL() .setLabelLayer( - gviz.getEuronymeLabelLayer('FR', 20, { + gviz_es.getEuronymeLabelLayer('FR', 20, { ex: 1.6, fontFamily: 'mf', exSize: 1.2, @@ -75,7 +76,7 @@ }) ) .setBoundaryLayer( - gviz.getEurostatBoundariesLayer({ + gviz_es.getEurostatBoundariesLayer({ scale: '10M', col: '#00000077', lineDash: () => [], diff --git a/examples/styles/pillar_simple.html b/examples/styles/pillar_simple.html index 8916387d1..dd118e1ec 100644 --- a/examples/styles/pillar_simple.html +++ b/examples/styles/pillar_simple.html @@ -9,6 +9,7 @@
+ + @@ -21,8 +22,8 @@ .setZoomFactorExtent([7, 2000]) .setBackgroundColor('black') - .setLabelLayer(gviz.getEuronymeLabelLayer('FR', '20', { dark: true })) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('FR', '20', { dark: true })) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) .setViewFromURL() .addMultiScaleTiledGridLayer( diff --git a/examples/styles/tanaka_full.html b/examples/styles/tanaka_full.html index b5eb70de1..53719fa49 100644 --- a/examples/styles/tanaka_full.html +++ b/examples/styles/tanaka_full.html @@ -16,6 +16,7 @@
+ @@ -31,7 +32,7 @@ .setBackgroundColor('black') .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ex: 2, fontFamily: 'mfLeg', exSize: 0.9, @@ -41,7 +42,7 @@ }) ) .setBoundaryLayer( - gviz.getEurostatBoundariesLayer({ + gviz_es.getEurostatBoundariesLayer({ scale: '10M', col: '#fff5', lineDash: () => [], diff --git a/examples/test/old/EUR_test_zoom.html b/examples/test/old/EUR_test_zoom.html index fa0a2ca00..2d9c12afa 100644 --- a/examples/test/old/EUR_test_zoom.html +++ b/examples/test/old/EUR_test_zoom.html @@ -9,6 +9,7 @@
+ @@ -18,8 +19,8 @@ .setGeoCenter({ x: 4000000, y: 2960000 }) .setZoomFactor(100) .setZoomFactorExtent([50, 11000]) - .setLabelLayer(gviz.getEuronymeLabelLayer()) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer()) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) //style data const s = new gviz.SquareColorWGLStyle({ diff --git a/examples/test/old/NL_composition.html b/examples/test/old/NL_composition.html index f8237af2c..53a7c3489 100644 --- a/examples/test/old/NL_composition.html +++ b/examples/test/old/NL_composition.html @@ -21,12 +21,13 @@ + + @@ -67,7 +68,7 @@

Test of HTML inclusion

.setGeoCenter({ x: 4000000, y: 2960000 }) .setZoomFactor(600) .setZoomFactorExtent([40, 7500]) - .setLabelLayer(gviz.getEuronymeLabelLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer()) .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) .addMultiScaleTiledGridLayer( [1000, 2000, 5000, 10000, 20000, 50000, 100000], diff --git a/examples/test/testGeoTIFF.html b/examples/test/testGeoTIFF.html index 4e9ed3ca6..547d7c142 100644 --- a/examples/test/testGeoTIFF.html +++ b/examples/test/testGeoTIFF.html @@ -9,6 +9,7 @@
+ @@ -18,8 +19,8 @@ new gviz.App(containerDiv) .setGeoCenter({ x: 4000000, y: 2260000 }) .setZoomFactor(500) - .setLabelLayer(gviz.getEuronymeLabelLayer('FR', '20')) - .setBoundaryLayer(gviz.getEurostatBoundariesLayer()) + .setLabelLayer(gviz_es.getEuronymeLabelLayer('FR', '20')) + .setBoundaryLayer(gviz_es.getEurostatBoundariesLayer()) //addCSVGridLayer(url, resolution, styles, minZoom, maxZoom, opts) { .addGeoTIFFLayer( diff --git a/examples/test/ur/accessibility_educ_health.html b/examples/test/ur/accessibility_educ_health.html index 3dc198c51..8d56f03c1 100644 --- a/examples/test/ur/accessibility_educ_health.html +++ b/examples/test/ur/accessibility_educ_health.html @@ -134,6 +134,7 @@ + @@ -149,7 +150,7 @@ .setZoomFactor(8000) .setZoomFactorExtent([40, 8000]) .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ccIn: [ 'AT', 'BE', diff --git a/examples/test/ur/degurba.html b/examples/test/ur/degurba.html index 62844f0b1..113040fb8 100644 --- a/examples/test/ur/degurba.html +++ b/examples/test/ur/degurba.html @@ -112,6 +112,7 @@ + + @@ -152,7 +153,7 @@ .setZoomFactor(8000) .setZoomFactorExtent([40, 8000]) .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ccIn: [ 'AT', 'BE', diff --git a/examples/test/ur/land_cover.html b/examples/test/ur/land_cover.html index 3526be63e..51493aa0a 100644 --- a/examples/test/ur/land_cover.html +++ b/examples/test/ur/land_cover.html @@ -97,6 +97,7 @@ + + @@ -161,7 +162,7 @@ .setZoomFactor(8000) .setZoomFactorExtent([40, 8000]) .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ccIn: [ 'AT', 'BE', diff --git a/examples/test/ur/road_transport_perf.html b/examples/test/ur/road_transport_perf.html index fc04fe2eb..10ab7d4e0 100644 --- a/examples/test/ur/road_transport_perf.html +++ b/examples/test/ur/road_transport_perf.html @@ -104,6 +104,7 @@ + @@ -119,7 +120,7 @@ .setZoomFactor(8000) .setZoomFactorExtent([40, 8000]) .setLabelLayer( - gviz.getEuronymeLabelLayer('EUR', 50, { + gviz_es.getEuronymeLabelLayer('EUR', 50, { ccIn: [ 'AT', 'BE',