1

I have a postgis database table of boundary data which is made up of LineString geometry's, what I would like to do is create a query that will return only the rows that contain a LineString geometry that is within (or at least one point of the LineString is within) a given polygon or area (this would typically be a bounding polygon of the current map view).

I've tried using ST_Intersects, ST_Contains and ST_Covers but to no success. What is the recommended method for doing this?

2
  • A plain ST_Intersects should work. What did you try?
    – CL.
    Commented Jul 20, 2018 at 11:42
  • I have a feeling it may have been due to the parameter I was using with it (converting GeoJSON to Geometry with ST_GeomFromGeoJSON as one of the parameters). I've since used ST_MakeEnvelope with coordinate points and the && operator to represent the intersection and it seems to return the results I need.
    – Bauza23
    Commented Jul 20, 2018 at 13:42

1 Answer 1

0

I resolved this via the answer of Performing bounding box query in PostGIS? by using a bounding box via ST_MakeEnvelope

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.