Encapsulate cleaning function and restructure
This commit is contained in:
43
geocoder/extension/expected/30_admin1_test.out
Normal file
43
geocoder/extension/expected/30_admin1_test.out
Normal file
@@ -0,0 +1,43 @@
|
||||
-- Check that the geocoding functions are callable, should return NULL
|
||||
SELECT (geocode_admin1_polygons(Array['TX','Cuidad Real', 'sevilla'])).*;
|
||||
q | geom | success
|
||||
-------------+------+---------
|
||||
TX | | f
|
||||
Cuidad Real | | f
|
||||
sevilla | | f
|
||||
(3 rows)
|
||||
|
||||
SELECT (geocode_admin1_polygons(Array['NH', 'Vermont'], 'United States')).*;
|
||||
q | geom | success
|
||||
---------+------+---------
|
||||
NH | | f
|
||||
Vermont | | f
|
||||
(2 rows)
|
||||
|
||||
SELECT (geocode_admin1_polygons(Array['az', 'az'], Array['Ecuador', 'USA'])).*;
|
||||
q | c | geom | success
|
||||
----+---------+------+---------
|
||||
az | Ecuador | | f
|
||||
az | USA | | f
|
||||
(2 rows)
|
||||
|
||||
-- Add a few data to the sources
|
||||
INSERT INTO global_province_polygons (the_geom, synonyms, iso3) VALUES (
|
||||
'0106000020E610000001000000010300000001000000040000000000000000E000C01F383D7839B740400000000000E000C0AA3C0EDE220F3B4000000000004812404FB7FCCD04893D400000000000E000C01F383D7839B74040',
|
||||
Array['vipava','obcina vipava','vipava, obcina'],
|
||||
'SVN'
|
||||
);
|
||||
-- Check that the synonym function is callable, should return true
|
||||
SELECT (geocode_admin1_polygons(Array['obcina vipava'])).success;
|
||||
success
|
||||
---------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
-- Check that it returns the mocked geometry above
|
||||
SELECT (geocode_admin1_polygons(Array['obcina vipava'])).geom;
|
||||
geom
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
0106000020E610000001000000010300000001000000040000000000000000E000C01F383D7839B740400000000000E000C0AA3C0EDE220F3B4000000000004812404FB7FCCD04893D400000000000E000C01F383D7839B74040
|
||||
(1 row)
|
||||
|
||||
Reference in New Issue
Block a user