답변:
ST_AsText (지오메트리를 WKT / Well Known Text로 반환) 외에도 ST_AsGeoJSON ()과 같은 몇 가지 추가 출력 형식이 있습니다.
http://postgis.net/docs/manual-2.0/reference.html#Geometry_Outputs를 살펴보고 필요에 가장 적합한 것을 선택하십시오.
ST_AsText 를 사용 하여 점 객체를 봅니다.
SELECT ST_AsText(the_geom)
FROM myTable;
SELECT ST_X(the_geom), ST_Y(the_geom), ST_AsText(the_geom)
FROM myTable;
st_x(st_centroid(the_geom))
UTM 테이블
SELECT
ST_X(table.geometry) AS X1, --point x
ST_Y(table.geometry) AS Y1, --point y
ST_X(ST_TRANSFORM(table.geometry,4674)) AS LONG, -- longitude point x SIRGAS 2000
ST_Y(ST_TRANSFORM(table.geometry,4674)) AS LAT, --latitude point y SIRGAS 2000
ST_ASTEXT(table.geometry) AS XY, --wkt point xy
ST_ASTEXT(ST_TRANSFORM(table.geometry,4674)) AS LongLat --using st_transform to get wkt with longitude and latitude (4674 is the SIRGAS 2000 SRC by south america)
FROM
table
SELECT * ST_AsText(the_geom) FROM table2;