Created
November 4, 2021 15:40
-
-
Save aveek22/daf288a18480ab91be7a17cf33ad7cfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS SQLShackGeomTest; | |
CREATE TABLE SQLShackGeomTest ( | |
sensor_id VARCHAR(50) PRIMARY KEY NOT NULL, | |
longitude VARCHAR(50), | |
latitude VARCHAR(50), | |
country TEXT, | |
sensorTemp INTEGER, | |
sensorPressure INTEGER, | |
sensorTime TIMESTAMP, | |
sensorLocation GEOMETRY | |
); | |
CREATE INDEX SQLShackGeomTest_geom_idx | |
ON SQLShackGeomTest | |
USING GIST (geography(sensorLocation)); | |
INSERT INTO SQLShackGeomTest (sensor_id, longitude, latitude, country, sensorTemp, sensorPressure, sensorTime, sensorLocation) | |
VALUES ('F040520 BJI910J', -0.138702, 51.501220, 'UK', 0, 996, now(), ST_GeomFromText('POINT(-0.138702 51.501220)',4326)); | |
SELECT * FROM SQLShackGeomTest; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment