linz / linz-admin-boundaries-ui

0 stars 1 forks source link

Changes to Stats_Meshblock_Concordance.csv #16

Closed jason-bedford closed 6 years ago

jason-bedford commented 7 years ago

As part of the changes Stats NZ made in the delivery of their concordance file, the file name has changed from "Stats_Meshblock_Concordance.csv" to "stats-meshblock-concordance-es.csv", and the following column names have also had any spaces replaced with underscores. "TA Ward" is now "TA_Ward", "Community Board" is now "Community_Board", "TA Subdivision" is now "TA_Subdivision", "TA Maori_Ward" is now "TA_Maori_Ward", "Region Constituency" is now "Region_Constituency", "Region Maori Constituency" is now "Region_Maori_Constituency", "DHB Constituency" is now "DHB_Constituency", "GED 2007" is now "GED_2007", "MED 2007" is now "MED_2007", "High Court" is now "High_Court", "District Court" is now "District_Court", "Licensing Trust Ward" is now "Licensing_Trust_Ward".

I assume the uploader will need changing to accept the new names?

ghost commented 7 years ago

@jason-bedford This might be a good opportunity to swap out the column names in the original tables too. Should we be concerned about downstream affects e.g. AIMS

Reference: https://github.com/linz/admin-bdys/issues/2

jason-bedford commented 7 years ago

I don't think it would affect AIMS, as I don't think it uses the concordance file. I could be wrong though. @dwsilk Would this have any effect on the nzgss_extract generator, as I believe it uses the concordance file?

imincik commented 7 years ago

@jrlinz , go on with this task. I suggest fixing column names (without spaces) and create backward compatibility for those who require spaces with views.

ghost commented 7 years ago

From @jason-bedford "It should be this one: https://datafinder.stats.govt.nz/table/40083-stats-meshblock-concordance-es/

I’ve attached a copy of it."

ghost commented 7 years ago

@jason-bedford First import of 40083 gives the following. Correct?

CREATE TABLE dstest.meshblock_concordance
(
  ogc_fid serial NOT NULL,
  objectid character varying,
  meshblock character varying,
  ta character varying,
  ta_ward character varying,
  community_board character varying,
  ta_subdivision character varying,
  ta_maori_ward character varying,
  region character varying,
  region_constituency character varying,
  region_maori_constituency character varying,
  dhb character varying,
  dhb_constituency character varying,
  ged_2007 character varying,
  med_2007 character varying,
  high_court character varying,
  district_court character varying,
  ged character varying,
  med character varying,
  licensing_trust_ward character varying,
  CONSTRAINT meshblock_concordance_pkey PRIMARY KEY (ogc_fid)
)
WITH (
  OIDS=FALSE
);
jason-bedford commented 7 years ago

@jrlinz Yes, that looks correct.

imincik commented 7 years ago

@jrlinz , is it done ? If not, would you please provide update on this task ?

ghost commented 6 years ago
CREATE TABLE admin_bdys.meshblock_concordance
(
  ogc_fid serial NOT NULL,
  objectid character varying,
  meshblock character varying,
  ta character varying,
  "ta ward" character varying,
  "community board" character varying,
  "ta subdivision" character varying,
  "ta maori_ward" character varying,
  region character varying,
  "region constituency" character varying,
  "region maori constituency" character varying,
  dhb character varying,
  "dhb constituency" character varying,
  "ged 2007" character varying,
  "med 2007" character varying,
  "high court" character varying,
  "district court" character varying,
  ged character varying,
  med character varying,
  "licensing trust ward" character varying,
  CONSTRAINT meshblock_concordance_pkey PRIMARY KEY (ogc_fid)
)
WITH (
  OIDS=FALSE
);

meshblock_concordance (above) migrated to (below). Assessing impact to import function on tst1

CREATE TABLE admin_bdys.meshblock_concordance
(
  ogc_fid serial NOT NULL,
  objectid character varying,
  meshblock character varying,
  ta character varying,
  ta_ward character varying,
  community_board character varying,
  ta_subdivision character varying,
  ta_maori_ward character varying,
  region character varying,
  region_constituency character varying,
  region_maori_constituency character varying,
  dhb character varying,
  dhb_constituency character varying,
  ged_2007 character varying,
  med_2007 character varying,
  high_court character varying,
  district_court character varying,
  ged character varying,
  med character varying,
  licensing_trust_ward character varying,
  CONSTRAINT meshblock_concordance_pkey PRIMARY KEY (ogc_fid)
)
WITH (
  OIDS=FALSE
);
ghost commented 6 years ago

@jason-bedford testing found bug elaborated here https://github.com/linz/postgresql-tableversion/issues/69 otherwise looks good to deploy

ghost commented 6 years ago

tested on tst2 implemented on prd3