[Mapserver-users] MySQL query

Lowell Filak lfilak at medinaco.org
Wed Dec 31 16:34:12 EST 2003


As far as the Perl end goes there are a couple examples in the wiki
which should help:
1) http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples35ex2
2) http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples35ex19

Basically what you need to do is use the Perl script to connect to the
MySQL database and retrieve any matching records, as you probably
already do.
>From that you will have the lat/long of the correct point(s) wich you
can use to create a 'virtual' layer and then use that layer to set the
mapextent and render the points (see item #2 above for a queryable
version or item #1 for a display-only version).
One thing to keep in mind is - if the projection of your map is lat/long
then the plotted point data will simply match without specifying
projection parameters but if it is not then you will need to include the
correct projection information for the base map and the point layer.

HTH

Lowell

The following message was sent by pxniw pxniw <pxniw69 at yahoo.com> on
Tue, 23 Dec 2003 18:58:09 -0800 (PST).

> I have php and perl scripts working for mapserver.
> I also have some other data in MySQL database.
> Tables have info like: RestaurantName;City;Lat;Lon
> 
> How do I query either in PHP or Perl RestaurantName
> and provide a Pin Label (Marker) for Lat Lon
> coordinates on my existing mapserver layout for single
> restaurant?
> 
> Ie: I have a map of Georgia displayed. User have
> options to type city in text box (ie Atlanta), and hit
> Go button.
> 
> How do I query the MySQL db and show restaurant
> locations in existing map?
> 
> Thank You.
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list