I have a set of points defined by their longitude and latitude, and I would like to check if they lie within a "polygon" on sphere. By polygon on sphere, I mean area in between 4 lines going between 4 points that I have. As I understand it, Polygon will give me straight lines that are cast onto a sphere, and I want arcs that are the shortest possible connections between the points. So how may I do that? edit: by do that, i mean this:
SELECT * FROM ST_Distance(ST_GeographyFromText('POLYGON((70 -40,70 -39,71 -39,71 -40,70 -40))'), ST_GeographyFromText('POINT(70.48 -39)'), False)
should return 0, because the POINT lies on the boundary arc. I'm using postgresql 9.4 with postgis 2.1.8