Encapsulate cleaning function and restructure

This commit is contained in:
Carla Iriberri
2015-12-01 14:11:44 +01:00
parent 49eb8213eb
commit 3e8f635404
24 changed files with 25 additions and 768 deletions

View File

@@ -0,0 +1,27 @@
-- Check that the synonym function is callable, should return NULL
SELECT (admin0_synonym_lookup(Array['United States', 'ESP'])).*;
q | adm0_a3
---------------+---------
United States |
ESP |
(2 rows)
-- Check that the geocoding function is callable, should return success = false
SELECT (geocode_admin0_polygons(Array['Spain', 'USA', ''])).*;
q | geom | success
-------+------+---------
| | f
Spain | | f
USA | | f
(3 rows)
-- Add a few synonyms
COPY admin0_synonyms (name, rank, created_at, updated_at, the_geom, the_geom_webmercator, cartodb_id, adm0_a3, name_) FROM stdin;
-- Check that the synonym function is callable, should return their iso codes
SELECT (admin0_synonym_lookup(Array['United States', 'ESP'])).*;
q | adm0_a3
---------------+---------
ESP | ESP
United States | USA
(2 rows)