I want to check if a point is inside a fenced polygon.
INSERT INTO polygon (name, geom) VALUES ('test', ST_GeomFromGeoJSON('{"type": "Polygon", "coordinates": [[0,0], [0,5], [5, 5], [5,0]]}'));
SELECT * FROM polygon WHERE name = 'test' AND ST_Intersects(geom, 'POINT(2 2)');
SELECT * FROM polygon WHERE name = 'test' AND ST_Contains(geom, 'POINT(2 2)');
Ideally, I'd expect it to return the row inserted as it should lie within the area. But I get 0 rows for both queries.
I also tried with much bigger, and more realistic data (using lat/long from a map), but I simply cannot get it working and the docs don't seem to help either?