Merge pull request #153 from CartoDB/iri/new_adm0_tests

Updates test structure
This commit is contained in:
Carla
2015-07-14 16:22:22 +02:00
12 changed files with 4593 additions and 1424 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

192
geocoder/admin0/test/run.sh Normal file
View File

@@ -0,0 +1,192 @@
#!/bin/sh
source data/test.sh
source functions/test.sh
#
# The following script has two use modes:
#
# API
# ====================================
# SQL_API_ROUTE and API_KEY need to be
# conveniently filled for the requests
# to work.
# Example: bash run.sh api sql_api_route api_key test_type
#
# SQL
# ====================================
# It is expected that you run this script
# as a PostgreSQL superuser, for example:
#
# bash run.sh db database role test_type
#
# test_type defines the kind of tests to run: data or functions
MODE=''
TEST_TYPE=''
# DB settings
DATABASE=''
ROLE=''
CMD='echo psql'
CMD=psql
# SQL API settings
SQL_API_ROUTE=''
API_KEY=''
OK=0
PARTIALOK=0
function set_failed() {
OK=1
PARTIALOK=1
}
function clear_partial_result() {
PARTIALOK=0
}
function sql() {
local QUERY="$1"
if [[ $MODE = "api" ]]
then
# SQL API mode
echo $QUERY
RESULT=$(curl -s -X POST "https://$SQL_API_ROUTE/sql?api_key=$API_KEY&format=csv" --data-urlencode "q=$QUERY" |tail -n1 | tr -d '\r')
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
# Database mode
elif [[ $MODE = "db" ]]
then
if [ -n "${ROLE}" ]; then
log_debug "Executing query '${QUERY}' as ${ROLE}"
RESULT=`${CMD} -U "${ROLE}" ${DATABASE} -c "${QUERY}" -A -t`
else
log_debug "Executing query '${QUERY}'"
RESULT=`${CMD} ${DATABASE} -c "${QUERY}" -A -t`
fi
CODERESULT=$?
echo ${RESULT}
echo
if [[ ${CODERESULT} -ne 0 ]]
then
echo -n "FAILED TO EXECUTE QUERY: "
log_warning "${QUERY}"
if [[ "$2" != "fails" ]]
then
log_error "${QUERY}"
set_failed
fi
else
if [[ "$2" == "fails" ]]
then
log_error "QUERY: '${QUERY}' was expected to fail and it did not fail"
set_failed
fi
fi
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
fi
}
function log_info()
{
echo
echo
echo
_log "1;34m" "$1"
}
function log_error() {
_log "1;31m" "$1"
}
function log_debug() {
_log "1;32m" "> $1"
}
function log_warning() {
_log "0;33m" "$1"
}
function _log() {
echo -e "\033[$1$2\033[0m"
}
# '############################ HELPERS #############################'
function run_tests() {
local FAILED_TESTS=()
local TESTS
MODE="$1"
if [[ $MODE = "api" ]]
then
SQL_API_ROUTE="$2"
API_KEY="$3"
TEST_TYPE="$4"
fi
if [[ $MODE = "db" ]]
then
DATABASE="$2"
ROLE="$3"
TEST_TYPE="$4"
fi
if [[ $# -ge 4 ]]
then
if [[ $TEST_TYPE = "data" ]]
then
TESTS=`cat data/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
elif [[ $TEST_TYPE = "functions" ]]
then
TESTS=`cat functions/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
fi
else
TESTS="$@"
fi
for t in ${TESTS}
do
echo "####################################################################"
echo "#"
echo "# Running: ${t}"
echo "#"
echo "####################################################################"
clear_partial_result
eval ${t}
if [[ ${PARTIALOK} -ne 0 ]]
then
FAILED_TESTS+=(${t})
fi
done
if [[ ${OK} -ne 0 ]]
then
echo
log_error "The following tests are failing:"
printf -- '\t%s\n' "${FAILED_TESTS[@]}"
else
echo
log_info "Test finished"
fi
}
run_tests $@
exit ${OK}

View File

@@ -0,0 +1,262 @@
#!/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 ####################################################

View File

@@ -0,0 +1,256 @@
#!/bin/sh
#################################################### TESTS GO HERE ####################################################
function test_geocoding_functions_admin1() {
# checks that an invalid input returns a false result and an empty geometry
sql "SELECT (geocode_admin1_polygons(Array['Null Island'])).success" should false
sql "SELECT (geocode_admin1_polygons(Array['Null Island'])).geom is null" should true
# check that the returned geometry is a polygon
sql "SELECT ST_GeometryType((geocode_admin1_polygons(Array['Barcelona'])).geom)" should ST_MultiPolygon
}
function test_geocoding_functions_admin1_usa() {
#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((geocode_admin1_polygons(Array['Idaho'])).geom))" 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((geocode_admin1_polygons(Array['New York'])).geom))" 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((geocode_admin1_polygons(Array['Hawaii'])).geom))" 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((geocode_admin1_polygons(Array['Oregon'])).geom))" 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((geocode_admin1_polygons(Array['Missouri'])).geom))" 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((geocode_admin1_polygons(Array['Maryland'])).geom))" 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((geocode_admin1_polygons(Array['Kentucky'])).geom))" 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((geocode_admin1_polygons(Array['Washington'])).geom))" 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((geocode_admin1_polygons(Array['Massachusetts'])).geom))" 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((geocode_admin1_polygons(Array['Virginia'])).geom))" 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((geocode_admin1_polygons(Array['Georgia'])).geom))" 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((geocode_admin1_polygons(Array['Wisconsin'])).geom))" 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((geocode_admin1_polygons(Array['District of Columbia'])).geom))" 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((geocode_admin1_polygons(Array['Maine'])).geom))" 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((geocode_admin1_polygons(Array['Michigan'])).geom))" 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((geocode_admin1_polygons(Array['Mississippi'])).geom))" 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((geocode_admin1_polygons(Array['South Carolina'])).geom))" 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((geocode_admin1_polygons(Array['Illinois'])).geom))" 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((geocode_admin1_polygons(Array['North Carolina'])).geom))" 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((geocode_admin1_polygons(Array['Iowa'])).geom))" 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((geocode_admin1_polygons(Array['California'])).geom))" 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((geocode_admin1_polygons(Array['Minnesota'])).geom))" 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((geocode_admin1_polygons(Array['Montana'])).geom))" 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((geocode_admin1_polygons(Array['Colorado'])).geom))" 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((geocode_admin1_polygons(Array['North Dakota'])).geom))" 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((geocode_admin1_polygons(Array['Utah'])).geom))" 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((geocode_admin1_polygons(Array['Wyoming'])).geom))" 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((geocode_admin1_polygons(Array['Nevada'])).geom))" 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((geocode_admin1_polygons(Array['Arizona'])).geom))" 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((geocode_admin1_polygons(Array['Kansas'])).geom))" 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((geocode_admin1_polygons(Array['Connecticut'])).geom))" 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((geocode_admin1_polygons(Array['West Virginia'])).geom))" 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((geocode_admin1_polygons(Array['New Mexico'])).geom))" 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((geocode_admin1_polygons(Array['Arkansas'])).geom))" 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((geocode_admin1_polygons(Array['Nebraska'])).geom))" 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((geocode_admin1_polygons(Array['Oklahoma'])).geom))" 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((geocode_admin1_polygons(Array['South Dakota'])).geom))" 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((geocode_admin1_polygons(Array['Louisiana'])).geom))" 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((geocode_admin1_polygons(Array['Texas'])).geom))" 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((geocode_admin1_polygons(Array['Tennessee'])).geom))" 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((geocode_admin1_polygons(Array['Delaware'])).geom))" 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((geocode_admin1_polygons(Array['New Hampshire'])).geom))" 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((geocode_admin1_polygons(Array['Rhode Island'])).geom))" 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((geocode_admin1_polygons(Array['Vermont'])).geom))" 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((geocode_admin1_polygons(Array['Alabama'])).geom))" 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((geocode_admin1_polygons(Array['Florida'])).geom))" 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((geocode_admin1_polygons(Array['Indiana'])).geom))" 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((geocode_admin1_polygons(Array['Ohio'])).geom))" 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((geocode_admin1_polygons(Array['New Jersey'])).geom))" 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((geocode_admin1_polygons(Array['Pennsylvania'])).geom))" should true
}
function test_geocoding_functions_admin1_france() {
#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((geocode_admin1_polygons(Array['Martinique'])).geom))" 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((geocode_admin1_polygons(Array['Mayotte'])).geom))" 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((geocode_admin1_polygons(Array['Loire'])).geom))" 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((geocode_admin1_polygons(Array['Val-d''Oise'])).geom))" 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((geocode_admin1_polygons(Array['Val-de-Marne'])).geom))" 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((geocode_admin1_polygons(Array['Guyane française'])).geom))" 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((geocode_admin1_polygons(Array['La Réunion'])).geom))" 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((geocode_admin1_polygons(Array['Corse-du-Sud'])).geom))" 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((geocode_admin1_polygons(Array['Isère'])).geom))" 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((geocode_admin1_polygons(Array['Guadeloupe'])).geom))" 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((geocode_admin1_polygons(Array['Ardèche'])).geom))" 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((geocode_admin1_polygons(Array['Ain'])).geom))" 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((geocode_admin1_polygons(Array['Aisne'])).geom))" 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((geocode_admin1_polygons(Array['Allier'])).geom))" 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((geocode_admin1_polygons(Array['Alpes-de-Haute-Provence'])).geom))" 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((geocode_admin1_polygons(Array['Alpes-Maritimes'])).geom))" 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((geocode_admin1_polygons(Array['Ardennes'])).geom))" 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((geocode_admin1_polygons(Array['Ariège'])).geom))" 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((geocode_admin1_polygons(Array['Aube'])).geom))" 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((geocode_admin1_polygons(Array['Aude'])).geom))" 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((geocode_admin1_polygons(Array['Aveyron'])).geom))" 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((geocode_admin1_polygons(Array['Bas-Rhin'])).geom))" 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((geocode_admin1_polygons(Array['Bouches-du-Rhône'])).geom))" 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((geocode_admin1_polygons(Array['Essonne'])).geom))" 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((geocode_admin1_polygons(Array['Calvados'])).geom))" 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((geocode_admin1_polygons(Array['Cantal'])).geom))" 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((geocode_admin1_polygons(Array['Charente'])).geom))" 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((geocode_admin1_polygons(Array['Charente-Maritime'])).geom))" 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((geocode_admin1_polygons(Array['Cher'])).geom))" 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((geocode_admin1_polygons(Array['Creuse'])).geom))" 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((geocode_admin1_polygons(Array['Corrèze'])).geom))" 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((geocode_admin1_polygons(Array['Doubs'])).geom))" 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((geocode_admin1_polygons(Array['Côte-d''Or'])).geom))" 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((geocode_admin1_polygons(Array['Côtes-d''Armor'])).geom))" 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((geocode_admin1_polygons(Array['Deux-Sèvres'])).geom))" 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((geocode_admin1_polygons(Array['Gers'])).geom))" 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((geocode_admin1_polygons(Array['Dordogne'])).geom))" 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((geocode_admin1_polygons(Array['Drôme'])).geom))" 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((geocode_admin1_polygons(Array['Eure'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Corse'])).geom))" 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((geocode_admin1_polygons(Array['Eure-et-Loir'])).geom))" 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((geocode_admin1_polygons(Array['Lot-et-Garonne'])).geom))" 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((geocode_admin1_polygons(Array['Finistère'])).geom))" 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((geocode_admin1_polygons(Array['Gard'])).geom))" 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((geocode_admin1_polygons(Array['Gironde'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Garonne'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Rhin'])).geom))" 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((geocode_admin1_polygons(Array['Lozère'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Loire'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Saône'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Marne'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Savoie'])).geom))" 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((geocode_admin1_polygons(Array['Haute-Vienne'])).geom))" 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((geocode_admin1_polygons(Array['Hérault'])).geom))" 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((geocode_admin1_polygons(Array['Hautes-Alpes'])).geom))" 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((geocode_admin1_polygons(Array['Hautes-Pyrénées'])).geom))" 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((geocode_admin1_polygons(Array['Ille-et-Vilaine'])).geom))" 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((geocode_admin1_polygons(Array['Indre'])).geom))" 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((geocode_admin1_polygons(Array['Indre-et-Loire'])).geom))" 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((geocode_admin1_polygons(Array['Jura'])).geom))" 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((geocode_admin1_polygons(Array['Landes'])).geom))" 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((geocode_admin1_polygons(Array['Loir-et-Cher'])).geom))" 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((geocode_admin1_polygons(Array['Loiret'])).geom))" 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((geocode_admin1_polygons(Array['Loire-Atlantique'])).geom))" 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((geocode_admin1_polygons(Array['Lot'])).geom))" 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((geocode_admin1_polygons(Array['Maine-et-Loire'])).geom))" 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((geocode_admin1_polygons(Array['Manche'])).geom))" 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((geocode_admin1_polygons(Array['Marne'])).geom))" 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((geocode_admin1_polygons(Array['Mayenne'])).geom))" 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((geocode_admin1_polygons(Array['Meurhe-et-Moselle'])).geom))" 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((geocode_admin1_polygons(Array['Meuse'])).geom))" 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((geocode_admin1_polygons(Array['Puy-de-Dôme'])).geom))" 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((geocode_admin1_polygons(Array['Morbihan'])).geom))" 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((geocode_admin1_polygons(Array['Moselle'])).geom))" 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((geocode_admin1_polygons(Array['Nièvre'])).geom))" 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((geocode_admin1_polygons(Array['Pyrénées-Orientales'])).geom))" 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((geocode_admin1_polygons(Array['Nord'])).geom))" 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((geocode_admin1_polygons(Array['Rhône'])).geom))" 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((geocode_admin1_polygons(Array['Oise'])).geom))" 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((geocode_admin1_polygons(Array['Tarn-et-Garonne'])).geom))" 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((geocode_admin1_polygons(Array['Orne'])).geom))" 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((geocode_admin1_polygons(Array['Pas-de-Calais'])).geom))" 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((geocode_admin1_polygons(Array['Pyrénées-Atlantiques'])).geom))" 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((geocode_admin1_polygons(Array['Saône-et-Loire'])).geom))" 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((geocode_admin1_polygons(Array['Sarthe'])).geom))" 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((geocode_admin1_polygons(Array['Savoie'])).geom))" 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((geocode_admin1_polygons(Array['Seien-et-Marne'])).geom))" 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((geocode_admin1_polygons(Array['Seine-Maritime'])).geom))" 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((geocode_admin1_polygons(Array['Seine-Saint-Denis'])).geom))" 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((geocode_admin1_polygons(Array['Somme'])).geom))" 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((geocode_admin1_polygons(Array['Tarn'])).geom))" 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((geocode_admin1_polygons(Array['Var'])).geom))" 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((geocode_admin1_polygons(Array['Vaucluse'])).geom))" 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((geocode_admin1_polygons(Array['Vendée'])).geom))" 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((geocode_admin1_polygons(Array['Vienne'])).geom))" 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((geocode_admin1_polygons(Array['Vosges'])).geom))" 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((geocode_admin1_polygons(Array['Yonne'])).geom))" 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((geocode_admin1_polygons(Array['Yvelines'])).geom))" 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((geocode_admin1_polygons(Array['Paris'])).geom))" 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((geocode_admin1_polygons(Array['Territoire de Belfort'])).geom))" 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((geocode_admin1_polygons(Array['Hauts-de-Seine'])).geom))" should true
}
function test_geocoding_functions_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((geocode_admin1_polygons(Array['Schleswig-Holstein'])).geom))" 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((geocode_admin1_polygons(Array['Bayern'])).geom))" 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((geocode_admin1_polygons(Array['Nordrhein-Westfalen'])).geom))" 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((geocode_admin1_polygons(Array['Brandenburg'])).geom))" 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((geocode_admin1_polygons(Array['Mecklenburg-Vorpommern'])).geom))" 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((geocode_admin1_polygons(Array['Niedersachsen'])).geom))" 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((geocode_admin1_polygons(Array['Thüringen'])).geom))" 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((geocode_admin1_polygons(Array['Rheinland-Pfalz'])).geom))" 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((geocode_admin1_polygons(Array['Baden-Württemberg'])).geom))" 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((geocode_admin1_polygons(Array['Bremen'])).geom))" 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((geocode_admin1_polygons(Array['Sachsen'])).geom))" 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((geocode_admin1_polygons(Array['Hamburg'])).geom))" 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((geocode_admin1_polygons(Array['Saarland'])).geom))" 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((geocode_admin1_polygons(Array['Berlin'])).geom))" 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((geocode_admin1_polygons(Array['Sachsen-Anhalt'])).geom))" 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((geocode_admin1_polygons(Array['Hessen'])).geom))" should true
}
function test_geocoding_functions_admin1_spain() {
#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((geocode_admin1_polygons(Array['Bizkaia'])).geom))" 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((geocode_admin1_polygons(Array['Orense'])).geom))" 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((geocode_admin1_polygons(Array['Asturias'])).geom))" 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((geocode_admin1_polygons(Array['Murcia'])).geom))" 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((geocode_admin1_polygons(Array['Baleares'])).geom))" 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((geocode_admin1_polygons(Array['La Rioja'])).geom))" 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((geocode_admin1_polygons(Array['Gerona'])).geom))" 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((geocode_admin1_polygons(Array['La Coruña'])).geom))" 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((geocode_admin1_polygons(Array['Las Palmas'])).geom))" 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((geocode_admin1_polygons(Array['Lérida'])).geom))" 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((geocode_admin1_polygons(Array['Álava'])).geom))" 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((geocode_admin1_polygons(Array['Alicante'])).geom))" 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((geocode_admin1_polygons(Array['Castellón'])).geom))" 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((geocode_admin1_polygons(Array['Valencia'])).geom))" 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((geocode_admin1_polygons(Array['Málaga'])).geom))" 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((geocode_admin1_polygons(Array['Burgos'])).geom))" 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((geocode_admin1_polygons(Array['Albacete'])).geom))" 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((geocode_admin1_polygons(Array['Almería'])).geom))" 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((geocode_admin1_polygons(Array['Ávila'])).geom))" 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((geocode_admin1_polygons(Array['Ceuta'])).geom))" 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((geocode_admin1_polygons(Array['Barcelona'])).geom))" 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((geocode_admin1_polygons(Array['Cádiz'])).geom))" 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((geocode_admin1_polygons(Array['Cáceres'])).geom))" 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((geocode_admin1_polygons(Array['Cantabria'])).geom))" 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((geocode_admin1_polygons(Array['Gipuzkoa'])).geom))" 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((geocode_admin1_polygons(Array['Ciudad Real'])).geom))" 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((geocode_admin1_polygons(Array['Córdoba'])).geom))" 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((geocode_admin1_polygons(Array['Cuenca'])).geom))" 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((geocode_admin1_polygons(Array['Santa Cruz de Tenerife'])).geom))" 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((geocode_admin1_polygons(Array['Granada'])).geom))" 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((geocode_admin1_polygons(Array['Guadalajara'])).geom))" 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((geocode_admin1_polygons(Array['Huelva'])).geom))" 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((geocode_admin1_polygons(Array['Jaén'])).geom))" 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((geocode_admin1_polygons(Array['Huesca'])).geom))" 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((geocode_admin1_polygons(Array['León'])).geom))" 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((geocode_admin1_polygons(Array['Lugo'])).geom))" 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((geocode_admin1_polygons(Array['Segovia'])).geom))" 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((geocode_admin1_polygons(Array['Madrid'])).geom))" 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((geocode_admin1_polygons(Array['Navarra'])).geom))" 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((geocode_admin1_polygons(Array['Palencia'])).geom))" 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((geocode_admin1_polygons(Array['Pontevedra'])).geom))" 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((geocode_admin1_polygons(Array['Tarragona'])).geom))" 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((geocode_admin1_polygons(Array['Salamanca'])).geom))" 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((geocode_admin1_polygons(Array['Sevilla'])).geom))" 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((geocode_admin1_polygons(Array['Valladolid'])).geom))" 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((geocode_admin1_polygons(Array['Soria'])).geom))" 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((geocode_admin1_polygons(Array['Teruel'])).geom))" 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((geocode_admin1_polygons(Array['Toledo'])).geom))" 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((geocode_admin1_polygons(Array['Zamora'])).geom))" 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((geocode_admin1_polygons(Array['Melilla'])).geom))" 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((geocode_admin1_polygons(Array['Zaragoza'])).geom))" 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((geocode_admin1_polygons(Array['Badajoz'])).geom))" should true
}
#################################################### TESTS END HERE ####################################################

