1

I am building an application where I need to build a radius n meters around a given lat, lon. the st_buffer overload that uses a geography type for the first parameter would work fine, however, I am using an ORM that does not provide the ability to cast a geom to geography.

I tried setting the SRID to 4326 but it still outputs the circle in much larger units.

Is there some calculation/formula I can use to convert n meters to whatever units the geometry type uses?

  • 1
    which srid is your geometry in? 1. if the geom is a geometry type already you should buffer it in geometry 2. how are you not able to convert to geography? if you are using postgis you have that ability. you might need to explicitly call SQL with whatever environment you are working on – ziggy Nov 8 '19 at 16:10
  • 3
    you should not be buffering in 4326 – ziggy Nov 8 '19 at 16:10
  • my geometry is a point using st_makepoint(). I was trying with SRID 4326 but open to suggestions. I just need a cirlce n meters around a given point. – foobarbaz Nov 8 '19 at 16:27
  • so the SRID is already in 4326? what area of the world are these points in? – ziggy Nov 8 '19 at 16:33
  • 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.