I am new to PostGIS and need to ask for some help here. I have a polyline from google maps (representing an itinerary) and need to build a polygon (buffer) around it with a specific distance in meters or kilometers.
For input, I have the list of Latitude/Longitude points and the required buffer distance.
Can anyone help me build the query so that the returned result is the polygon in Latitude/Longitude coordinates, ready to be plotted on the map ?
SELECT
ST_Buffer(ST_Polygon(ST_AddPoint(the_geom, ST_StartPoint(the_geom))),100)
FROM
mytable
SELECT
ST_Transform(ST_Buffer(ST_Transform(ST_Polygon(ST_AddPoint(the_geom,ST_StartPoint(the_geom)),4326),XXXX),100),4326)
FROM
mytable
I haven't tried the code but it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With