From 975ed6c6fc3fc94b725a8caa59e49b4a64cdcf44 Mon Sep 17 00:00:00 2001 From: syt123450 <421537891@qq.com> Date: Thu, 5 Jul 2018 17:18:07 +0800 Subject: [PATCH 1/3] draft idea of ZZ --- docs/en/Country_Code.md | 5 +++++ src/dataPreprocessors/GeometryDataProcessor.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 docs/en/Country_Code.md diff --git a/docs/en/Country_Code.md b/docs/en/Country_Code.md new file mode 100644 index 0000000..e43499e --- /dev/null +++ b/docs/en/Country_Code.md @@ -0,0 +1,5 @@ +##Country Code + +| Country Code | Country Name | +| ------------- | ------------- | +||| \ No newline at end of file diff --git a/src/dataPreprocessors/GeometryDataProcessor.js b/src/dataPreprocessors/GeometryDataProcessor.js index 1e3e25c..7c0e67d 100644 --- a/src/dataPreprocessors/GeometryDataProcessor.js +++ b/src/dataPreprocessors/GeometryDataProcessor.js @@ -34,10 +34,12 @@ GeometryDataProcessor.prototype.processDetail = function ( controller ) { var exporterName = set.e.toUpperCase(); var importerName = set.i.toUpperCase(); + + // check ZZ here, if exporterName or importerName is "zz", continue var exporter = CountryData[ exporterName ]; var importer = CountryData[ importerName ]; - + if (exporter==null) throw exporterName+" is not referenced as a country code! See the full list there : https://github.com/syt123450/giojs/blob/master/src/countryInfo/CountryData.js"; if (importer==null) throw importerName+" is not referenced as a country code! See the full list there : https://github.com/syt123450/giojs/blob/master/src/countryInfo/CountryData.js"; From 9707900d919df3d4789e9846c33ef90f98c8824b Mon Sep 17 00:00:00 2001 From: Alexis Date: Thu, 5 Jul 2018 17:21:26 +0200 Subject: [PATCH 2/3] delete unknown country ZZ from inputObject --- src/dataPreprocessors/GeometryDataProcessor.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dataPreprocessors/GeometryDataProcessor.js b/src/dataPreprocessors/GeometryDataProcessor.js index 7c0e67d..0916b81 100644 --- a/src/dataPreprocessors/GeometryDataProcessor.js +++ b/src/dataPreprocessors/GeometryDataProcessor.js @@ -35,7 +35,16 @@ GeometryDataProcessor.prototype.processDetail = function ( controller ) { var exporterName = set.e.toUpperCase(); var importerName = set.i.toUpperCase(); - // check ZZ here, if exporterName or importerName is "zz", continue + if (exporterName == "ZZ" || importerName == "ZZ") { + console.group("ZZ unknown country") + console.log("ZZ country code detected for current countries this will not be print on the globe"); + console.log({exporterName,importerName}) + console.groupEnd(); + + delete controller.inputData[s]; + + continue; + } var exporter = CountryData[ exporterName ]; var importer = CountryData[ importerName ]; From 63e5cbd81e3b31bcd97ce5e456e85568b0202612 Mon Sep 17 00:00:00 2001 From: Alexis Date: Thu, 5 Jul 2018 17:24:08 +0200 Subject: [PATCH 3/3] add ZZ country code --- docs/en/Country_Code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Country_Code.md b/docs/en/Country_Code.md index e43499e..4e81776 100644 --- a/docs/en/Country_Code.md +++ b/docs/en/Country_Code.md @@ -2,4 +2,4 @@ | Country Code | Country Name | | ------------- | ------------- | -||| \ No newline at end of file +| ZZ | [Unknown Country](https://stackoverflow.com/questions/20973960/i-am-getting-zz-as-country-code-when-using-pytz) |