1
votes

I'm trying to find a coordinate in a polygon coordinate, but can not get it to work. How should I?

Points coordinate in table "location" column "latlon":

A: 60.2653608 -3.6923519

B: 60.241668 -3.652401

SELECT latlon, st_contains(latlon, ST_GeomFromText('MULTIPOLYGON(((60.237949  -3.654019,
60.240247 -3.661016,
60.243500 -3.658463,
60.240127 -3.642761,
60.240127 -3.642761)))', 4326))  FROM location
1
What do you mean with "can not get it to work". Add to the question what do you expect, what do you get instead and the error message. By the way: where are your coordinates supposed to be? They are probably wrong, since they are in the middle of a ocean: google.de/maps/place/…Tom-db
I know, the coordinates are examples. What I want you to show me the coordinates that are within the polygon coordinateDavid

1 Answers

0
votes

The documentation says:

boolean ST_Contains(geometry geomA, geometry geomB);

St_Contains Returns TRUE if geometry B is completely inside geometry A

Also, you must reverse the order of the arguments: FIRST the polygon, THEN the point