Skip to main content
added 170 characters in body
Source Link
pLumo
  • 6.6k
  • 21
  • 42

You should compare geography with geography OR geometry with geometry. SoAnd also you need to set the SRID.

So in your case you need

WHERE ST_DWithin(geom::geography, ST_SetSRID(ST_MakePoint(79.3832,43.6532),4326)::geography, 50000);

OR

WHERE ST_DWithin(geom::geography, ST_GeogFromText('SRID=4326;Point(79.3832 43.6532)'), 50000);

Then, from your profile details, I bet itthe longitude must be ST_MakePoint(-79.3832,43.6532)-79.3832, because currently you're searching for cities around a place in southeastern Kasachstan with not much around, while you probably want to search cities around Toronto.

WHERE ST_DWithin(geom::geography, ST_GeogFromText('SRID=4326;Point(-79.3832 43.6532)'), 50000);

You should compare geography with geography OR geometry with geometry. So in your case you need

WHERE ST_DWithin(geom::geography, ST_MakePoint(79.3832,43.6532)::geography, 50000);

Then, from your profile details, I bet it must be ST_MakePoint(-79.3832,43.6532), because currently you're searching for cities around a place in southeastern Kasachstan with not much around, while you probably want to search cities around Toronto.

You should compare geography with geography OR geometry with geometry. And also you need to set the SRID.

So in your case you need

WHERE ST_DWithin(geom::geography, ST_SetSRID(ST_MakePoint(79.3832,43.6532),4326)::geography, 50000);

OR

WHERE ST_DWithin(geom::geography, ST_GeogFromText('SRID=4326;Point(79.3832 43.6532)'), 50000);

Then, from your profile details, I bet the longitude must be -79.3832, because currently you're searching for cities around a place in southeastern Kasachstan with not much around, while you probably want to search cities around Toronto.

WHERE ST_DWithin(geom::geography, ST_GeogFromText('SRID=4326;Point(-79.3832 43.6532)'), 50000);
added 14 characters in body
Source Link
pLumo
  • 6.6k
  • 21
  • 42

You should compare geography with geography OR geometry with geometry. So in your case you need

WHERE ST_DWithin(geom::geography, ST_MakePoint(79.3832,43.6532)::geography, 50000);

Then, from your profile details, I bet it must be ST_MakePoint(-79.3832,43.6532), because currently you're searching for cities around a place in Southeastsoutheastern Kasachstan with not much around, while you probably want to search cities around Toronto.

You should compare geography with geography OR geometry with geometry. So in your case you need

WHERE ST_DWithin(geom::geography, ST_MakePoint(79.3832,43.6532)::geography, 50000);

Then, from your profile details, I bet it must be ST_MakePoint(-79.3832,43.6532), because currently you're searching for a place in Southeast Kasachstan with not much around, while you probably want to search cities around Toronto.

You should compare geography with geography OR geometry with geometry. So in your case you need

WHERE ST_DWithin(geom::geography, ST_MakePoint(79.3832,43.6532)::geography, 50000);

Then, from your profile details, I bet it must be ST_MakePoint(-79.3832,43.6532), because currently you're searching for cities around a place in southeastern Kasachstan with not much around, while you probably want to search cities around Toronto.

Source Link
pLumo
  • 6.6k
  • 21
  • 42

You should compare geography with geography OR geometry with geometry. So in your case you need

WHERE ST_DWithin(geom::geography, ST_MakePoint(79.3832,43.6532)::geography, 50000);

Then, from your profile details, I bet it must be ST_MakePoint(-79.3832,43.6532), because currently you're searching for a place in Southeast Kasachstan with not much around, while you probably want to search cities around Toronto.