-- Tim kiem cac cua hang TGDĐ cach 1000m
SELECT * FROM hcm_tgdd WHERE ST_DWithin(
ST_Transform(geom, 32648),
ST_Transform(ST_SetSRID(ST_Point(106.69093,10.77082), 4326), 32648),
1000
);
-- Tao diem tu toa do
SELECT ST_SetSRID(ST_Point(106.69093, 10.77082), 4326);
-- Tao buffer 1000m
SELECT ST_Buffer(ST_SetSRID(ST_Point(106.69093, 10.77082), 4326), 0.01) AS buffer;
-- Chuyen tu do sang m
SELECT ST_Buffer(ST_Transform(ST_SetSRID(ST_Point(106.69093, 10.77082), 4326), 32648), 1000) AS buffer;
-- Tim cua hang trong quan 1
SELECT * FROM points
WHERE ST_Contains(polygon_geom, points_geom);
SELECT * FROM hcm_tgdd
WHERE ST_Contains((SELECT geom FROM "hcm_quanhuyen" WHERE "name_2" = 'Quận 1'), geom);
Created
April 13, 2024 05:09
-
-
Save soiqualang/6782b6acdf61317b7f4b179264beba8a to your computer and use it in GitHub Desktop.
Author
soiqualang
commented
Apr 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment