the_geom -> PHP?

Arnulf Christl arnulf.christl at CCGIS.DE
Sun Oct 23 08:34:11 EDT 2005


Peter Kingsbury wrote:
> Hello all,
> 
> I have some data stored in a PostgreSQL table (point data stored in a 
> 'geometry' datatype column) which I would like to turn into legible 
> coordinate data in PHP. I've been trawling google for a while, but I am 
> having difficulty locating useful documentation on this subject. Not 
> sure if I should be checking the PHP or the PostgreSQL documents for 
> this info, but digging through both has thus far proven unfruitful.
> 
> Any help would be appreciated.  :^)
> 
> Best regards,
> - Peter

Hi,
if you can access PG with PHPO directly & just want to have the geom in 
plain text use the PostGIS asewkt(the_geom) function in the query.

SELECT asewkt(the_geom) FROM whatever

It will return a WKT (Well Known Text) string with the coordinate system 
and a list of coordinates.

Best,



More information about the mapserver-users mailing list