Open sailei1 opened 1 year ago
CREATE TABLE points (id SERIAL PRIMARY KEY, geom GEOMETRY(Point, 4326));
INSERT INTO points (geom) VALUES (ST_SetSRID(ST_MakePoint(10, 20), 4326));
SELECT * FROM points WHERE ST_Intersects(geom, ST_SetSRID(ST_MakePoint(10, 20), 4326));
SELECT ST_X(geom) AS longitude, ST_Y(geom) AS latitude FROM points; //查询经纬度
select ST_X(location) AS longitude, ST_Y(location) AS latitude from points inner join testpolygon
on ST_Within(ST_SetSRID(points.location,4326),ST_SetSRID(testpolygon.geom,4326))
where testpolygon.id=16
修改时区
select now(); show time zone set time zone "Asia/Shanghai"