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?

Bauza23
  • 11
  • 2
  • A plain ST_Intersects should work. What did you try? – CL. Jul 20 '18 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 Jul 20 '18 at 13:42

1 Answers1

0

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

Bauza23
  • 11
  • 2