Answer the question
In order to leave comments, you need to log in
Why does Postgres (PostGis) not correctly calculate occurrences of points in a radius?
There is a table with this DDL:
CREATE TABLE buildings
(
id INTEGER PRIMARY KEY NOT NULL,
city VARCHAR(255) NOT NULL,
street VARCHAR(255) NOT NULL,
build_number DOUBLE PRECISION NOT NULL,
location GEOMETRY(POINT,4326) // пробовал и GEOGRAPHY(POINT,4326)
);
sprintf('SRID=4326;POINT(%s %s)', $faker->longitude(55, 55.08), $faker->latitude(82.93, 83.01));
55.0502, 82.9615
SELECT *
FROM "buildings"
WHERE ST_DWithin(location, ST_GeomFromText('POINT(55.0502 82.9615)'), 500, TRUE)
SELECT *
FROM "buildings"
WHERE ST_DWithin(location, ST_GeomFromText('POINT(55.0502 82.9615)'), 1500, TRUE)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question