PostGIS中几何对象输出

select myID AS ID,ST_AsText(pt) AS geo from test1;
//以文本格式返回

select *,ST_AsGeoJson(pt) from test1
//以json格式返回

select *,ST_AsGML(pt) from test1

//以gml格式返回

几何对象输出:
NDR:Little Endian
XDR:big-endian
HEXEWKB:Canonical
SVG:SVG 格式
GML:GML 格式
KML:KML 格式
GeoJson:GeoJson 格式

ST_AsBinary(geometry,{‘NDR’|’XDR’})
ST_AsEWKT(geometry)
ST_AsEWKB(geometry, {‘NDR’|’XDR’})
ST_AsHEXEWKB(geometry, {‘NDR’|’XDR’})
ST_AsSVG(geometry, [rel], [precision])
ST_AsGML([version], geometry, [precision])
ST_AsKML([version], geometry, [precision])
ST_AsGeoJson([version], geometry, [precision], [options])

转载自:https://blog.csdn.net/cehui115081/article/details/18731173

You may also like...