I have two lon/lats that I've turned into geometry. I've tried having the column type being both text and geometry. I have a fence_geom and a user_geom. I am looking to test to see if the user is inside the fence_geom. I have tried using several different postGIS methods to check for this but I am only getting false. The location with the users is definitely within the geofence but I keep getting false even when the results should return true. For tests sake, every user has the same geometry which is the one within the geofence. I've tried switching the order of the parameters and the results are the same.
Table data types: TEXT(fence_geom, user_geom)
Value in fence_geom:
POLYGON((40.3329363811639 -111.742630004883,40.3324129517368 -111.64306640625,40.248611959397 -111.642379760742,40.3329363811639 -111.742630004883))
value in user_geom:
Versions: PostgreSQL: 9.66; PostGIS: 2.5
EDIT: From my readings I've come to the conclusion that I need an SRID. How would I add an SRID for a call like this?
SELECT ST_Covers(fences.fence_geom, users.user_geom) FROM fences, users
This function returns an empty result.