192
geocoder/admin1/test/run.sh Normal file
View File

@@ -0,0 +1,192 @@
#!/bin/sh
source data/test.sh
source functions/test.sh
#
# The following script has two use modes:
#
# API
# ====================================
# SQL_API_ROUTE and API_KEY need to be
# conveniently filled for the requests
# to work.
# Example: bash run.sh api sql_api_route api_key test_type
#
# SQL
# ====================================
# It is expected that you run this script
# as a PostgreSQL superuser, for example:
#
# bash run.sh db database role test_type
#
# test_type defines the kind of tests to run: data or functions
MODE=''
TEST_TYPE=''
# DB settings
DATABASE=''
ROLE=''
CMD='echo psql'
CMD=psql
# SQL API settings
SQL_API_ROUTE=''
API_KEY=''
OK=0
PARTIALOK=0
function set_failed() {
OK=1
PARTIALOK=1
}
function clear_partial_result() {
PARTIALOK=0
}
function sql() {
local QUERY="$1"
if [[ $MODE = "api" ]]
then
# SQL API mode
echo $QUERY
RESULT=$(curl -s -X POST "https://$SQL_API_ROUTE/sql?api_key=$API_KEY&format=csv" --data-urlencode "q=$QUERY" |tail -n1 | tr -d '\r')
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
# Database mode
elif [[ $MODE = "db" ]]
then
if [ -n "${ROLE}" ]; then
log_debug "Executing query '${QUERY}' as ${ROLE}"
RESULT=`${CMD} -U "${ROLE}" ${DATABASE} -c "${QUERY}" -A -t`
else
log_debug "Executing query '${QUERY}'"
RESULT=`${CMD} ${DATABASE} -c "${QUERY}" -A -t`
fi
CODERESULT=$?
echo ${RESULT}
echo
if [[ ${CODERESULT} -ne 0 ]]
then
echo -n "FAILED TO EXECUTE QUERY: "
log_warning "${QUERY}"
if [[ "$2" != "fails" ]]
then
log_error "${QUERY}"
set_failed
fi
else
if [[ "$2" == "fails" ]]
then
log_error "QUERY: '${QUERY}' was expected to fail and it did not fail"
set_failed
fi
fi
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
fi
}
function log_info()
{
echo
echo
echo
_log "1;34m" "$1"
}
function log_error() {
_log "1;31m" "$1"
}
function log_debug() {
_log "1;32m" "> $1"
}
function log_warning() {
_log "0;33m" "$1"
}
function _log() {
echo -e "\033[$1$2\033[0m"
}
# '############################ HELPERS #############################'
function run_tests() {
local FAILED_TESTS=()
local TESTS
MODE="$1"
if [[ $MODE = "api" ]]
then
SQL_API_ROUTE="$2"
API_KEY="$3"
TEST_TYPE="$4"
fi
if [[ $MODE = "db" ]]
then
DATABASE="$2"
ROLE="$3"
TEST_TYPE="$4"
fi
if [[ $# -ge 4 ]]
then
if [[ $TEST_TYPE = "data" ]]
then
TESTS=`cat data/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
elif [[ $TEST_TYPE = "functions" ]]
then
TESTS=`cat functions/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
fi
else
TESTS="$@"
fi
for t in ${TESTS}
do
echo "####################################################################"
echo "#"
echo "# Running: ${t}"
echo "#"
echo "####################################################################"
clear_partial_result
eval ${t}
if [[ ${PARTIALOK} -ne 0 ]]
then
FAILED_TESTS+=(${t})
fi
done
if [[ ${OK} -ne 0 ]]
then
echo
log_error "The following tests are failing:"
printf -- '\t%s\n' "${FAILED_TESTS[@]}"
else
echo
log_info "Test finished"
fi
}
run_tests $@
exit ${OK}

View File

@@ -0,0 +1,13 @@
#!/bin/sh
#################################################### TESTS GO HERE ####################################################
function test_geocoding_data_ip_addr() {
# checks the type of the IP addresses column - inet in postgres
sql "SELECT count(*) FROM ip_address_locations where network_start_ip::inet is null" should 0
}
#################################################### TESTS END HERE ####################################################

View File

@@ -0,0 +1,21 @@
#!/bin/sh
#################################################### TESTS GO HERE ####################################################
function test_geocoding_functions_ip_addr() {
# checks that the result is false and no geometry is returned for an invalid formatted/out of range IPv4
sql "SELECT (geocode_ip(Array['1.0.16.280.1'])).success" should false
sql "SELECT (geocode_ip(Array['1.0.16.280.1'])).geom is null" should true
# checks that a valid IPv4 address returns a value and a success status
sql "SELECT (geocode_ip(Array['8.2.16.0'])).success" should true
sql "SELECT (geocode_ip(Array['8.2.16.0'])).geom is null" should false
# check that the returned geometry is a point
sql "SELECT ST_GeometryType((geocode_ip(Array['8.2.16.0'])).geom)" should ST_Point
}
#################################################### TESTS END HERE ####################################################

View File

@@ -0,0 +1,192 @@
#!/bin/sh
source data/test.sh
source functions/test.sh
#
# The following script has two use modes:
#
# API
# ====================================
# SQL_API_ROUTE and API_KEY need to be
# conveniently filled for the requests
# to work.
# Example: bash run.sh api sql_api_route api_key test_type
#
# SQL
# ====================================
# It is expected that you run this script
# as a PostgreSQL superuser, for example:
#
# bash run.sh db database role test_type
#
# test_type defines the kind of tests to run: data or functions
MODE=''
TEST_TYPE=''
# DB settings
DATABASE=''
ROLE=''
CMD='echo psql'
CMD=psql
# SQL API settings
SQL_API_ROUTE=''
API_KEY=''
OK=0
PARTIALOK=0
function set_failed() {
OK=1
PARTIALOK=1
}
function clear_partial_result() {
PARTIALOK=0
}
function sql() {
local QUERY="$1"
if [[ $MODE = "api" ]]
then
# SQL API mode
echo $QUERY
RESULT=$(curl -s -X POST "https://$SQL_API_ROUTE/sql?api_key=$API_KEY&format=csv" --data-urlencode "q=$QUERY" |tail -n1 | tr -d '\r')
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
# Database mode
elif [[ $MODE = "db" ]]
then
if [ -n "${ROLE}" ]; then
log_debug "Executing query '${QUERY}' as ${ROLE}"
RESULT=`${CMD} -U "${ROLE}" ${DATABASE} -c "${QUERY}" -A -t`
else
log_debug "Executing query '${QUERY}'"
RESULT=`${CMD} ${DATABASE} -c "${QUERY}" -A -t`
fi
CODERESULT=$?
echo ${RESULT}
echo
if [[ ${CODERESULT} -ne 0 ]]
then
echo -n "FAILED TO EXECUTE QUERY: "
log_warning "${QUERY}"
if [[ "$2" != "fails" ]]
then
log_error "${QUERY}"
set_failed
fi
else
if [[ "$2" == "fails" ]]
then
log_error "QUERY: '${QUERY}' was expected to fail and it did not fail"
set_failed
fi
fi
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
fi
}
function log_info()
{
echo
echo
echo
_log "1;34m" "$1"
}
function log_error() {
_log "1;31m" "$1"
}
function log_debug() {
_log "1;32m" "> $1"
}
function log_warning() {
_log "0;33m" "$1"
}
function _log() {
echo -e "\033[$1$2\033[0m"
}
# '############################ HELPERS #############################'
function run_tests() {
local FAILED_TESTS=()
local TESTS
MODE="$1"
if [[ $MODE = "api" ]]
then
SQL_API_ROUTE="$2"
API_KEY="$3"
TEST_TYPE="$4"
fi
if [[ $MODE = "db" ]]
then
DATABASE="$2"
ROLE="$3"
TEST_TYPE="$4"
fi
if [[ $# -ge 4 ]]
then
if [[ $TEST_TYPE = "data" ]]
then
TESTS=`cat data/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
elif [[ $TEST_TYPE = "functions" ]]
then
TESTS=`cat functions/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
fi
else
TESTS="$@"
fi
for t in ${TESTS}
do
echo "####################################################################"
echo "#"
echo "# Running: ${t}"
echo "#"
echo "####################################################################"
clear_partial_result
eval ${t}
if [[ ${PARTIALOK} -ne 0 ]]
then
FAILED_TESTS+=(${t})
fi
done
if [[ ${OK} -ne 0 ]]
then
echo
log_error "The following tests are failing:"
printf -- '\t%s\n' "${FAILED_TESTS[@]}"
else
echo
log_info "Test finished"
fi
}
run_tests $@
exit ${OK}

View File

@@ -0,0 +1,512 @@
#!/bin/sh
#################################################### TESTS GO HERE ####################################################
function test_geocoding_data_namedplace() {
# 500 cities with biggest population
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(121.45806 31.22222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shanghai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-58.37723 -34.61315)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Buenos Aires' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(72.88261 19.07283)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mumbai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.12766 19.42847)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mexico City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(116.39723 39.9075)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Beijing' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(67.0822 24.9056)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Karachi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(28.94966 41.01384)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'İstanbul' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(117.17667 39.14222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tianjin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.25 23.11667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guangzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.23149 28.65195)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Delhi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.9822 14.6042)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Manila' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(37.61556 55.75222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Moscow' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.0683 22.54554)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shenzhen' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(90.40744 23.7104)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dhaka' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.9784 37.566)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Seoul' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-46.63611 -23.5475)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'São Paulo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.26667 30.58333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Wuhan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(3.39467 6.45407)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lagos' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.84513 -6.21462)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jakarta' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(139.69171 35.6895)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tokyo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-74.00597 40.71427)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'New York' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.74472 23.04889)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dongguan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(121.53185 25.04776)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Taipei' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(15.31357 -4.32758)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kinshasa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-77.02824 -12.04318)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lima' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(31.24967 30.06263)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Cairo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-74.08175 4.60971)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bogotá' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-0.12574 51.50853)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'London' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-0.09184 51.51279)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'City of London' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.55278 29.56278)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chongqing' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(104.06667 30.66667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chengdu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(118.77778 32.06167)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nanjing' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(51.42151 35.69439)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tehrān' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.08473 30.79508)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nanchong' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.15769 22.28552)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hong Kong' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(108.92861 34.25833)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Xian' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(74.34361 31.54972)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lahore' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(123.43278 41.79222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shenyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.16142 30.29365)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hangzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-43.2075 -22.90278)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rio de Janeiro' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.65 45.75)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Harbin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.40088 33.34058)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Baghdad' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(117.12 36.18528)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Taian' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.59538 31.30408)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Suzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(116.71479 23.36814)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shantou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(100.50144 13.75398)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bangkok' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.59369 12.97194)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bangalore' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(30.31413 59.93863)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Saint Petersburg' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-70.64827 -33.45694)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Santiago' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(88.36304 22.56263)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kolkata' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(151.20732 -33.86785)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sydney' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(96.15611 16.80528)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yangon' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(116.99722 36.66833)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jinan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(80.27847 13.08784)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chennai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.64861 34.75778)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zhengzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(144.96332 -37.814)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Melbourne' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(46.72185 24.68773)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Riyadh' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(125.32278 43.88)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Changchun' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(121.60222 38.91222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dalian' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(91.83168 22.3384)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chittagong' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(102.71833 25.03889)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kunming' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(29.95527 31.21564)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Alexandria' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-118.24368 34.05223)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Los Angeles' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(72.58727 23.02579)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ahmedabad' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.36939 36.06605)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Qingdao' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(129.04028 35.10278)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Busan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-4.01266 5.30966)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Abidjan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(8.51672 12.00012)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kano' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.13148 23.02677)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Foshan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.45636 17.38405)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hyderabad' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(119.88872 29.45679)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Puyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(139.6425 35.44778)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yokohama' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(3.90591 7.37756)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ibadan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(103.85007 1.28967)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Singapore' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.28857 31.56887)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Wuxi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(118.08187 24.47979)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Xiamen' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.85427 39.91987)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ankara' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(105.74238 34.57952)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tianshui' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(121.54945 29.87819)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ningbo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.62965 10.82302)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ho Chi Minh City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(110.77806 32.6475)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shiyan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(18.42322 -33.92584)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Cape Town' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.56028 37.86944)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Taiyuan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(13.41053 52.52437)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Berlin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(118.18333 39.63333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tangshan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(117.28083 31.86389)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hefei' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-73.58781 45.50884)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Montréal' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-3.70256 40.4165)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Madrid' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(125.75432 39.03385)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pyongyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-7.61138 33.58831)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Casablanca' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(118.06333 36.79056)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zibo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(110.5723 21.31992)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zhongshan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(31.0292 -29.8579)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Durban' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.97087 28.19874)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Changsha' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(69.17233 34.52813)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kabul' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(87.60046 43.80096)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ürümqi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-66.87919 10.48801)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Caracas' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.85535 18.51957)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pune' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(72.83023 21.19594)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sūrat' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.19797 21.54238)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jeddah' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.47861 38.04139)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shijiazhuang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(80.34627 26.4478)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kānpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(30.5238 50.45466)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kiev' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(13.23432 -8.83682)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Luanda' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(121.0509 14.6488)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Quezon City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(38.74689 9.02497)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Addis Ababa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(36.81667 -1.28333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nairobi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-38.51083 -12.97111)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Salvador' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.78781 26.91962)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jaipur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.26951 -6.82349)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dar es Salaam' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-87.65005 41.85003)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chicago' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(103.83987 36.05701)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lanzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.70515 37.45646)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Incheon' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.03954 22.92833)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yunfu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(47.79747 30.53302)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Al Başrah' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.01582 19.03681)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Navi Mumbai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-79.4163 43.70011)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Toronto' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(135.50218 34.69374)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ōsaka-shi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(45.34375 2.03711)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mogadishu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(128.59111 35.87028)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Daegu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.08333 31.41667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Faisalābād' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(27.13838 38.41273)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'İzmir' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-17.44406 14.6937)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dakar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(80.92313 26.83928)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lucknow' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(31.21093 30.00808)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Al Jīzah' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-38.54306 -3.71722)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Fortaleza' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-76.5225 3.43722)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Cali' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.75083 -7.24917)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Surabaya' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-43.93778 -19.92083)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Belo Horizonte' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(115.85306 28.68396)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nanchang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-17.45472 14.71331)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Grand Dakar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(12.51133 41.89193)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rome' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(59.56796 36.31559)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mashhad' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-73.94958 40.6501)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Brooklyn' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-73.83652 40.68149)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Borough of Queens' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(79.08491 21.14631)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nagpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-71.64056 10.63167)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Maracaibo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-47.92972 -15.77972)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Brasília' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-69.98857 18.50012)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Santo Domingo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(136.90641 35.18147)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nagoya-shi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(153.02809 -27.46794)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Brisbane' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-82.38304 23.13302)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Havana' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(2.3488 48.85341)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Paris' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-95.36327 29.76328)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Houston' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(43.1049 36.33306)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Al Mawşil al Jadīdah' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(28.04363 -26.20227)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Johannesburg' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.18333 22.31667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kowloon' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(47.81507 30.50316)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Al Başrah al Qadīmah' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(76.92848 43.25654)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Almaty' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-75.56359 6.25184)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Medellín' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(69.21627 41.26465)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tashkent' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(3.04197 36.7525)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Algiers' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.53241 15.55177)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Khartoum' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-0.1969 5.55602)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Accra' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-79.90795 -2.20584)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guayaquil' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(109.78157 39.6086)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ordos' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.20667 15.35472)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sanaa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(35.49442 33.88894)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Beirut' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(115.8614 -31.95224)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Perth' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(141.34695 43.06417)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sapporo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.56028 43.85083)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jilin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(26.10626 44.43225)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bucharest' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-13.68778 9.535)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Camayenne' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-123.11934 49.24966)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Vancouver' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.8333 22.71792)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Indore' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.0671 19.35738)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Iztapalapa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.06601 19.61725)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ecatepec' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-13.67729 9.53795)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Conakry' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-67.59583 10.24694)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Maracay' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(98.66667 3.58333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Medan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.0679 33.6007)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rawalpindi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(27.56667 53.9)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Minsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(19.03991 47.49801)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Budapest' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(43.11889 36.335)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mosul' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(10.01534 53.57532)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hamburg' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-49.27306 -25.42778)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Curitiba' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(21.01178 52.22977)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Warsaw' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(107.61861 -6.90389)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bandung' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(27.85849 -26.26781)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Soweto' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(16.37208 48.20849)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Vienna' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-6.83255 34.01325)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rabat' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-103.39182 20.66682)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guadalajara' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(2.15899 41.38879)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Barcelona' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(28.18783 -25.74486)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pretoria' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(37.16117 36.20124)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Aleppo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(85.11936 25.60222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Patna' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.40289 23.25469)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bhopal' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-60.025 -3.10194)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Manaus' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.06556 32.12278)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Xinyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-98.20193 19.04334)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Puebla' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(7.43879 10.52641)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kaduna' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(104.91601 11.56245)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Phnom Penh' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(36.29128 33.5102)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Damascus' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(51.67462 32.65246)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Isfahan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.85379 30.91204)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ludhiāna' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(31.05337 -17.82772)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Harare' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(135.183 34.6913)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kobe' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-75.16379 39.95233)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Philadelphia' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.9896 -6.2349)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bekasi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.31333 22.61626)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kaohsiung' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-106.48333 31.73333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ciudad Juárez' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-73.96625 40.78343)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Manhattan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-57.63591 -25.30066)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Asunción' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-34.88111 -8.05389)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Recife' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(127.41972 36.32139)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Daejeon' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-1.62443 6.68848)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kumasi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(102.2386 6.13328)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kota Bharu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(135.75385 35.02107)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kyoto' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(101.68653 3.1412)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kuala Lumpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(50.99155 35.83266)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Karaj' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-112.07404 33.44838)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Phoenix' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(85.3206 27.70169)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kathmandu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(104.7458 -2.91673)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Palembang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(71.47528 30.19556)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Multān' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(105.84117 21.0245)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hanoi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(36.25272 49.98081)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kharkiv' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.01667 27.18333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Āgra' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-64.18105 -31.4135)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Córdoba' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(46.2919 38.08)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tabrīz' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(82.9346 55.0415)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Novosibirsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.91556 35.15472)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gwangju' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(29.08403 40.19266)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bursa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.20812 22.29941)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Vadodara' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-48.50444 -1.45583)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Belém' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(123.92333 41.85583)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Fushun' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-78.52495 -0.22985)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Quito' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(130.41806 33.60639)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Fukuoka-shi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(47.53613 -18.91368)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Antananarivo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.45361 34.68361)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Luoyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(68.37366 25.39242)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hyderabad' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-73.86641 40.84985)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'The Bronx' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-68.00765 10.16202)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Valencia' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(74.18831 32.16167)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gujrānwāla' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-74.78132 10.96854)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Barranquilla' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.62709 28.15861)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guankou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-117.00371 32.5027)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tijuana' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(27.47938 -11.66089)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lubumbashi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-51.23 -30.03306)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Porto Alegre' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.63 -6.17806)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tangerang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-63.18117 -17.78629)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Santa Cruz de la Sierra' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.46778 36.60056)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Handan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.58219 0.31628)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kampala' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(60.6122 56.8519)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yekaterinburg' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(89.56439 22.80979)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Khulna' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(9.70428 4.04827)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Douala' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-98.49363 29.42412)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'San Antonio' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.67206 29.44768)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gorakhpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.82563 21.42664)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mecca' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(119.4221 -5.14)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Makassar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-117.15726 32.71533)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'San Diego' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(139.71722 35.52056)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kawasaki' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.71789 -6.28862)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'South Tangerang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(109.82222 40.65222)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Baotou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.61417 24.46861)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Medina' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(11.51667 3.86667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yaoundé' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-8 12.65)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bamako' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.79096 19.99727)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nashik' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(110.4203 -6.9932)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Semarang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(15.28318 -4.26613)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Brazzaville' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.80696 18.62292)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pimpri' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.00205 56.32867)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nizhniy Novgorod' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(35.94503 31.95522)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Amman' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(124.43972 7.20417)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Budta' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(20.46513 44.80401)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Belgrade' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-56.18816 -34.90328)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Montevideo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(28.28713 -15.40669)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lusaka' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.13554 19.2437)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kalyān' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(72.96355 19.19704)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Thāne' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(11.57549 48.13743)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Munich' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(18.0649 59.33258)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Stockholm' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(35.48333 33.9)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ras Bayrūt' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(52.53113 29.61031)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shiraz' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(35.32889 37.00167)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Adana' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(127.00889 37.29111)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Suwon-si' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(9.18951 45.46427)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Milano' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-72.335 18.53917)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Port-au-Prince' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.01483 19.40061)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ciudad Nezahualcoyotl' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(138.59863 -34.92866)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Adelaide' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.70636 28.98002)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Meerut' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(82.54826 19.23114)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nowrangapur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.31316 28.41124)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Farīdābād' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(71.57849 34.008)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Peshawar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(125.61278 7.07306)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Davao' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(96.08359 21.97473)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mandalay' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.47773 15.64453)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Omdurman' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-70.69703 19.4517)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Santiago de los Caballeros' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.09481 29.37455)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yueyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(122.99 41.12361)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Anshan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(117.15707 34.18045)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tongshan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.43915 28.66535)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ghāziābād' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.81861 -6.4)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Depok' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-96.80667 32.78306)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dallas' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(139.65657 35.90807)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Saitama' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.10978 19.49016)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gustavo A. Madero' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.08333 19.21667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dombivli' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.58322 -25.96553)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Maputo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-98.75886 22.8694)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gustavo A. Madero' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(119.30611 26.06139)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Fuzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(70.79322 22.29161)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rājkot' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-60.63932 -32.94682)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rosario' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.71667 26.58333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guiyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-49.25389 -16.67861)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Goiânia' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-46.53333 -23.46278)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guarulhos' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(14.42076 50.08804)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Prague' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(83.01041 25.31668)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Varanasi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(12.56553 55.67594)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Copenhagen' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(23.32415 42.69751)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sofia' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(13.18746 32.87519)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tripoli' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(7.0134 4.77742)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Port Harcourt' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(132.45937 34.39627)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hiroshima-shi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(100.22072 26.86879)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lijiang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(55.17128 25.0657)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dubai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(50.15 53.100007)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Samara' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.36859 54.99244)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Omsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(5.62575 6.33815)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Benin City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-100.31847 25.67507)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Monterrey' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(124.475 7.16083)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Malingao' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(49.89201 40.37767)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Baku' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-101.671 21.13052)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'León' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(13.15712 11.84692)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Maiduguri' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(49.12214 55.78874)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kazan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.51361 40.18111)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yerevan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(74.87476 31.63661)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Amritsar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-1.53388 12.36566)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ouagadougou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(139.63333 35.88333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Yono' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.72328 47.23135)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Rostov-na-Donu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(81.83329 25.44894)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Allahābād' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.835 37.65639)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Goyang-si' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(37.3825 37.05944)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gaziantep' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(83.20161 17.68009)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Visakhapatnam' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(140.8667 38.25759)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sendai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(140.87195 38.26889)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sendai-shi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(61.42915 55.15402)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chelyabinsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.29139 40.09361)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Datong' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.83368 41.69411)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tbilisi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.74221 31.64615)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Changshu City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.6839 24.1469)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Taichung' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(77.482 10.01531)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Teni' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(108.70261 34.33778)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Xianyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(55.96779 54.74306)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ufa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(34.98333 48.45)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dnipropetrovsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(127.13778 37.43861)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Seongnam-si' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-47.06083 -22.90556)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Campinas' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(79.95006 23.16697)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jabalpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(88.31857 22.57688)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hāora' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(116.99694 32.62639)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Huainan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(37.80224 48.023)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Donetsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-6.24889 53.33306)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dublin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-114.08529 51.05011)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Calgary' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(4.34878 50.85045)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Brussels' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.34226 19.87757)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Aurangabad' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.50183 48.71939)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Volgograd' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-43.45111 -22.75917)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nova Iguaçu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(116.36581 23.5418)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jieyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(30.73262 46.47747)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Odessa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(119.40259 35.99502)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zhu Cheng City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.85263 18.53017)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shivaji Nagar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(130.83333 33.83333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kitakyūshū' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.91044 17.67152)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Solāpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(115.49028 38.85111)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Baoding' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-90.51327 14.64072)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guatemala City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(123.765 41.28861)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Benxi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-103.38479 20.72356)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zapopan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-1.89983 52.48142)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Birmingham' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(56.25017 58.01046)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Perm' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(74.80298 34.08842)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Srinagar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(7.7227 11.11128)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zaria' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-86.2504 12.13282)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Managua' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(25.57007 -33.91799)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Port Elizabeth' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-4.9998 34.03715)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Fès' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(6.95 50.93333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Köln' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(129.31667 35.53722)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ulsan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(76.7884 30.73629)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chandigarh' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(76.96612 11.00555)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Coimbatore' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(14.24641 40.85631)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Napoli' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-35.73528 -9.66583)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Maceió' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-75.51444 10.39972)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Cartagena' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(119.95401 31.77359)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Changzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.58572 24.49258)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sulţānah' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-121.89496 37.33939)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'San Jose' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-10.7969 6.30054)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Monrovia' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-76.79358 17.99702)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kingston' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.01062 36.19257)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Erbil' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(92.86717 56.01839)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Krasnoyarsk' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(96.12972 19.745)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nay Pyi Taw' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.00594 26.26841)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jodhpur' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(140.12333 35.60472)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chiba' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-44.30278 -2.52972)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'São Luís' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.11962 9.91735)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Madurai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-6.79846 34.0531)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sale' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(116.79167 33.97444)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Huaibei' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-66.1568 -17.3895)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Cochabamba' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-4.0159 5.41613)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Abobo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(74.59 42.87)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bishkek' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(44.18477 33.30563)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Abū Ghurayb' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.30742 34.7986)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kaifeng' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(50.8764 34.6401)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Qom' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(91.7458 26.1844)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Guwahati' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(7.36667 5.10658)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Aba' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.30119 33.73847)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pingdingshan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.17337 26.22983)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Gwalior' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(123.96045 47.34088)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Qiqihar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(101.45 3.03333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Klang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-68.82717 -32.89084)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mendoza' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.48464 37.87135)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Konya' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(23.58979 -6.13603)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mbuji-Mayi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(80.63049 16.51928)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Vijayawāda' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-17.39071 14.76457)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pikine' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(7.68682 45.07049)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Turin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(76.63925 12.29791)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mysore' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.66682 27.99942)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Wenzhou' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(46.00861 51.54056)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Saratov' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-87.20681 14.0818)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tegucigalpa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(126.78306 37.49889)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bucheon-si' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.1843 51.67204)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Voronezh' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(85.33856 23.34777)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ranchi' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.23963 19.47851)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Naucalpan de Juárez' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.88324 47.90771)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ulaanbaatar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(104.78498 10.99081)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Takeo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(48.6842 31.31901)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ahvaz' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-71.535 -16.39889)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Arequipa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(100.35427 -0.94924)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Padang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.13378 15.34776)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hubli' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-7.99994 31.63416)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Marrakesh' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(101.53333 3.15)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kampung Baru Subang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-86.15804 39.76838)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Indianapolis' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-81.65565 30.33218)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jacksonville' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-43.31167 -22.78556)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Duque de Caxias' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(8.89212 9.92849)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jos' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-0.37739 39.46975)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Valencia' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(4.54214 8.49664)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ilorin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-77.11814 -12.05659)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Callao' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-68.15 -16.5)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'La Paz' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-75.69812 45.41117)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ottawa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-69.32278 10.07389)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Barquisimeto' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-106.08889 28.63528)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Chihuahua' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-122.41942 37.77493)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'San Francisco' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(108.31667 22.81667)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nanning' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-13.22994 8.484)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Freetown' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(103.7578 1.4655)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Johor Bahru' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(35.21633 31.76904)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jerusalem' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(105.25803 -5.42544)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bandarlampung' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(106.78917 -6.59444)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bogor' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(15.97753 45.81313)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zagreb - Centar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(39.66359 -4.05466)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Mombasa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(123.89071 10.31672)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Cebu City' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(58.5922 23.61387)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Muscat' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(35.19031 47.82289)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zaporizhzhya' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(5.38107 43.29695)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Marseille' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(36.08796 32.07275)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Zarqa' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(32.86268 39.9179)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Çankaya' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-97.74306 30.26715)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Austin' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-82.99879 39.96118)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Columbus' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(3.47717 36.76639)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Boumerdas' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.57917 31.32556)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Jalandhar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(76.94924 8.4855)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Thiruvananthapuram' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(135.46667 34.58333)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Sakai' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(114.10659 36.1386)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dengtalu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-65.2226 -26.82414)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'San Miguel de Tucumán' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.15867 11.65117)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Salem' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.69651 10.8155)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tiruchirappalli' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(36.72339 34.72682)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Homs' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(111.65222 40.81056)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hohhot' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(2.1098 13.51366)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Niamey' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.21333 22.99083)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Tainan' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(120.87111 30.01556)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Shangyu' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(19.46667 51.75)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Łódź' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(50.10326 26.43442)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Dammam' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(101.75739 36.62554)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Xining' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(47.0553 34.3838)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kahrīz' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(75.83907 25.18254)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kota' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-35.20944 -5.795)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Natal' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(85.83385 20.27241)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bhubaneshwar' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(119.58833 39.93167)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Qinhuangdao' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.61888 26.88946)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hengyang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(30.69556 36.90812)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Antalya' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(19.93658 50.06143)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kraków' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(78.07475 27.88334)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Alīgarh' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(108.22083 16.06778)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Da Nang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(30.39278 -29.61679)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Pietermaritzburg' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(1.21227 6.13748)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Lomé' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-79.02998 -8.11599)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Trujillo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(112.6304 -7.9797)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Malang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-62.64102 8.35122)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ciudad Guayana' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(79.42193 28.34702)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Bareilly' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(30.05885 -1.94995)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Kigali' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-42.80194 -5.08917)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Teresina' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(113.80151 35.19033)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Nangandao' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-46.565 -23.69389)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'São Bernardo do Campo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(130.30012 47.35118)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Hegang' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(24.10589 56.946)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Riga' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(4.88969 52.37403)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Amsterdam' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-97.32085 32.72541)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Fort Worth' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(3.93125 7.85257)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Oyo' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(67.00971 30.199)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Quetta' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-80.84313 35.22709)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Charlotte' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-54.64639 -20.44278)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Campo Grande' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(58.38333 37.95)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Ashgabat' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(-99.20329 19.35867)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Álvaro Obregón' order by population desc limit 1" should true
sql "SELECT ST_Intersects(ST_GeomFromText('POINT(73.47082 34.37002)' , 4326), ST_Buffer(the_geom::geography, 1000)) FROM global_cities_points_limited where name = 'Muzaffarābād' order by population desc limit 1" should true
}
#################################################### TESTS END HERE ####################################################

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,192 @@
#!/bin/sh
source data/test.sh
source functions/test.sh
#
# The following script has two use modes:
#
# API
# ====================================
# SQL_API_ROUTE and API_KEY need to be
# conveniently filled for the requests
# to work.
# Example: bash run.sh api sql_api_route api_key test_type
#
# SQL
# ====================================
# It is expected that you run this script
# as a PostgreSQL superuser, for example:
#
# bash run.sh db database role test_type
#
# test_type defines the kind of tests to run: data or functions
MODE=''
TEST_TYPE=''
# DB settings
DATABASE=''
ROLE=''
CMD='echo psql'
CMD=psql
# SQL API settings
SQL_API_ROUTE=''
API_KEY=''
OK=0
PARTIALOK=0
function set_failed() {
OK=1
PARTIALOK=1
}
function clear_partial_result() {
PARTIALOK=0
}
function sql() {
local QUERY="$1"
if [[ $MODE = "api" ]]
then
# SQL API mode
echo $QUERY
RESULT=$(curl -s -X POST "https://$SQL_API_ROUTE/sql?api_key=$API_KEY&format=csv" --data-urlencode "q=$QUERY" |tail -n1 | tr -d '\r')
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
# Database mode
elif [[ $MODE = "db" ]]
then
if [ -n "${ROLE}" ]; then
log_debug "Executing query '${QUERY}' as ${ROLE}"
RESULT=`${CMD} -U "${ROLE}" ${DATABASE} -c "${QUERY}" -A -t`
else
log_debug "Executing query '${QUERY}'"
RESULT=`${CMD} ${DATABASE} -c "${QUERY}" -A -t`
fi
CODERESULT=$?
echo ${RESULT}
echo
if [[ ${CODERESULT} -ne 0 ]]
then
echo -n "FAILED TO EXECUTE QUERY: "
log_warning "${QUERY}"
if [[ "$2" != "fails" ]]
then
log_error "${QUERY}"
set_failed
fi
else
if [[ "$2" == "fails" ]]
then
log_error "QUERY: '${QUERY}' was expected to fail and it did not fail"
set_failed
fi
fi
if [[ "$2" == "should" ]]
then
if [[ "${RESULT}" != "$3" ]]
then
log_error "QUERY '${QUERY}' expected result '${3}' but got '${RESULT}'"
set_failed
fi
fi
fi
}
function log_info()
{
echo
echo
echo
_log "1;34m" "$1"
}
function log_error() {
_log "1;31m" "$1"
}
function log_debug() {
_log "1;32m" "> $1"
}
function log_warning() {
_log "0;33m" "$1"
}
function _log() {
echo -e "\033[$1$2\033[0m"
}
# '############################ HELPERS #############################'
function run_tests() {
local FAILED_TESTS=()
local TESTS
MODE="$1"
if [[ $MODE = "api" ]]
then
SQL_API_ROUTE="$2"
API_KEY="$3"
TEST_TYPE="$4"
fi
if [[ $MODE = "db" ]]
then
DATABASE="$2"
ROLE="$3"
TEST_TYPE="$4"
fi
if [[ $# -ge 4 ]]
then
if [[ $TEST_TYPE = "data" ]]
then
TESTS=`cat data/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
elif [[ $TEST_TYPE = "functions" ]]
then
TESTS=`cat functions/test.sh| perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
fi
else
TESTS="$@"
fi
for t in ${TESTS}
do
echo "####################################################################"
echo "#"
echo "# Running: ${t}"
echo "#"
echo "####################################################################"
clear_partial_result
eval ${t}
if [[ ${PARTIALOK} -ne 0 ]]
then
FAILED_TESTS+=(${t})
fi
done
if [[ ${OK} -ne 0 ]]
then
echo
log_error "The following tests are failing:"
printf -- '\t%s\n' "${FAILED_TESTS[@]}"
else
echo
log_info "Test finished"
fi
}
run_tests $@
exit ${OK}