add some test + style

This commit is contained in:
Nikita Mikhailov 2021-02-20 18:30:56 +03:00 committed by Nikita Mikhaylov
parent 56700ed3e9
commit 4430322edc
6 changed files with 348 additions and 0 deletions

View File

@ -0,0 +1,105 @@
Dhekelia Sovereign Base Area 127533079.61976177
Kyrgyzstan 198994443077.2897
Aruba 169577139.16920504
Afghanistan 642167900289.4739
Albania 28333199169.93513
Andorra 452435114.7617939
Ashmore and Cartier Islands 2696604.9276267616
Austria 83991121342.6868
Burundi 27040491570.2986
Belgium 30672391961.48937
Benin 116112410615.07138
Burkina Faso 272767288599.06683
Bulgaria 112764344245.5939
Bahrain 585431263.0854981
Bosnia and Herzegovina 51828357836.835045
Bajo Nuevo Bank (Petrel Is.) 29452.023965717835
Saint Barthelemy 24595825.379134282
Belarus 207495810096.24286
Bolivia 1086795900906.9404
Barbados 444196434.0171095
Bhutan 40362932122.222435
Botswana 579022741104.1897
Central African Republic 617982165549.6404
Switzerland 41437057095.20376
Clipperton Island 5042420.197242386
Cameroon 464311319438.17255
Republic of Congo 344887275569.75
Coral Sea Islands 20628.814559882598
Curaçao 463207585.46491855
Czech Republic 78760344660.91792
Djibouti 21846149319.499916
Dominica 730475415.656727
Algeria 2308849474061.9604
Ethiopia 1127370045818.119
Georgia 69572475312.24843
Ghana 238667399375.48102
Gibraltar 3831411.4171073083
Guinea 244302369135.0428
Gambia 10500266198.294697
Guatemala 108814357557.89536
Guam 564430992.5413051
Heard Island and McDonald Islands 395072268.1670339
Hungary 93204530848.81223
Isle of Man 574622349.496232
Iraq 437362923804.6782
Israel 21904844963.57914
Jamaica 11032909044.896214
Jersey 119197004.74288748
Jordan 88852268122.99756
Baykonur Cosmodrome 6501480908.525035
Siachen Glacier 2088368280.5951576
Kosovo 10914986124.47776
Laos 228111317612.30957
Lebanon 9999649538.151918
Liberia 95296808053.31937
Libya 1623756106692.004
Saint Lucia 604940965.7686977
Liechtenstein 136883538.3183111
Lesotho 30106906647.33149
Luxembourg 2607643781.0226917
Latvia 64575248440.09302
Saint Martin 68198732.01942295
Morocco 591718146420.0958
Monaco 18750590.193543613
Moldova 33208636022.82373
Macedonia 25384586736.42653
Mali 1252723270900.2302
Montenegro 13729482523.613796
Mongolia 1564646094133.3677
Montserrat 99396603.21002583
Namibia 822688081865.0547
Niger 1181298791001.2363
Norfolk Island 41003910.8372144
Niue 220827518.96565723
Nepal 147103938320.9306
Nauru 28765050.65120624
Poland 313439831446.58765
Paraguay 399899482418.94604
Qatar 11150102955.086788
Romania 236371949926.43573
Rwanda 25305141874.683277
Western Sahara 90483117057.23624
Scarborough Reef 93421.29269397438
South Sudan 626858281405.9783
Senegal 196219387423.09302
Serranilla Bank 100843.54356614068
Singapore 510505392.29170656
San Marino 60357700.76923006
Somaliland 167406759212.9871
Somalia 471815737592.64276
Republic of Serbia 77573594972.73866
Suriname 145124645519.15808
Slovakia 48456085451.12405
Slovenia 20327209680.63761
Swaziland 17113505052.204178
Sint Maarten 23405778.740159098
Syria 185944843149.37875
Chad 1266282203998.255
Togo 56863540226.407555
Uganda 241852803539.38947
Uruguay 177347712583.76038
Vatican 10535.27369925663
Akrotiri Sovereign Base Area 98415737.60517946
Zambia 751913038381.5402
Zimbabwe 389330493219.1703

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} -q "drop table if exists country_polygons;"
${CLICKHOUSE_CLIENT} -q "create table country_polygons(name String, p Array(Array(Tuple(Float64, Float64)))) engine=MergeTree() order by tuple();"
cat ${CURDIR}/country_polygons.tsv | ${CLICKHOUSE_CLIENT} -q "insert into country_polygons format TSV"
${CLICKHOUSE_CLIENT} -q "SELECT name, polygonAreaGeographic(p) from country_polygons"
${CLICKHOUSE_CLIENT} -q "drop table if exists country_rings;"
${CLICKHOUSE_CLIENT} -q "create table country_rings(name String, p Array(Tuple(Float64, Float64))) engine=MergeTree() order by tuple();"
cat ${CURDIR}/country_rings.tsv | ${CLICKHOUSE_CLIENT} -q "insert into country_rings format TSV"
${CLICKHOUSE_CLIENT} -q "SELECT name, polygonAreaGeographic(p) from country_rings"
${CLICKHOUSE_CLIENT} -q "drop table if exists country_rings;"

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} -q "drop table if exists country_polygons;"
${CLICKHOUSE_CLIENT} -q "create table country_polygons(name String, p Array(Array(Tuple(Float64, Float64)))) engine=MergeTree() order by tuple();"
cat ${CURDIR}/country_polygons.tsv | ${CLICKHOUSE_CLIENT} -q "insert into country_polygons format TSV"
${CLICKHOUSE_CLIENT} -q "SELECT c, d, polygonsIntersectionGeographic(a, b) FROM (SELECT first.p AS a, second.p AS b, first.name AS c, second.name AS d FROM country_polygons AS first CROSS JOIN country_polygons AS second LIMIT 100) format TSV"
${CLICKHOUSE_CLIENT} -q "drop table if exists country_polygons;"
${CLICKHOUSE_CLIENT} -q "drop table if exists country_rings;"
${CLICKHOUSE_CLIENT} -q "create table country_rings(name String, p Array(Tuple(Float64, Float64))) engine=MergeTree() order by tuple();"
cat ${CURDIR}/country_rings.tsv | ${CLICKHOUSE_CLIENT} -q "insert into country_rings format TSV"
${CLICKHOUSE_CLIENT} -q "SELECT c, d, polygonsIntersectionGeographic(a, b) FROM (SELECT first.p AS a, second.p AS b, first.name AS c, second.name AS d FROM country_rings AS first CROSS JOIN country_rings AS second LIMIT 100) format TSV"
${CLICKHOUSE_CLIENT} -q "drop table if exists country_rings;"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long