Buffers (Circle) in PostGIS

后端 未结 2 997
刺人心
刺人心 2020-12-04 03:00

I have to extend the normal GeoJSON format to add some unsopported polygon like Circle.

{
 \"type\": \"Circle\",
 \"radius\" : 0.001,
 \"coordinates\": [
            


        
2条回答
  •  -上瘾入骨i
    2020-12-04 03:21

    May be you can try this it is for a zone one kilometer in diameter like. I test it and it works for me:

    SELECT ST_Buffer(  
        ST_MakePoint(-122.325959,47.625138)::geography, 
        1000)::geometry;
    

    See here for better understanding. I didn't test it but hope it will help you.

    To recap a bit what Abdullah Alger did in the solution that you can see in the link above:

    First he has a database called stores with latitude and longitude column no geometry column with Starbuck dataset.

    Then he adds geometry with the query:

    SELECT AddGeometryColumn('stores', 'geom', 4326, 'POINT', 2); 
    

    After that update the geom column

提交回复
热议问题