0

I'm trying to make polygon of an airport which must be given distance from start point and end point of runway given as latitude and longitude. airport polygon

Query I've made looks like this:

INSERT INTO airport (name, polygon) 
VALUES(
      'some airport name', 
      ST_SetSRID(
        ST_Collect(
            ST_Buffer(ST_MakePoint(160.04518, -9.43196), 100), 
            ST_Buffer(ST_MakePoint(160.06376, -9.42452), 100)
        ), 4326
      )
);

unfortunately result polygon is very weird, it covers almost all earth. I've also tried to add srid to each point but it also didn't work. Any ideas?

Paweł Sosnowski
  • 173
  • 3
  • 12

1 Answers1

0

Thanks to https://stackoverflow.com/a/13872887/4270929 before adding buffer to point it must be cast to geography (in geometry is in different unit I guess?)

ST_Buffer(ST_MakePoint(160.04518, -9.43196)::geography, 100)::geometry, 
ST_Buffer(ST_MakePoint(160.06376, -9.42452)::geography, 100)::geometry
Paweł Sosnowski
  • 173
  • 3
  • 12