CartoDB / bigmetadata

BSD 3-Clause "New" or "Revised" License
43 stars 11 forks source link

Fixes for uk #616

Closed juanignaciosl closed 5 years ago

juanignaciosl commented 5 years ago

This addresses CartoDB/bigmetadata/issues/612.

I've also made a minor fix and some integration tests at CartoDB/do_tiler/pull/59 (and added a nice-to-have).

First CR, for acceptance I'll move the data (12 and 13 from XYZ table, postcode units and sectors MC tables and UK names tables) to staging and ask for acceptance.

Code is now fixed (so running it from scratch will generate the right data), but I'll apply the fix manually on top of current data.

Export:

psql -U postgres gis --port 5555 --host 0.0.0.0 -Atc "copy (select * from tiler.xyz_uk_do_geoms where z in (12, 13)) to stdout" > ./xyz_uk_do_geoms_12_13.dump'
pg_dump -U docker -d gis --port 5555 --host 0.0.0.0 -d gis -t "\"uk.mastercard\".mc_postcode_unit" > ./mc_postcode_unit.dump
pg_dump -U docker -d gis --port 5555 --host 0.0.0.0 -d gis -t "\"uk.mastercard\".mc_postcode_sector" > ./mc_postcode_sector.dump
pg_dump -U docker -d gis --port 5555 --host 0.0.0.0 -d gis -t "tiler.uk_dz_hierarchy_geonames_2011" > ./uk_dz_hierarchy_geonames_2011.dump

Import:

psql -U postgres gis -Atc 'DELETE FROM tiler.xyz_uk_do_geoms WHERE z IN (12, 13);
cat /tmp/xyz_uk_do_geoms_12_13.dump | psql -U postgres -d gis -Atc "copy tiler.xyz_uk_do_geoms from stdin"

psql -U postgres gis -Atc 'DROP TABLE "uk.mastercard".mc_postcode_unit'
cat /tmp/mc_postcode_unit.dump | psql -U postgres -d gis
psql -U postgres gis -Atc 'DROP TABLE "uk.mastercard".mc_postcode_sector'
cat /tmp/mc_postcode_sector.dump | psql -U postgres -d gis
psql -U postgres gis -Atc 'GRANT USAGE ON SCHEMA "uk.mastercard" TO geocoder_api; GRANT SELECT ON ALL TABLES IN SCHEMA "uk.mastercard" TO geocoder_api;'

psql -U postgres gis -Atc 'DROP TABLE tiler.uk_dz_hierarchy_geonames_2011'
cat /tmp/uk_dz_hierarchy_geonames_2011.dump | psql -U postgres -d gis
psql -U postgres gis -Atc 'GRANT USAGE ON SCHEMA tiler TO geocoder_api; GRANT SELECT ON ALL TABLES IN SCHEMA tiler TO geocoder_api;'
juanignaciosl commented 5 years ago

Comment honored, and I answered another one. :+1: , :-1: , @antoniocarlon , @alrocar ?

alrocar commented 5 years ago

Assigning back to @juanignaciosl for deployment