How to get Geography data to GeoJSON in PostgreSQL?

المشرف العام

Administrator
طاقم الإدارة
I am using PostgreSQL database and there is a field in a table(area), i.e., public.geography(Points,4326). It contains below type of records

"0101000020E6100000BA83D89942334540780B24287ED051C0"I am using ST_AsGeoJson(), to get the GeoJSON through above types of records.

My database is connected and I am using a query to fetch result, i.e.,

$query="SELECT ST_AsGeoJSON(geog) FROM area"; But I am getting below warning and not getting any results

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 20How can I solve it?



أكثر...
 
أعلى