[Mapserver-users] How to import mysql data in mapscript

Eric Bridger eric at gomoos.org
Tue May 4 15:18:39 EDT 2004


This is certainly possible using mapscript. But you must ensure that
there is at least one key value in common between your shapes and your
database.  queryByPoint, or queryByRect, etc will return to you the
contents of you shape files DBF file. If one of those is a key value,
such as country code, you can then use it to query your MySQL database.

Conversely you can loop thru all you shapes and check each one for a
matching country code (key value) and then set attributes on the shape,
such as hightlight, etc.

On Tue, 2004-05-04 at 13:36, Attri, Abhishek wrote:
> Hi all,
> 
>  
> 
> Please let me know if it's possible at all. I am trying to import data
> (which is not shape data, but just simple data like population of all
> counties of a state) from a MySQL database, and query the shapefiles for
> "Counties" based on the fields in the MySQL database.  The shapefiles
> and the results from the MySQL query have nothing in common. They are
> two totally different data sources. How can I integrate them? 
> 
>  
> 
> Has anyone done something like this? If yes, then how will you set the
> values of 'data', 'classitem' and 'setexpression'   in the layer and
> class objects?
> 
> If that's not possible, what else can be done to achieve the above
> purpose? 
> 
>  
> 
> I have tried a lot of combinations to import data, and query the result
> set, but was not successful to create the layer based on MySQL data.
> Please help!
> 
>  
> 
> With thanks,
> 
>  
> 
> Abhishek
> 
>  
> 
>  
> 
>  
> 
>  
> 





More information about the mapserver-users mailing list