center point using data from PostGIS

Ethan Alpert ealpert at DIGITALGLOBE.COM
Mon Oct 25 14:52:10 EDT 2004


Use the DB.php interface and make a query to postgis.

The postgis function centroid ought to do what you want.

-e

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Yannick Doiron
Sent: Monday, October 25, 2004 12:03 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] center point using data from PostGIS


Hi list,

I am using MapServer CGI 4.2 on window XP with PostGIS data connect to it.

I'a using the code below to center the map on a point choosed by the user from a select list.

<select name="ViewEmploye" id=emp onchange="employe();" size="1"> <option value="-1">Employes</option> <option value="-1">-------------</option> <option value="359877 5276306"> Annelle Duguay </option> <option value="336655 5297926"> Thérèse Haché </option> <option value="357748 5295074"> Yannick Doiron </option> </select>

I want to be able to get the coordinate from a PostGIS database instead of writing it like the code above. I was able to import my data in PostGIS and see it with MapServer. I know I will have to use PHPMapscript. I have it install and working (I have the ms4w package from maptools.org installed) but I am not very good php programming.

Can somone lead me at a tutorial or else on how to achieve this? If this was asked and answered in the past, please forward me the link.

Thanks in advance,
Yannick



More information about the mapserver-users mailing list