1

I have a point in my PostGIS database that is put in using the lat/long using srid: 4326. The point represents a car driving, now I want to add a polygon of the cars shape around this point and update. I have the car's bounding box in meters, but I'm not sure the best way of adding this information to the database.

I could convert the bounding box into 4 points for each corner and convert those points into Lat/Long but I'm not sure if that's efficient.

I also saw the ST_Translate but not sure how that work between meters and Lat/Long.

Don't worry about rotation at this point.

2
  • 1
    Is the bounding box a square or a rectangle? if it's a square you can cheat and use a ST_Buffer on cast to geography, otherwise you need to determine an appropriate spatial refetence, transform, do the math and transform back. Either way, this question is likely to be closed unless you include your attempt at SQL. Note that geometry points and (lon,lat}, not {lat,lon}.
    – Vince
    Jan 15, 2020 at 11:41
  • What do you need the polygon for? If you just want to display it, it would probably a better idea to do this in the client code.
    – CL.
    Jan 16, 2020 at 9:06

0

Your Answer

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

Browse other questions tagged or ask your own question.