1

Using a front end Map UI, I have selected a polygon and received all the Lat/Long points from it. I want to send this data to a PostgreSQL PostGIS database table that has rows which stores a geometry Point in a column. I need to select all the rows that are inside of the polygon. How do I put the external polygon points into the SQL statement and pull the correct data?

1 Answer 1

1

I found the answer:

SELECT * FROM Your_Table
  WHERE ST_Within(geom, 
    ST_GeometryFromText('POLYGON((-104.53798595055618 31.54712467875706,
        -102.48477288296839 31.289207699238165,
        -102.68445701550822 30.006579157844246,
        -104.3434563387951 30.233933113969798,
        -104.53798595055618 31.54712467875706))',4326)
    );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.