我有 postgreSQL 8.4+PostGIS 1.5。
我想生成 GeoJson。我愿意:
SELECT row_to_json(fc)
FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
FROM (SELECT 'Feature' As type
, ST_AsGeoJSON(lg.the_geom)::json As geometry
, row_to_json(lp) As properties
FROM parcels_temp As lg
INNER JOIN (SELECT num, cadastr FROM parcels_temp) As lp
ON lg.num = lp.num ) As f ) As fc;
但是得到一个错误:
ERROR: type "json" does not exist
LINE 4: , ST_AsGeoJSON(lg.the_geom)::json As geometry
我究竟做错了什么?