I’m struggling with returning data from the following query. It should be returning all data within a 5k radius of a given Longitude, Latitude point.
SELECT stuff FROM MyGeoTable WHERE ST_DWithin(ST_GeographyFromText(‘SRID=4326;POINT(LONG,LAT)’), geog,5000)
It is not returning all data it should be best guess there is an issue with the Geography column this was created from a geometry column (type Geometry) and is a collection of lines and polygons all on WGS84.
I tried to recreate the Geography column thus
UPDATE MyGeoTable SET geog = (ST_Transform(geom,4326));
ERROR: Geometry type (LINSTRING) dose not match column type (Polygon)
My question is twofold
how can recreate the geography column, and check it has worked on every row?
If this is not possible How might perform a similar query just using the geometry the 5k radius doesn't have to be exact but is from a user input!