如何将查询结果中的所有字段放入geojson字符串?

时间:2018-01-29 21:11:56

标签: sql postgresql postgis geojson

我有一个包含美国人口普查区的PostGIS表。它有一个Multipolygon列,以及包含每个管道信息的字符串列。

我有这个问题:

SELECT
    tractce,
    countyfp,
    statefp,
    ST_AsGeoJSON(geom) AS geom_geojson  
FROM theme_mapbasetracts 
WHERE ST_MakeEnvelope( -74.084246673584,40.67638769936645, -73.7572317504883,40.800601763990066) && ST_Transform(theme_mapbasetracts.geom,4326)

一行以分号分隔的结果看起来像这样:

"002202";"061";"36";"{"type":"MultiPolygon","coordinates":[[[[-73.982964,40.722671],[-73.980607,40.721678],[-73.978231,40.720674],[-73.978753,40.719934],[-73.979735,40.720235],[-73.981308,40.720709],[-73.982167,40.720969],[-73.983824,40.721473],[-73.982964,40.722671]]]]}"

如何将前三个字符串"002202";"061";"36" - 放入GeoJSON字符串?

0 个答案:

没有答案