|
@@ -33,21 +33,21 @@ selectAllPointsAsStrings
|
|
|
SELECT city, CAST(location AS STRING) location, CAST(location_no_dv AS STRING) location_no_dv, CAST(geoshape AS STRING) geoshape, CAST(shape AS STRING) shape, region FROM "geo" ORDER BY "city";
|
|
|
|
|
|
city:s | location:s | location_no_dv:s | geoshape:s | shape:s | region:s
|
|
|
-Amsterdam |point (4.850311987102032 52.347556999884546) |point (4.850312 52.347557) |point (4.850312 52.347557 2.0) |point (4.850312 52.347557 2.0) |Europe
|
|
|
-Berlin |point (13.390888944268227 52.48670099303126) |point (13.390889 52.486701) |point (13.390889 52.486701 34.0) |point (13.390889 52.486701 34.0) |Europe
|
|
|
-Chicago |point (-87.63787407428026 41.888782968744636) |point (-87.637874 41.888783) |point (-87.637874 41.888783 181.0) |point (-87.637874 41.888783 181.0) |Americas
|
|
|
-Hong Kong |point (114.18392493389547 22.28139698971063) |point (114.183925 22.281397) |point (114.183925 22.281397 552.0) |point (114.183925 22.281397 552.0) |Asia
|
|
|
-London |point (-0.12167204171419144 51.51087098289281)|point (-0.121672 51.510871) |point (-0.121672 51.510871 11.0) |point (-0.121672 51.510871 11.0) |Europe
|
|
|
-Mountain View |point (-122.08384302444756 37.38648299127817) |point (-122.083843 37.386483) |point (-122.083843 37.386483 30.0) |point (-122.083843 37.386483 30.0) |Americas
|
|
|
-Munich |point (11.537504978477955 48.14632098656148) |point (11.537505 48.146321) |point (11.537505 48.146321 519.0) |point (11.537505 48.146321 519.0) |Europe
|
|
|
-New York |point (-73.9900270756334 40.74517097789794) |point (-73.990027 40.745171) |point (-73.990027 40.745171 10.0) |point (-73.990027 40.745171 10.0) |Americas
|
|
|
-Paris |point (2.3517729341983795 48.84553796611726) |point (2.351773 48.845538) |point (2.351773 48.845538 35.0) |point (2.351773 48.845538 35.0) |Europe
|
|
|
-Phoenix |point (-111.97350500151515 33.37624196894467) |point (-111.973505 33.376242) |point (-111.973505 33.376242 331.0)|point (-111.973505 33.376242 331.0)|Americas
|
|
|
-San Francisco |point (-122.39422800019383 37.789540970698) |point (-122.394228 37.789541) |point (-122.394228 37.789541 16.0) |point (-122.394228 37.789541 16.0) |Americas
|
|
|
-Seoul |point (127.06085099838674 37.50913198571652) |point (127.060851 37.509132) |point (127.060851 37.509132 38.0) |point (127.060851 37.509132 38.0) |Asia
|
|
|
-Singapore |point (103.8555349688977 1.2958679627627134) |point (103.855535 1.295868) |point (103.855535 1.295868 15.0) |point (103.855535 1.295868 15.0) |Asia
|
|
|
-Sydney |point (151.20862897485495 -33.863385021686554)|point (151.208629 -33.863385) |point (151.208629 -33.863385 100.0)|point (151.208629 -33.863385 100.0)|Asia
|
|
|
-Tokyo |point (139.76402222178876 35.66961596254259) |point (139.76402225 35.669616)|point (139.76402225 35.669616 40.0)|point (139.76402225 35.669616 40.0)|Asia
|
|
|
+Amsterdam |POINT (4.850311987102032 52.347556999884546) |POINT (4.850312 52.347557) |POINT (4.850312 52.347557 2.0) |POINT (4.850312 52.347557 2.0) |Europe
|
|
|
+Berlin |POINT (13.390888944268227 52.48670099303126) |POINT (13.390889 52.486701) |POINT (13.390889 52.486701 34.0) |POINT (13.390889 52.486701 34.0) |Europe
|
|
|
+Chicago |POINT (-87.63787407428026 41.888782968744636) |POINT (-87.637874 41.888783) |POINT (-87.637874 41.888783 181.0) |POINT (-87.637874 41.888783 181.0) |Americas
|
|
|
+Hong Kong |POINT (114.18392493389547 22.28139698971063) |POINT (114.183925 22.281397) |POINT (114.183925 22.281397 552.0) |POINT (114.183925 22.281397 552.0) |Asia
|
|
|
+London |POINT (-0.12167204171419144 51.51087098289281)|POINT (-0.121672 51.510871) |POINT (-0.121672 51.510871 11.0) |POINT (-0.121672 51.510871 11.0) |Europe
|
|
|
+Mountain View |POINT (-122.08384302444756 37.38648299127817) |POINT (-122.083843 37.386483) |POINT (-122.083843 37.386483 30.0) |POINT (-122.083843 37.386483 30.0) |Americas
|
|
|
+Munich |POINT (11.537504978477955 48.14632098656148) |POINT (11.537505 48.146321) |POINT (11.537505 48.146321 519.0) |POINT (11.537505 48.146321 519.0) |Europe
|
|
|
+New York |POINT (-73.9900270756334 40.74517097789794) |POINT (-73.990027 40.745171) |POINT (-73.990027 40.745171 10.0) |POINT (-73.990027 40.745171 10.0) |Americas
|
|
|
+Paris |POINT (2.3517729341983795 48.84553796611726) |POINT (2.351773 48.845538) |POINT (2.351773 48.845538 35.0) |POINT (2.351773 48.845538 35.0) |Europe
|
|
|
+Phoenix |POINT (-111.97350500151515 33.37624196894467) |POINT (-111.973505 33.376242) |POINT (-111.973505 33.376242 331.0)|POINT (-111.973505 33.376242 331.0)|Americas
|
|
|
+San Francisco |POINT (-122.39422800019383 37.789540970698) |POINT (-122.394228 37.789541) |POINT (-122.394228 37.789541 16.0) |POINT (-122.394228 37.789541 16.0) |Americas
|
|
|
+Seoul |POINT (127.06085099838674 37.50913198571652) |POINT (127.060851 37.509132) |POINT (127.060851 37.509132 38.0) |POINT (127.060851 37.509132 38.0) |Asia
|
|
|
+Singapore |POINT (103.8555349688977 1.2958679627627134) |POINT (103.855535 1.295868) |POINT (103.855535 1.295868 15.0) |POINT (103.855535 1.295868 15.0) |Asia
|
|
|
+Sydney |POINT (151.20862897485495 -33.863385021686554)|POINT (151.208629 -33.863385) |POINT (151.208629 -33.863385 100.0)|POINT (151.208629 -33.863385 100.0)|Asia
|
|
|
+Tokyo |POINT (139.76402222178876 35.66961596254259) |POINT (139.76402225 35.669616)|POINT (139.76402225 35.669616 40.0)|POINT (139.76402225 35.669616 40.0)|Asia
|
|
|
;
|
|
|
|
|
|
// TODO: Both shape and location contain the same data for now, we should change it later to make things more interesting
|
|
@@ -55,28 +55,28 @@ selectAllPointsAsWKT
|
|
|
SELECT city, ST_ASWKT(location) location_wkt, ST_ASWKT(geoshape) geoshape_wkt, region FROM "geo" ORDER BY "city";
|
|
|
|
|
|
city:s | location_wkt:s | geoshape_wkt:s | region:s
|
|
|
-Amsterdam |point (4.850311987102032 52.347556999884546) |point (4.850312 52.347557 2.0) |Europe
|
|
|
-Berlin |point (13.390888944268227 52.48670099303126) |point (13.390889 52.486701 34.0) |Europe
|
|
|
-Chicago |point (-87.63787407428026 41.888782968744636) |point (-87.637874 41.888783 181.0) |Americas
|
|
|
-Hong Kong |point (114.18392493389547 22.28139698971063) |point (114.183925 22.281397 552.0) |Asia
|
|
|
-London |point (-0.12167204171419144 51.51087098289281)|point (-0.121672 51.510871 11.0) |Europe
|
|
|
-Mountain View |point (-122.08384302444756 37.38648299127817) |point (-122.083843 37.386483 30.0) |Americas
|
|
|
-Munich |point (11.537504978477955 48.14632098656148) |point (11.537505 48.146321 519.0) |Europe
|
|
|
-New York |point (-73.9900270756334 40.74517097789794) |point (-73.990027 40.745171 10.0) |Americas
|
|
|
-Paris |point (2.3517729341983795 48.84553796611726) |point (2.351773 48.845538 35.0) |Europe
|
|
|
-Phoenix |point (-111.97350500151515 33.37624196894467) |point (-111.973505 33.376242 331.0) |Americas
|
|
|
-San Francisco |point (-122.39422800019383 37.789540970698) |point (-122.394228 37.789541 16.0) |Americas
|
|
|
-Seoul |point (127.06085099838674 37.50913198571652) |point (127.060851 37.509132 38.0) |Asia
|
|
|
-Singapore |point (103.8555349688977 1.2958679627627134) |point (103.855535 1.295868 15.0) |Asia
|
|
|
-Sydney |point (151.20862897485495 -33.863385021686554)|point (151.208629 -33.863385 100.0) |Asia
|
|
|
-Tokyo |point (139.76402222178876 35.66961596254259) |point (139.76402225 35.669616 40.0) |Asia
|
|
|
+Amsterdam |POINT (4.850311987102032 52.347556999884546) |POINT (4.850312 52.347557 2.0) |Europe
|
|
|
+Berlin |POINT (13.390888944268227 52.48670099303126) |POINT (13.390889 52.486701 34.0) |Europe
|
|
|
+Chicago |POINT (-87.63787407428026 41.888782968744636) |POINT (-87.637874 41.888783 181.0) |Americas
|
|
|
+Hong Kong |POINT (114.18392493389547 22.28139698971063) |POINT (114.183925 22.281397 552.0) |Asia
|
|
|
+London |POINT (-0.12167204171419144 51.51087098289281)|POINT (-0.121672 51.510871 11.0) |Europe
|
|
|
+Mountain View |POINT (-122.08384302444756 37.38648299127817) |POINT (-122.083843 37.386483 30.0) |Americas
|
|
|
+Munich |POINT (11.537504978477955 48.14632098656148) |POINT (11.537505 48.146321 519.0) |Europe
|
|
|
+New York |POINT (-73.9900270756334 40.74517097789794) |POINT (-73.990027 40.745171 10.0) |Americas
|
|
|
+Paris |POINT (2.3517729341983795 48.84553796611726) |POINT (2.351773 48.845538 35.0) |Europe
|
|
|
+Phoenix |POINT (-111.97350500151515 33.37624196894467) |POINT (-111.973505 33.376242 331.0) |Americas
|
|
|
+San Francisco |POINT (-122.39422800019383 37.789540970698) |POINT (-122.394228 37.789541 16.0) |Americas
|
|
|
+Seoul |POINT (127.06085099838674 37.50913198571652) |POINT (127.060851 37.509132 38.0) |Asia
|
|
|
+Singapore |POINT (103.8555349688977 1.2958679627627134) |POINT (103.855535 1.295868 15.0) |Asia
|
|
|
+Sydney |POINT (151.20862897485495 -33.863385021686554)|POINT (151.208629 -33.863385 100.0) |Asia
|
|
|
+Tokyo |POINT (139.76402222178876 35.66961596254259) |POINT (139.76402225 35.669616 40.0) |Asia
|
|
|
;
|
|
|
|
|
|
selectWithAsWKTInWhere
|
|
|
SELECT city, ST_ASWKT(location) location_wkt, region FROM "geo" WHERE LOCATE('114', ST_ASWKT(location)) > 0 ORDER BY "city";
|
|
|
|
|
|
city:s | location_wkt:s | region:s
|
|
|
-Hong Kong |point (114.18392493389547 22.28139698971063)|Asia
|
|
|
+Hong Kong |POINT (114.18392493389547 22.28139698971063)|Asia
|
|
|
;
|
|
|
|
|
|
selectAllPointsOrderByLonFromAsWKT
|
|
@@ -112,30 +112,30 @@ selectRegionUsingWktToSql
|
|
|
SELECT region, city, ST_ASWKT(ST_WKTTOSQL(region_point)) region_wkt FROM geo ORDER BY region, city;
|
|
|
|
|
|
region:s | city:s | region_wkt:s
|
|
|
-Americas |Chicago |point (-105.2551 54.526)
|
|
|
-Americas |Mountain View |point (-105.2551 54.526)
|
|
|
-Americas |New York |point (-105.2551 54.526)
|
|
|
-Americas |Phoenix |point (-105.2551 54.526)
|
|
|
-Americas |San Francisco |point (-105.2551 54.526)
|
|
|
-Asia |Hong Kong |point (100.6197 34.0479)
|
|
|
-Asia |Seoul |point (100.6197 34.0479)
|
|
|
-Asia |Singapore |point (100.6197 34.0479)
|
|
|
-Asia |Sydney |point (100.6197 34.0479)
|
|
|
-Asia |Tokyo |point (100.6197 34.0479)
|
|
|
-Europe |Amsterdam |point (15.2551 54.526)
|
|
|
-Europe |Berlin |point (15.2551 54.526)
|
|
|
-Europe |London |point (15.2551 54.526)
|
|
|
-Europe |Munich |point (15.2551 54.526)
|
|
|
-Europe |Paris |point (15.2551 54.526)
|
|
|
+Americas |Chicago |POINT (-105.2551 54.526)
|
|
|
+Americas |Mountain View |POINT (-105.2551 54.526)
|
|
|
+Americas |New York |POINT (-105.2551 54.526)
|
|
|
+Americas |Phoenix |POINT (-105.2551 54.526)
|
|
|
+Americas |San Francisco |POINT (-105.2551 54.526)
|
|
|
+Asia |Hong Kong |POINT (100.6197 34.0479)
|
|
|
+Asia |Seoul |POINT (100.6197 34.0479)
|
|
|
+Asia |Singapore |POINT (100.6197 34.0479)
|
|
|
+Asia |Sydney |POINT (100.6197 34.0479)
|
|
|
+Asia |Tokyo |POINT (100.6197 34.0479)
|
|
|
+Europe |Amsterdam |POINT (15.2551 54.526)
|
|
|
+Europe |Berlin |POINT (15.2551 54.526)
|
|
|
+Europe |London |POINT (15.2551 54.526)
|
|
|
+Europe |Munich |POINT (15.2551 54.526)
|
|
|
+Europe |Paris |POINT (15.2551 54.526)
|
|
|
;
|
|
|
|
|
|
selectCitiesWithAGroupByWktToSql
|
|
|
SELECT COUNT(city) city_by_region, CAST(ST_WKTTOSQL(region_point) AS STRING) region FROM geo WHERE city LIKE '%a%' GROUP BY ST_WKTTOSQL(region_point) ORDER BY ST_WKTTOSQL(region_point);
|
|
|
|
|
|
city_by_region:l | region:s
|
|
|
-3 |point (-105.2551 54.526)
|
|
|
-1 |point (100.6197 34.0479)
|
|
|
-2 |point (15.2551 54.526)
|
|
|
+3 |POINT (-105.2551 54.526)
|
|
|
+1 |POINT (100.6197 34.0479)
|
|
|
+2 |POINT (15.2551 54.526)
|
|
|
;
|
|
|
|
|
|
selectCitiesWithEOrderByWktToSql
|