Answer the question
In order to leave comments, you need to log in
How to make a polygon out of 3000 points?
There is a table of about 3000 points (latitude, longitude). These points outline the border of the state. How to create a polygon from these points and check if point X is contained in this polygon?
Answer the question
In order to leave comments, you need to log in
More or less like this:
CREATE TABLE country_polygon AS
SELECT points.country, ST_MakePolygon(ST_MakeLine(ST_MakePoint(points.longitude, points.latitude) ORDER BY points.num)) As geom
FROM points
GROUP BY points.country;
SELECT ST_Contains(geom,point) FROM country_polygon;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question