개발공작소
728x90
반응형
article thumbnail
[GIS] ST_AsGeoJSON함수를 이용하여 공간정보를 JSON타입으로 변환해보자.
GIS 2022. 5. 21. 14:40

테이블에 공간정보가 있고, 그 공간정보를 JSON형태로 가져오고 싶을 때 쓸 수 있는 ST_AsGeoJSON 함수에 대해 정리해보겠다. 샘플테이블은 링크에서 생성한 뷰테이블을 쓰도록 하겠다. 기본문법 text ST_AsGeoJSON(record feature, text geomcolumnname, integer maxdecimaldigits=9, boolean pretty_bool=false); text ST_AsGeoJSON(geometry geom, integer maxdecimaldigits=9, integer options=8); text ST_AsGeoJSON(geography geog, integer maxdecimaldigits=9, integer options=0); Postgres에서 제..

728x90
반응형