I'm using Googlemaps service to plot some marker on the map. All markers are stored in a postgresql table, named "locations" and that has a location column (data type to geometry).
When the user clicks on the markers a route is created between them.
My question is: how can I generate a buffer (with a limit of 10km along route) and select all my locations inside the buffer. I`m really new in postgis.
P.S. This link inspired me but without success
Thanks!
Best Answer
Don't hesitate to ask me if you need more help!
edit:
SRID 4326 is NOT measuring in meters (see here). Besides that, it's better (faster) to use ST_DWithin. There is a note in the ST_Buffer documentation:
If you would like to measure in meters its better to use geography instead of geometry:
It transforms the points to geographic points and the input is a geographic linestring. ST_GeographyFromText() description:
Good luck!
edit2:
If you want to extract the polygon with the buffer area u can use this query: