263 lines
77 KiB
Bash
263 lines
77 KiB
Bash
#!/bin/sh
|
|
|
|
|
|
#################################################### TESTS GO HERE ####################################################
|
|
|
|
function test_geocoding_quality_admin1_usa() {
|
|
#Checks count of american states
|
|
sql "SELECT count(*) from global_province_polygons where gu_a3 = 'USA'" should 51
|
|
sql "SELECT count(*) FROM admin1_decoder where iso2 = 'US'" should 51
|
|
|
|
#Checks american states
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-117.215350385412 41.9995402214041,-117.215350385412 48.9925145470544,-111.050238080323 48.9925145470544,-111.050238080323 41.9995402214041,-117.215350385412 41.9995402214041))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Idaho' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-79.7630066354479 40.4994345620001,-79.7630066354479 45.0101219690002,-71.8574112619999 45.0101219690002,-71.8574112619999 40.4994345620001,-79.7630066354479 40.4994345620001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'New York' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-178.304366163 18.9061171430002,-178.304366163 28.4016785750001,-154.814063566 28.4016785750001,-154.814063566 18.9061171430002,-178.304366163 18.9061171430002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hawaii' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-124.566761848 41.9995402213723,-124.566761848 46.255943786,-116.454998822338 46.255943786,-116.454998822338 41.9995402213723,-124.566761848 41.9995402213723))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Oregon' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-95.7730408143821 35.9861857281888,-95.7730408143821 40.6188029164215,-89.1188904240538 40.6188029164215,-89.1188904240538 35.9861857281888,-95.7730408143821 35.9861857281888))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Missouri' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-79.4879333916127 37.9135152560001,-79.4879333916127 39.7217570184716,-75.0439753897762 39.7217570184716,-75.0439753897762 37.9135152560001,-79.4879333916127 37.9135152560001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Maryland' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-89.577948041369 36.4986369002728,-89.577948041369 39.1462199085219,-81.9652283144351 39.1462199085219,-81.9652283144351 36.4986369002728,-89.577948041369 36.4986369002728))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Kentucky' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-124.734607238 45.5663126819848,-124.734607238 48.9925148929891,-116.878826947306 48.9925148929891,-116.878826947306 45.5663126819848,-124.734607238 45.5663126819848))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Washington' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-73.5072449164197 41.2392566140001,-73.5072449164197 42.8867960797754,-69.9246720039999 42.8867960797754,-69.9246720039999 41.2392566140001,-73.5072449164197 41.2392566140001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Massachusetts' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-83.6674744083173 36.539774595821,-83.6674744083173 39.4508341665635,-75.2433354678788 39.4508341665635,-75.2433354678788 36.539774595821,-83.6674744083173 36.539774595821))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Virginia' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-85.6056824164103 30.3626994000573,-85.6056824164103 35.0004435414363,-80.8356827459999 35.0004435414363,-80.8356827459999 30.3626994000573,-85.6056824164103 30.3626994000573))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Georgia' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-92.9017273381461 42.4917999218514,-92.9017273381461 47.0815953638927,-86.8528676086401 47.0815953638927,-86.8528676086401 42.4917999218514,-92.9017273381461 42.4917999218514))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Wisconsin' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-77.1197809971952 38.8027675303789,-77.1197809971952 38.9961355802929,-76.9093145419325 38.9961355802929,-76.9093145419325 38.8027675303789,-77.1197809971952 38.8027675303789))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'District of Columbia' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-71.0849519608322 42.9784524830002,-71.0849519608322 47.4596882130001,-66.8919164699999 47.4596882130001,-66.8919164699999 42.9784524830002,-71.0849519608322 42.9784524830002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Maine' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-90.412542767235 41.6968055068686,-90.412542767235 48.1907593949248,-82.414603028 48.1907593949248,-82.414603028 41.6968055068686,-90.412542767235 41.6968055068686))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Michigan' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-91.6573425717023 30.1815453150001,-91.6573425717023 35.0000773303045,-88.088153119271 35.0000773303045,-88.088153119271 30.1815453150001,-91.6573425717023 30.1815453150001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Mississippi' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-83.355487103447 32.0324747915785,-83.355487103447 35.2183146349126,-78.5731452474061 35.2183146349126,-78.5731452474061 32.0324747915785,-83.355487103447 32.0324747915785))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'South Carolina' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-91.5189392524445 36.9783244005507,-91.5189392524445 42.5117716657298,-87.5112244082798 42.5117716657298,-87.5112244082798 36.9783244005507,-91.5189392524445 36.9783244005507))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Illinois' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-84.3246277278873 33.8479678410001,-84.3246277278873 36.6095499860431,-75.4518123039999 36.6095499860431,-75.4518123039999 33.8479678410001,-84.3246277278873 33.8479678410001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'North Carolina' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-96.6379578063076 40.3795206890285,-96.6379578063076 43.5009562360414,-90.1402771420764 43.5009562360414,-90.1402771420764 40.3795206890285,-96.6379578063076 40.3795206890285))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Iowa' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-124.409201971 32.5316694900037,-124.409201971 41.9995402214042,-114.119061321723 41.9995402214042,-114.119061321723 32.5316694900037,-124.409201971 32.5316694900037))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'California' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-97.2292175720333 43.5001261581956,-97.2292175720333 49.3694941211523,-89.5817526389605 49.3694941211523,-89.5817526389605 43.5001261581956,-97.2292175720333 43.5001261581956))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Minnesota' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-116.048944134764 44.3766154157689,-116.048944134764 48.9926179000001,-104.03859257169 48.9926179000001,-104.03859257169 44.3766154157689,-116.048944134764 44.3766154157689))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Montana' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-109.046624798995 36.9998087752547,-109.046624798995 40.9998331892503,-102.039569135107 40.9998331892503,-102.039569135107 36.9998087752547,-109.046624798995 36.9998087752547))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Colorado' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-104.047574447101 45.9417521349531,-104.047574447101 48.9926695770001,-96.556341595788 48.9926695770001,-96.556341595788 45.9417521349531,-104.047574447101 45.9417521349531))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'North Dakota' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-114.042547649554 36.9998087752547,-114.042547649554 42.000077329805,-109.04633182955 42.000077329805,-109.04633182955 36.9998087752547,-114.042547649554 36.9998087752547))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Utah' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-111.05138554061 40.9998331892503,-111.05138554061 45.0001017440003,-104.052362103228 45.0001017440003,-104.052362103228 40.9998331892503,-111.05138554061 40.9998331892503))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Wyoming' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-120.000750774928 35.0035685407555,-120.000750774928 42.000077329805,-114.04020390029 42.000077329805,-114.04020390029 35.0035685407555,-120.000750774928 35.0035685407555))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Nevada' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-114.822108115 31.3271845500002,-114.822108115 37.0031290884367,-109.046624798995 37.0031290884367,-109.046624798995 31.3271845500002,-114.822108115 31.3271845500002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Arizona' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-102.051263471132 36.9998087752547,-102.051263471132 40.0001017441002,-94.6104675723206 40.0001017441002,-94.6104675723206 36.9998087752547,-102.051263471132 36.9998087752547))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Kansas' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-73.722967571796 41.001066763079,-73.722967571796 42.0545451031741,-71.795745892259 42.0545451031741,-71.795745892259 41.001066763079,-73.722967571796 41.001066763079))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Connecticut' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-82.6373718693163 37.2047648298331,-82.6373718693163 40.6467814323172,-77.7346863218163 40.6467814323172,-77.7346863218163 37.2047648298331,-82.6373718693163 37.2047648298331))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'West Virginia' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-109.047430462973 31.3273912560001,-109.047430462973 36.9998087752547,-103.000238080223 36.9998087752547,-103.000238080223 31.3273912560001,-109.047430462973 31.3273912560001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'New Mexico' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-94.6183288997589 33.010941587984,-94.6183288997589 36.4998331892503,-89.6673035098491 36.4998331892503,-89.6673035098491 33.010941587984,-94.6183288997589 33.010941587984))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Arkansas' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-104.053729291274 40.0001017441002,-104.053729291274 43.0003702990501,-95.3172546806589 43.0003702990501,-95.3172546806589 40.0001017441002,-104.053729291274 40.0001017441002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Nebraska' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-103.000799603419 33.6474161968,-103.000799603419 36.9998087752547,-94.4390808525992 36.9998087752547,-94.4390808525992 33.6474161968,-103.000799603419 33.6474161968))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Oklahoma' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-104.05665897763 42.5183390495075,-104.05665897763 45.9420206887038,-96.4535583921061 45.9420206887038,-96.4535583921061 42.5183390495075,-104.05665897763 42.5183390495075))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'South Dakota' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-94.0432312444264 28.9283714860002,-94.0432312444264 33.0143351428526,-88.8109431629999 33.0143351428526,-88.8109431629999 28.9283714860002,-94.0432312444264 28.9283714860002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Louisiana' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-106.662176556003 25.8439016730001,-106.662176556003 36.5001994003821,-93.5147644471216 36.5001994003821,-93.5147644471216 25.8439016730001,-106.662176556003 25.8439016730001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Texas' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-90.312664837812 34.9836466661608,-90.312664837812 36.6897013529352,-81.6588562442202 36.6897013529352,-81.6588562442202 34.9836466661608,-90.312664837812 34.9836466661608))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Tennessee' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-75.7886437150354 38.4532755725098,-75.7886437150354 39.8386271352341,-75.0439753897762 39.8386271352341,-75.0439753897762 38.4532755725098,-75.7886437150354 38.4532755725098))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Delaware' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-72.55617069702 42.7008585802593,-72.55617069702 45.3042925779203,-70.7042130199999 45.3042925779203,-70.7042130199999 42.7008585802593,-72.55617069702 42.7008585802593))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'New Hampshire' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-71.8471675782502 41.1457789730002,-71.8471675782502 42.0164103383665,-71.1219656377723 42.0164103383665,-71.1219656377723 41.1457789730002,-71.8471675782502 41.1457789730002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Rhode Island' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-73.4385437438987 42.7292765489735,-73.4385437438987 45.0137310749146,-71.5057068297064 45.0137310749146,-71.5057068297064 42.7292765489735,-73.4385437438987 42.7292765489735))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Vermont' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-88.4861511664431 30.2236188820001,-88.4861511664431 35.009745299506,-84.8979431580503 35.009745299506,-84.8979431580503 30.2236188820001,-88.4861511664431 30.2236188820001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Alabama' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-87.6269226499603 24.5425479190002,-87.6269226499603 31.0001017441002,-80.0323787099999 31.0001017441002,-80.0323787099999 24.5425479190002,-87.6269226499603 24.5425479190002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Florida' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-88.1118591737619 37.7819376824781,-88.1118591737619 41.7595592705749,-84.7839538998525 41.7595592705749,-84.7839538998525 37.7819376824781,-88.1118591737619 37.7819376824781))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Indiana' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-84.8235290961908 38.4055216662919,-84.8235290961908 41.9844627777393,-80.5202331974041 41.9844627777393,-80.5202331974041 38.4055216662919,-84.8235290961908 38.4055216662919))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ohio' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-75.5582169259999 38.9243838560002,-75.5582169259999 41.3562540880558,-73.9071338861501 41.3562540880558,-73.9071338861501 38.9243838560002,-75.5582169259999 38.9243838560002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'New Jersey' and admin = 'United States of America'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-80.5202331974041 39.7210490101037,-80.5202331974041 42.2685127634337,-74.6985535096368 42.2685127634337,-74.6985535096368 39.7210490101037,-80.5202331974041 39.7210490101037))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Pennsylvania' and admin = 'United States of America'" should true
|
|
|
|
}
|
|
function test_geocoding_quality_admin1_france() {
|
|
#Checks count of France departments
|
|
sql "SELECT count(*) from global_province_polygons where admin = 'France'" should 101
|
|
|
|
#Checks France departments
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-61.228830533 14.4081078150001,-61.228830533 14.876898505,-60.8104141919999 14.876898505,-60.8104141919999 14.4081078150001,-61.228830533 14.4081078150001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Martinique' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((45.0424910820001 -12.9891903629999,45.0424910820001 -12.6472307269999,45.2908634770001 -12.6472307269999,45.2908634770001 -12.9891903629999,45.0424910820001 -12.9891903629999))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Mayotte' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.67469206488684 45.2364963328395,3.67469206488684 46.2761990465488,4.76982600106911 46.2761990465488,4.76982600106911 45.2364963328395,3.67469206488684 45.2364963328395))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Loire' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.61987509236161 48.8828812748509,1.61987509236161 49.2306644911733,2.58333216065074 49.2306644911733,2.58333216065074 48.8828812748509,1.61987509236161 48.8828812748509))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Val-d''Oise' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.31651818526609 48.6895218917219,2.31651818526609 48.8592006729727,2.59897669232052 48.8592006729727,2.59897669232052 48.6895218917219,2.31651818526609 48.6895218917219))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Val-de-Marne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-54.6152921149999 2.11067332000007,-54.6152921149999 5.74476537500006,-51.649037239 5.74476537500006,-51.649037239 2.11067332000007,-54.6152921149999 2.11067332000007))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Guyane française' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((55.2254337900001 -21.3707821589999,55.2254337900001 -20.861423435,55.8545028 -20.861423435,55.8545028 -21.3707821589999,55.2254337900001 -21.3707821589999))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'La Réunion' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((8.54525800900012 41.331529039,8.54525800900012 42.38670482,9.40300540500004 42.38670482,9.40300540500004 41.331529039,8.54525800900012 41.331529039))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Corse-du-Sud' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.75537325906868 44.7089773067573,4.75537325906868 45.8799551342221,6.36972634759289 45.8799551342221,6.36972634759289 44.7089773067573,4.75537325906868 44.7089773067573))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Isère' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-61.7978409499999 15.8364932310001,-61.7978409499999 16.513088283,-60.9892471999999 16.513088283,-60.9892471999999 15.8364932310001,-61.7978409499999 15.8364932310001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Guadeloupe' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.86846892769887 44.2817189894398,3.86846892769887 45.3657069988789,4.8925705299061 45.3657069988789,4.8925705299061 44.2817189894398,3.86846892769887 44.2817189894398))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ardèche' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.74673800475512 45.6437490711627,4.74673800475512 46.5112185863686,6.13640018700008 46.5112185863686,6.13640018700008 45.6437490711627,4.74673800475512 45.6437490711627))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ain' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.96425014322949 48.8469449936166,2.96425014322949 50.0600993370147,4.25022187234154 50.0600993370147,4.25022187234154 48.8469449936166,2.96425014322949 48.8469449936166))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Aisne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.25389611231572 45.9570352156026,2.25389611231572 46.793215667469,4.0014474491405 46.793215667469,4.0014474491405 45.9570352156026,2.25389611231572 45.9570352156026))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Allier' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.50257543610749 43.6715822480223,5.50257543610749 44.6609231052171,6.94560144100012 44.6609231052171,6.94560144100012 43.6715822480223,5.50257543610749 43.6715822480223))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Alpes-de-Haute-Provence' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.63638651372662 43.4803458413672,6.63638651372662 44.3546228071715,7.69191247500009 44.3546228071715,7.69191247500009 43.4803458413672,6.63638651372662 43.4803458413672))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Alpes-Maritimes' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.03387909034774 49.2350150766844,4.03387909034774 50.1613320920001,5.39117393116942 50.1613320920001,5.39117393116942 49.2350150766844,4.03387909034774 49.2350150766844))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ardennes' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.832484925438962 42.5676424404556,0.832484925438962 43.3084401435978,2.16875206645474 43.3084401435978,2.16875206645474 42.5676424404556,0.832484925438962 42.5676424404556))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ariège' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.38948697614305 47.9222916382486,3.38948697614305 48.7107364922953,4.86244601667033 48.7107364922953,4.86244601667033 47.9222916382486,3.38948697614305 47.9222916382486))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Aube' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.69651572002442 42.6521608220643,1.69651572002442 43.4422536253045,3.24431399779652 43.4422536253045,3.24431399779652 42.6521608220643,1.69651572002442 42.6521608220643))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Aude' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.83399863532875 43.6904347873356,1.83399863532875 44.9353506061455,3.44751676358774 44.9353506061455,3.44751676358774 43.6904347873356,1.83399863532875 43.6904347873356))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Aveyron' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.9770725619492 48.1213530594377,6.9770725619492 49.0656827952248,8.20030521600003 49.0656827952248,8.20030521600003 48.1213530594377,6.9770725619492 48.1213530594377))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Bas-Rhin' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.22484218851019 43.1604286590001,4.22484218851019 43.9328261545034,5.81322486183791 43.9328261545034,5.81322486183791 43.1604286590001,4.22484218851019 43.1604286590001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Bouches-du-Rhône' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.91934043581247 48.2767435559703,1.91934043581247 48.7760721885806,2.57599329255646 48.7760721885806,2.57599329255646 48.2767435559703,1.91934043581247 48.2767435559703))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Essonne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.14691090191658 48.7522977730237,-1.14691090191658 49.4347150002775,0.431418015529005 49.4347150002775,0.431418015529005 48.7522977730237,-1.14691090191658 48.7522977730237))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Calvados' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.0587129994054 44.6223391200544,2.0587129994054 45.4800417891971,3.36973355715799 45.4800417891971,3.36973355715799 44.6223391200544,2.0587129994054 44.6223391200544))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Cantal' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.459265612418108 45.1920242002567,-0.459265612418108 46.1384634451319,0.924110905993587 46.1384634451319,0.924110905993587 45.1920242002567,-0.459265612418108 45.1920242002567))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Charente' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.55581620999993 45.1011452901231,-1.55581620999993 46.3624417249057,0.000336456262516549 46.3624417249057,0.000336456262516549 45.1011452901231,-1.55581620999993 45.1011452901231))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Charente-Maritime' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.77438681719784 46.4198013465549,1.77438681719784 47.6243533948932,3.07556362426189 47.6243533948932,3.07556362426189 46.4198013465549,1.77438681719784 46.4198013465549))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Cher' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.38511922387309 45.6738955566346,1.38511922387309 46.4520022756845,2.59774622370927 46.4520022756845,2.59774622370927 45.6738955566346,1.38511922387309 45.6738955566346))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Creuse' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.23891316351171 44.9328676957875,1.23891316351171 45.7608743192944,2.5254561815575 45.7608743192944,2.5254561815575 44.9328676957875,1.23891316351171 44.9328676957875))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Corrèze' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.69883520927752 46.5575877774801,5.69883520927752 47.5628629136925,7.04430342600006 47.5628629136925,7.04430342600006 46.5575877774801,5.69883520927752 46.5575877774801))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Doubs' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.06492645549153 46.902661472449,4.06492645549153 48.0220255286552,5.52171361988763 48.0220255286552,5.52171361988763 46.902661472449,4.06492645549153 46.902661472449))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Côte-d''Or' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.63853919181511 48.0344510665635,-3.63853919181511 48.8766543640001,-1.90887870408892 48.8766543640001,-1.90887870408892 48.0344510665635,-3.63853919181511 48.0344510665635))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Côtes-d''Armor' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.946003911751063 45.9697134387242,-0.946003911751063 47.1006351124205,0.204704140183964 47.1006351124205,0.204704140183964 45.9697134387242,-0.946003911751063 45.9697134387242))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Deux-Sèvres' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.267905741456758 43.3109340400739,-0.267905741456758 44.0728139524019,1.1923311305772 44.0728139524019,1.1923311305772 43.3109340400739,-0.267905741456758 43.3109340400739))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Gers' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.033556367432368 44.5745334344704,-0.033556367432368 45.7103372082956,1.45863973463611 45.7103372082956,1.45863973463611 44.5745334344704,-0.033556367432368 44.5745334344704))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Dordogne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.65752901695055 44.1217800188328,4.65752901695055 45.3439321647376,5.83062720568103 45.3439321647376,5.83062720568103 44.1217800188328,4.65752901695055 44.1217800188328))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Drôme' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.294264260219052 48.665088297387,0.294264260219052 49.4936002922197,1.78343955209368 49.4936002922197,1.78343955209368 48.665088297387,0.294264260219052 48.665088297387))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Eure' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((8.57048587291243 41.8340528807359,8.57048587291243 43.0174014340001,9.55958092500009 43.0174014340001,9.55958092500009 41.8340528807359,8.57048587291243 41.8340528807359))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Corse' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.775114317671694 47.9509329967604,0.775114317671694 48.9395487575691,1.99973838781634 48.9395487575691,1.99973838781634 47.9509329967604,0.775114317671694 47.9509329967604))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Eure-et-Loir' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.14064011115218 43.9673211957165,-0.14064011115218 44.762337904071,1.07721082382048 44.762337904071,1.07721082382048 43.9673211957165,-0.14064011115218 43.9673211957165))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Lot-et-Garonne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.13280188699994 47.7737491073122,-5.13280188699994 48.7332217470001,-3.38584775506988 48.7332217470001,-3.38584775506988 47.7737491073122,-5.13280188699994 47.7737491073122))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Finistère' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.28614956974687 43.4587742179557,3.28614956974687 44.4578518084142,4.84981173892066 44.4578518084142,4.84981173892066 43.4587742179557,3.28614956974687 43.4587742179557))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Gard' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.26036536399991 44.1979592205416,-1.26036536399991 45.5733096370001,0.322169964272433 45.5733096370001,0.322169964272433 44.1979592205416,-1.26036536399991 44.1979592205416))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Gironde' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.441635301428022 42.6844758100001,0.441635301428022 43.9183242007012,2.05313194438369 43.9183242007012,2.05313194438369 42.6844758100001,0.441635301428022 42.6844758100001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Garonne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.86892314408783 47.4167967730001,6.86892314408783 48.30340737545,7.62111576300006 48.30340737545,7.62111576300006 47.4167967730001,6.86892314408783 47.4167967730001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Rhin' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.98011440175821 44.1134413951043,2.98011440175821 44.9567959196959,3.99399871806642 44.9567959196959,3.99399871806642 44.1134413951043,2.98011440175821 44.1134413951043))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Lozère' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.10353481697823 44.7509121226963,3.10353481697823 45.4218911526546,4.47816621719721 45.4218911526546,4.47816621719721 44.7509121226963,3.10353481697823 44.7509121226963))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Loire' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.37489232522063 47.2604422478114,5.37489232522063 48.0086991119745,6.83601167409952 48.0086991119745,6.83601167409952 47.2604422478114,5.37489232522063 47.2604422478114))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Saône' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.63727022663971 47.588307250679,4.63727022663971 48.6932792160629,5.89781959100137 48.6932792160629,5.89781959100137 47.588307250679,4.63727022663971 47.588307250679))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Marne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.82421119039415 45.6835635258361,5.82421119039415 46.4573721320001,7.02208256000011 46.4573721320001,7.02208256000011 45.6835635258361,5.82421119039415 45.6835635258361))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Savoie' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.635895562430306 45.4464734175142,0.635895562430306 46.3970596467853,1.90938682214414 46.3970596467853,1.90938682214414 45.4464734175142,0.635895562430306 45.4464734175142))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Haute-Vienne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.55516321421098 43.219427801776,2.55516321421098 43.9706520831271,4.18070038501475 43.9706520831271,4.18070038501475 43.219427801776,2.55516321421098 43.219427801776))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hérault' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.4267258233381 44.1886757735681,5.4267258233381 45.1247878695645,7.0551554760001 45.1247878695645,7.0551554760001 44.1886757735681,5.4267258233381 44.1886757735681))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hautes-Alpes' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.317058575492865 42.6686886600001,-0.317058575492865 43.6117507021333,0.644904351954295 43.6117507021333,0.644904351954295 42.6686886600001,-0.317058575492865 42.6686886600001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hautes-Pyrénées' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.28734673646272 47.6326261001145,-2.28734673646272 48.712144273,-1.03933277298907 48.712144273,-1.03933277298907 47.6326261001145,-2.28734673646272 47.6326261001145))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ille-et-Vilaine' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.880750843576578 46.3509390389055,0.880750843576578 47.2892154424387,2.19467980163154 47.2892154424387,2.19467980163154 46.3509390389055,0.880750843576578 46.3509390389055))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Indre' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.0667597989255739 46.7432278722684,0.0667597989255739 47.7061466108774,1.36235555096795 47.7061466108774,1.36235555096795 46.7432278722684,0.0667597989255739 46.7432278722684))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Indre-et-Loire' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.25015355154522 46.2606863500949,5.25015355154522 47.2922147102406,6.20664528695045 47.2922147102406,6.20664528695045 46.2606863500949,5.25015355154522 46.2606863500949))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Jura' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.51396964117239 43.4899892231241,-1.51396964117239 44.5297683153554,0.135490270459684 44.5297683153554,0.135490270459684 43.4899892231241,-1.51396964117239 43.4899892231241))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Landes' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.601969780381069 47.1862735434892,0.601969780381069 48.1307132770961,2.25864220617285 48.1307132770961,2.25864220617285 47.1862735434892,0.601969780381069 47.1862735434892))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Loir-et-Cher' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.51590047852423 47.4849918165191,1.51590047852423 48.3390689983356,3.11792690690126 48.3390689983356,3.11792690690126 47.4849918165191,1.51590047852423 47.4849918165191))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Loiret' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.55638587099989 46.8599466268353,-2.55638587099989 47.8251944665513,-0.923778569425394 47.8251944665513,-0.923778569425394 46.8599466268353,-2.55638587099989 46.8599466268353))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Loire-Atlantique' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.998268623298344 44.2204811943516,0.998268623298344 45.045049097238,2.20531456811284 45.045049097238,2.20531456811284 44.2204811943516,0.998268623298344 44.2204811943516))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Lot' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.33925954239396 46.988091162777,-1.33925954239396 47.8095389487635,0.241772012268569 47.8095389487635,0.241772012268569 46.988091162777,-1.33925954239396 46.988091162777))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Maine-et-Loire' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.94562740799992 48.4629288663742,-1.94562740799992 49.7263858090001,-0.73681323024644 49.7263858090001,-0.73681323024644 48.4629288663742,-1.94562740799992 48.4629288663742))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Manche' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.39491422281316 48.5258036245376,3.39491422281316 49.4072916953554,5.03414035939002 49.4072916953554,5.03414035939002 48.5258036245376,3.39491422281316 48.5258036245376))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Marne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.24296437260767 47.7350516407206,-1.24296437260767 48.5612784789187,-0.0527275104662408 48.5612784789187,-0.0527275104662408 47.7350516407206,-1.24296437260767 47.7350516407206))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Mayenne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.46412328616077 48.3574930709485,5.46412328616077 49.5494314580001,7.08864971521223 49.5494314580001,7.08864971521223 48.3574930709485,5.46412328616077 48.3574930709485))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Meurhe-et-Moselle' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.90691867445724 48.4118644109138,4.90691867445724 49.6088122332565,5.84956763663718 49.6088122332565,5.84956763663718 48.4118644109138,4.90691867445724 48.4118644109138))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Meuse' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.39823449662472 45.2886160006279,2.39823449662472 46.2626638891272,3.969191588521 46.2626638891272,3.969191588521 45.2886160006279,2.39823449662472 45.2886160006279))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Puy-de-Dôme' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.73247740650703 47.296616929,-3.73247740650703 48.207463768638,-2.05166801606606 48.207463768638,-2.05166801606606 47.296616929,-3.73247740650703 47.296616929))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Morbihan' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.92409888915245 48.5234415632775,5.92409888915245 49.4994086720001,7.64493234860686 49.4994086720001,7.64493234860686 48.5234415632775,5.92409888915245 48.5234415632775))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Moselle' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.85596888925286 46.6499649295378,2.85596888925286 47.5787601314749,4.22405243806961 47.5787601314749,4.22405243806961 46.6499649295378,2.85596888925286 46.6499649295378))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Nièvre' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.70700647000007 42.3256605030001,1.70700647000007 42.9138002359921,3.18156985800002 42.9138002359921,3.18156985800002 42.3256605030001,1.70700647000007 42.3256605030001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Pyrénées-Orientales' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.06332401329041 49.9690446462933,2.06332401329041 51.0875408834804,4.21031620300005 51.0875408834804,4.21031620300005 49.9690446462933,2.06332401329041 49.9690446462933))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Nord' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.25263886419222 45.4444570709371,4.25263886419222 46.2991934315316,5.15690159403334 46.2991934315316,5.15690159403334 45.4444570709371,4.25263886419222 45.4444570709371))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Rhône' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.67915732155316 49.0678031564904,1.67915732155316 49.7656217865162,3.16938686980825 49.7656217865162,3.16938686980825 49.0678031564904,1.67915732155316 49.0678031564904))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Oise' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.741737851420709 43.7737770756515,0.741737851420709 44.3927468260052,1.97744250986392 44.3927468260052,1.97744250986392 43.7737770756515,0.741737851420709 43.7737770756515))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Tarn-et-Garonne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.862705568806973 48.1808329075126,-0.862705568806973 48.9705961218136,0.979811591431741 48.9705961218136,0.979811591431741 48.1808329075126,-0.862705568806973 48.1808329075126))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Orne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.55518639400009 50.0180326849605,1.55518639400009 51.0143195135616,3.16929897996394 51.0143195135616,3.16929897996394 50.0180326849605,1.55518639400009 50.0180326849605))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Pas-de-Calais' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.79717240399995 42.7726358040001,-1.79717240399995 43.5920632016554,0.023231965282946 43.5920632016554,0.023231965282946 42.7726358040001,-1.79717240399995 42.7726358040001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Pyrénées-Atlantiques' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((3.62488005117342 46.1717520206392,3.62488005117342 47.1553250561064,5.45882787560592 47.1553250561064,5.45882787560592 46.1717520206392,3.62488005117342 46.1717520206392))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Saône-et-Loire' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.444313218780024 47.5802213130631,-0.444313218780024 48.4740909755181,0.912882877442854 48.4740909755181,0.912882877442854 47.5802213130631,-0.444313218780024 47.5802213130631))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Sarthe' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.60048559583362 45.0535854737906,5.60048559583362 45.9387661024736,7.16067875200008 45.9387661024736,7.16067875200008 45.0535854737906,5.60048559583362 45.0535854737906))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Savoie' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.39066074359846 48.1216605422002,2.39066074359846 49.1062003749473,3.53780241165202 49.1062003749473,3.53780241165202 48.1216605422002,2.39066074359846 48.1216605422002))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Seien-et-Marne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.0753686860000755 49.2563065818833,0.0753686860000755 50.0657196742449,1.76948691408978 50.0657196742449,1.76948691408978 49.2563065818833,0.0753686860000755 49.2563065818833))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Seine-Maritime' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.26659630857279 48.8074711157993,2.26659630857279 49.0097843551639,2.59238489464721 49.0097843551639,2.59238489464721 48.8074711157993,2.26659630857279 48.8074711157993))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Seine-Saint-Denis' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.3730687422138 49.5750089868753,1.3730687422138 50.3756778020001,3.19307339462151 50.3756778020001,3.19307339462151 49.5750089868753,1.3730687422138 49.5750089868753))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Somme' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.54844198451002 43.383191122972,1.54844198451002 44.194509513803,2.93447719296813 44.194509513803,2.93447719296813 43.383191122972,1.54844198451002 43.383191122972))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Tarn' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.67218878615307 42.9871279970001,5.67218878615307 43.8065383075969,6.93318453905428 43.8065383075969,6.93318453905428 42.9871279970001,5.67218878615307 42.9871279970001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Var' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((4.65752901695055 43.666034151355,4.65752901695055 44.4288698739455,5.75377509254642 44.4288698739455,5.75377509254642 43.666034151355,4.65752901695055 43.666034151355))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Vaucluse' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.38292395699992 46.2791201840001,-2.38292395699992 47.0763223680829,-0.555286123855467 47.0763223680829,-0.555286123855467 46.2791201840001,-2.38292395699992 46.2791201840001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Vendée' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.10904283575826 46.0535171529941,-0.10904283575826 47.1605875074075,1.19468220481997 47.1605875074075,1.19468220481997 46.0535171529941,-0.10904283575826 46.0535171529941))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Vienne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.42239721006317 47.8189981772241,5.42239721006317 48.5234415632775,7.20903790337658 48.5234415632775,7.20903790337658 47.8189981772241,5.42239721006317 47.8189981772241))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Vosges' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.83087611524053 47.3123306774189,2.83087611524053 48.4117435609166,4.34114472694759 48.4117435609166,4.34114472694759 47.3123306774189,2.83087611524053 47.3123306774189))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Yonne' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.4434566289203 48.4441202715333,1.4434566289203 49.0825907547595,2.2265401548043 49.0825907547595,2.2265401548043 48.4441202715333,1.4434566289203 48.4441202715333))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Yvelines' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.22680382613567 48.8158317117641,2.22680382613567 48.9012174567202,2.47342041601945 48.9012174567202,2.47342041601945 48.8158317117641,2.22680382613567 48.8158317117641))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Paris' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.75908183166121 47.4268442610132,6.75908183166121 47.8241654757561,7.15149151412214 47.8241654757561,7.15149151412214 47.4268442610132,6.75908183166121 47.4268442610132))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Territoire de Belfort' and admin = 'France'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((2.15161339394297 48.7301053899517,2.15161339394297 48.9581266385335,2.3319649632125 48.9581266385335,2.3319649632125 48.7301053899517,2.15161339394297 48.7301053899517))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hauts-de-Seine' and admin = 'France'" should true
|
|
|
|
}
|
|
function test_geocoding_quality_admin1_germany() {
|
|
#Checks count of Germany states
|
|
sql "SELECT count(*) from global_province_polygons where admin = 'Germany'" should 16
|
|
|
|
#Checks Germany states
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((7.87989342500012 53.3638748237641,7.87989342500012 55.065334377,11.3142195970001 55.065334377,11.3142195970001 53.3638748237641,7.87989342500012 53.3638748237641))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Schleswig-Holstein' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((8.97658938998842 47.2711209110001,8.97658938998842 50.5628571637271,13.8168616120001 50.5628571637271,13.8168616120001 47.2711209110001,8.97658938998842 47.2711209110001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Bayern' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((5.85248986800011 50.3230800349579,5.85248986800011 52.5241844753332,9.46214114809555 52.5241844753332,9.46214114809555 50.3230800349579,5.85248986800011 50.3230800349579))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Nordrhein-Westfalen' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((11.2740899293068 51.3479771998879,11.2740899293068 53.5438112668764,14.7614034430001 53.5438112668764,14.7614034430001 51.3479771998879,11.2740899293068 51.3479771998879))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Brandenburg' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((10.601244744949 53.1082409268773,10.601244744949 54.6884219420001,14.3912605108821 54.6884219420001,14.3912605108821 53.1082409268773,10.601244744949 53.1082409268773))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Mecklenburg-Vorpommern' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.65951582100013 51.2904613309256,6.65951582100013 53.8924828150001,11.5813399590718 53.8924828150001,11.5813399590718 51.2904613309256,6.65951582100013 51.2904613309256))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Niedersachsen' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((9.87767134006029 50.2072716334791,9.87767134006029 51.6373652207284,12.6473730812027 51.6373652207284,12.6473730812027 50.2072716334791,9.87767134006029 50.2072716334791))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Thüringen' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.0964026290001 48.9582503311439,6.0964026290001 50.9327053903415,8.50457685693641 50.9327053903415,8.50457685693641 48.9582503311439,6.0964026290001 48.9582503311439))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Rheinland-Pfalz' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((7.5118717850001 47.532743111053,7.5118717850001 49.7955913357715,10.4951013530451 49.7955913357715,10.4951013530451 47.532743111053,7.5118717850001 47.532743111053))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Baden-Württemberg' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((8.49605024612202 53.0246190465318,8.49605024612202 53.6170967182623,8.98992190856922 53.6170967182623,8.98992190856922 53.0246190465318,8.49605024612202 53.0246190465318))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Bremen' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((11.8973930188728 50.1608153280001,11.8973930188728 51.6700764018045,15.0220593670001 51.6700764018045,15.0220593670001 50.1608153280001,11.8973930188728 50.1608153280001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Sachsen' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((9.74081038148518 53.4043891470415,9.74081038148518 53.7277802601508,10.3279797706499 53.7277802601508,10.3279797706499 53.4043891470415,9.74081038148518 53.4043891470415))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hamburg' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((6.34227909400011 49.1050141400001,6.34227909400011 49.629477443729,7.39058800633148 49.629477443729,7.39058800633148 49.1050141400001,6.34227909400011 49.1050141400001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Saarland' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((13.0916353696766 52.3420250511152,13.0916353696766 52.6635558131503,13.7509232930755 52.6635558131503,13.7509232930755 52.3420250511152,13.0916353696766 52.3420250511152))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Berlin' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((10.569618767692 50.927899482575,10.569618767692 53.0503022317625,13.2368461440344 53.0503022317625,13.2368461440344 50.927899482575,10.569618767692 50.927899482575))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Sachsen-Anhalt' and admin = 'Germany'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((7.77139163561549 49.3962875431356,7.77139163561549 51.6550127224591,10.2328951351024 51.6550127224591,10.2328951351024 49.3962875431356,7.77139163561549 49.3962875431356))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Hessen' and admin = 'Germany'" should true
|
|
}
|
|
function test_geocoding_quality_admin1_spain() {
|
|
#Checks count of Spanish provinces
|
|
sql "SELECT count(*) from global_province_polygons where admin = 'Spain' and gn_level = 2" should 52
|
|
|
|
#Checks Spanish provinces
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.44502967028305 43.0206203083805,-3.44502967028305 43.452500718,-2.40678374228841 43.452500718,-2.40678374228841 43.0206203083805,-3.44502967028305 43.0206203083805))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Bizkaia' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-8.34228593234988 41.8059506230001,-8.34228593234988 42.5784535436961,-6.73570736330419 42.5784535436961,-6.73570736330419 41.8059506230001,-8.34228593234988 41.8059506230001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Orense' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.17162390811683 42.8928343780041,-7.17162390811683 43.662949937,-4.51325904027243 43.662949937,-4.51325904027243 42.8928343780041,-7.17162390811683 42.8928343780041))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Asturias' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.33853390081885 37.3810364472372,-2.33853390081885 38.7540947544694,-0.701242641999897 38.7540947544694,-0.701242641999897 37.3810364472372,-2.33853390081885 37.3810364472372))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Murcia' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.21216881600009 38.6386463070001,1.21216881600009 40.0794131530001,4.3370874360001 40.0794131530001,4.3370874360001 38.6386463070001,1.21216881600009 38.6386463070001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Baleares' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.12096676270596 41.9184494092129,-3.12096676270596 42.6441157091727,-1.68578304685008 42.6441157091727,-1.68578304685008 41.9184494092129,-3.12096676270596 41.9184494092129))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'La Rioja' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.71217411297255 41.6455822609064,1.71217411297255 42.4937122600564,3.3177189460001 42.4937122600564,3.3177189460001 41.6455822609064,1.71217411297255 41.6455822609064))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Gerona' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-9.29198157499991 42.5307070980001,-9.29198157499991 43.793443101,-7.66832434799994 43.793443101,-7.66832434799994 42.5307070980001,-9.29198157499991 42.5307070980001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'La Coruña' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-15.8217667309999 27.73436107,-15.8217667309999 29.2894554710001,-13.4177953769999 29.2894554710001,-13.4177953769999 27.73436107,-15.8217667309999 27.73436107))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Las Palmas' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.324197625220194 41.2328323427384,0.324197625220194 42.8465847790001,1.84254599889874 42.8465847790001,1.84254599889874 41.2328323427384,0.324197625220194 41.2328323427384))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Lérida' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.28007849822407 42.4966828485346,-3.28007849822407 43.2049818881037,-2.23913428392001 43.2049818881037,-2.23913428392001 42.4966828485346,-3.28007849822407 42.4966828485346))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Álava' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.08445024288437 37.84291006155,-1.08445024288437 38.8827578799861,0.234548373000024 38.8827578799861,0.234548373000024 37.84291006155,-1.08445024288437 37.84291006155))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Alicante' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.839090541894961 39.7154401712134,-0.839090541894961 40.779914252241,0.523759592032405 40.779914252241,0.523759592032405 39.7154401712134,-0.839090541894961 39.7154401712134))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Castellón' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.51827389172669 38.6938305933073,-1.51827389172669 40.2032052681087,-0.0309952458669613 40.2032052681087,-0.0309952458669613 38.6938305933073,-1.51827389172669 38.6938305933073))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Valencia' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.60784368943473 36.2971052102187,-5.60784368943473 37.2775500216163,-3.76820494700067 37.2775500216163,-3.76820494700067 36.2971052102187,-5.60784368943473 36.2971052102187))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Málaga' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-4.33075990074883 41.4576502781378,-4.33075990074883 43.2011876492906,-2.51294185967905 43.2011876492906,-2.51294185967905 41.4576502781378,-4.33075990074883 41.4576502781378))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Burgos' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.88212459157663 38.0236225449445,-2.88212459157663 39.4220384789926,-0.903479377071619 39.4220384789926,-0.903479377071619 38.0236225449445,-2.88212459157663 38.0236225449445))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Albacete' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.1402264080223 36.6803653020001,-3.1402264080223 37.9156680803177,-1.64161771279365 37.9156680803177,-1.64161771279365 36.6803653020001,-3.1402264080223 36.6803653020001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Almería' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.727732713394 40.088819485331,-5.727732713394 41.1607886950422,-4.16129085938564 41.1607886950422,-4.16129085938564 40.088819485331,-5.727732713394 40.088819485331))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ávila' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.39885867893531 35.8473656790339,-5.39885867893531 35.926174221,-5.28307044199997 35.926174221,-5.28307044199997 35.8473656790339,-5.39885867893531 35.8473656790339))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ceuta' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((1.36998006352917 41.1921654321945,1.36998006352917 42.3183741882181,2.77849657777759 42.3183741882181,2.77849657777759 41.1921654321945,1.36998006352917 41.1921654321945))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Barcelona' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-6.43789628799991 36.006455796,-6.43789628799991 37.0458813116732,-5.08466373754143 37.0458813116732,-5.08466373754143 36.006455796,-6.43789628799991 36.006455796))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Cádiz' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.55728592999992 39.031473428356,-7.55728592999992 40.4803201357656,-4.94436967641946 40.4803201357656,-4.94436967641946 39.031473428356,-7.55728592999992 39.031473428356))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Cáceres' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-4.83603003575755 42.7625064149391,-4.83603003575755 43.518255927,-3.14954382958408 43.518255927,-3.14954382958408 42.7625064149391,-4.83603003575755 42.7625064149391))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Cantabria' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.60281916067569 42.9000690785251,-2.60281916067569 43.3950869810001,-1.74972998587506 43.3950869810001,-1.74972998587506 42.9000690785251,-2.60281916067569 42.9000690785251))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Gipuzkoa' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.03658626964057 38.3488740100276,-5.03658626964057 39.5767688586959,-2.6438421117241 39.5767688586959,-2.6438421117241 38.3488740100276,-5.03658626964057 38.3488740100276))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Ciudad Real' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.58182806351428 37.1865722346209,-5.58182806351428 38.7284115674399,-4.00087341347725 38.7284115674399,-4.00087341347725 37.1865722346209,-5.58182806351428 37.1865722346209))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Córdoba' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.17006527589177 39.2267334449925,-3.17006527589177 40.6597901401029,-1.14548010931955 40.6597901401029,-1.14548010931955 39.2267334449925,-3.17006527589177 39.2267334449925))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Cuenca' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-18.1672257149999 27.6422386740001,-18.1672257149999 28.855619032,-16.1177465489999 28.855619032,-16.1177465489999 27.6422386740001,-18.1672257149999 27.6422386740001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Santa Cruz de Tenerife' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-4.32030091575464 36.6955162870001,-4.32030091575464 38.0806474883909,-2.20964815713677 38.0806474883909,-2.20964815713677 36.6955162870001,-4.32030091575464 36.6955162870001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Granada' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.54577287431866 40.1553418793243,-3.54577287431866 41.3221292176893,-1.53705827501935 41.3221292176893,-1.53705827501935 40.1553418793243,-3.54577287431866 40.1553418793243))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Guadalajara' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.5296907149999 36.8081729190001,-7.5296907149999 38.2092959657362,-6.12440987141844 38.2092959657362,-6.12440987141844 36.8081729190001,-7.5296907149999 36.8081729190001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Huelva' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-4.28432068914844 37.3784374760087,-4.28432068914844 38.5331263293167,-2.43025956942355 38.5331263293167,-2.43025956942355 37.3784374760087,-4.28432068914844 37.3784374760087))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Jaén' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-0.924690434316119 41.3509290826111,-0.924690434316119 42.9187272272897,0.769545119311772 42.9187272272897,0.769545119311772 41.3509290826111,-0.924690434316119 41.3509290826111))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Huesca' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.0710357319135 42.0307521067243,-7.0710357319135 43.2385497103009,-4.72686357279562 43.2385497103009,-4.72686357279562 42.0307521067243,-7.0710357319135 42.0307521067243))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'León' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.9998091127004 42.3255262878079,-7.9998091127004 43.7526716170001,-6.82828569173128 43.7526716170001,-6.82828569173128 42.3255262878079,-7.9998091127004 42.3255262878079))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Lugo' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-4.71385317698247 40.6333680206177,-4.71385317698247 41.5832459861134,-3.19879147015018 41.5832459861134,-3.19879147015018 40.6333680206177,-4.71385317698247 40.6333680206177))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Segovia' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-4.57188595237477 39.8935342472078,-4.57188595237477 41.1617514102993,-3.06223649691677 41.1617514102993,-3.06223649691677 39.8935342472078,-4.57188595237477 39.8935342472078))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Madrid' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.49454505001398 41.908863430303,-2.49454505001398 43.3049288940001,-0.745031962827426 43.3049288940001,-0.745031962827426 41.908863430303,-2.49454505001398 41.908863430303))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Navarra' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.02695255381727 41.7632569794261,-5.02695255381727 43.0509384222704,-3.89246032338525 43.0509384222704,-3.89246032338525 41.7632569794261,-5.02695255381727 41.7632569794261))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Palencia' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-8.94261633999986 41.888902085,-8.94261633999986 42.8530128807398,-7.86814895151289 42.8530128807398,-7.86814895151289 41.888902085,-8.94261633999986 41.888902085))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Pontevedra' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((0.167463005613229 40.5261630293999,0.167463005613229 41.5761158587599,1.62782919386217 41.5761158587599,1.62782919386217 40.5261630293999,0.167463005613229 40.5261630293999))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Tarragona' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-6.94249141499995 40.2443655465327,-6.94249141499995 41.3029916103501,-5.09575992907745 41.3029916103501,-5.09575992907745 40.2443655465327,-6.94249141499995 40.2443655465327))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Salamanca' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-6.53137643917128 36.8420739305675,-6.53137643917128 38.1902015240811,-4.65323061530066 38.1902015240811,-4.65323061530066 36.8420739305675,-6.53137643917128 36.8420739305675))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Sevilla' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.52075506289583 41.0975074424145,-5.52075506289583 42.3093983579479,-3.98061462316633 42.3093983579479,-3.98061462316633 41.0975074424145,-5.52075506289583 41.0975074424145))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Valladolid' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-3.54296323936197 41.0637987333249,-3.54296323936197 42.1422083605273,-1.78554439895487 42.1422083605273,-1.78554439895487 41.0637987333249,-3.54296323936197 41.0637987333249))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Soria' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-1.80825619087048 39.8522447784737,-1.80825619087048 41.3543458309952,0.28972944495797 41.3543458309952,0.28972944495797 39.8522447784737,-1.80825619087048 39.8522447784737))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Teruel' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-5.39100907990507 39.2596704584249,-5.39100907990507 40.3094778512219,-2.90823909435872 40.3094778512219,-2.90823909435872 39.2596704584249,-5.39100907990507 39.2596704584249))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Toledo' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.02814429362425 41.1161512418863,-7.02814429362425 42.2528760285059,-5.22872746350166 42.2528760285059,-5.22872746350166 41.1161512418863,-7.02814429362425 41.1161512418863))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Zamora' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.96692012599988 35.2678742480001,-2.96692012599988 35.3297681250436,-2.91290659779662 35.3297681250436,-2.91290659779662 35.2678742480001,-2.96692012599988 35.2678742480001))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Melilla' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-2.17335018566254 40.943786733371,-2.17335018566254 42.7425593134615,0.377269320722576 42.7425593134615,0.377269320722576 40.943786733371,-2.17335018566254 40.943786733371))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Zaragoza' and admin = 'Spain'" should true
|
|
sql "SELECT ST_Intersects(ST_GeomFromText('POLYGON((-7.3592101639999 37.9389765490285,-7.3592101639999 39.4498145619925,-4.65839230026438 39.4498145619925,-4.65839230026438 37.9389765490285,-7.3592101639999 37.9389765490285))', 4326), ST_Centroid(the_geom)) FROM global_province_polygons where name = 'Badajoz' and admin = 'Spain'" should true
|
|
}
|
|
|
|
function test_geocoding_quality_admin1_italy() {
|
|
|
|
#Checks count of Italy provinces (2014 data)
|
|
sql "SELECT count(*) from global_province_polygons where admin = 'Italy'" should 110
|
|
|
|
|
|
}
|
|
|
|
|
|
#################################################### TESTS END HERE ####################################################
|