如何在PostgreSQL中将Geography数据导入GeoJson?

时间:2015-01-31 15:07:53

标签: sql postgresql postgis

我正在使用PostgreSQL数据库,表(区域)中有一个字段,即geog pulic.geography(Points,4326)。它包含以下类型的记录

0101000020E6100000BA83D89942334540780B24287ED051C0

我正在使用ST_AsGeoJson()来获取GeoJson以上类型的记录。

我的数据库已连接,我正在使用查询来获取结果,即

$query="SELECT ST_AsGeoJSON(geog) FROM area";

但是我得到了警告而没有得到任何结果

Warning: pg_query(): Query failed: ERROR: function    st_asgeojson(public.geography) does not exist LINE 1: SELECT ST_AsGeoJSON(geog) FROM public.area ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in /home/domain/public_html/sg_database.php on line 20"

请建议这个..

由于

0 个答案:

没有答案