[Mapserver-users] Mapserver and Databases MySQL ..

Lowell Filak lfilak at medinaco.org
Tue May 13 12:50:28 EDT 2003


If I understand your intent correctly...
If your familiar with the DBI interface to MySQL or even the SQL syntax in general then half the battle is won.
The thing to watch is that at some point any data loaded into the database has a column that corresponds to the shapeindex for each record (a sequential number starting at 0).
Once that column exists it can be used as the link between the attribute table and the shapes.
For example: when a shape is selected the shapeindex for the selected shape(s) can be used to query the database for any tabular data and if a query is done on the tabular data the shapeindex column value can be used to find the shape based on it's index.
However if your looking to query the database for information based on what the latitude & longitude are for the shape.?
That is a matter of reading the bounds of the selected shape in mapscript and then using that to query the database.
HTH
Lowell F.

The following message was sent by "John Morton" <john at jdmorton.com> on Sun, 11 May 2003 20:45:13 +0800.

> Hi,
> 
> I'm new to mapserver and GIS apps in general ..
> 
> Can someone point me in the right direction for
> some info regarding storing information in a
> database (say MySQL), and then accessing this 
> data in my mapserver app .. the data in the Db
> could contain latitude and longitude co-ords 
> within fields (say X,Y) ..
> 
> ..using Mapscript/ perl .. also Mapscript/PHP
> 
> Any assistance would be appreciated .. ta
> 
> John 
> 
> 
> _______________________________________________
> 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