[Mapserver-users] Creating dynamic shapefiles with Python Mapscript

Eric Bridger eric at gomoos.org
Tue Nov 18 04:20:18 EST 2003


On Tue, 2003-11-18 at 08:45, Bjoern Platzen wrote:
> Hi Folks,
> 
> I have some point-data in a MySQL database. Just showing them was not a 
> problem. But now I also want to make them queryable. As far as I found 
> out in the ML-archive, in that case, I'll have to create a new 
> (temporary) shapefile and a corresponding dbf, right?
> 

This is not strictly true.  If you not only draw your points,
$point->draw(), but also add them as Features to your layer
(addFeature($shape)) you can query them as if a DBF file exists and get
the shape index returned.  You can use this index to lookup your MySQL
keys values in a lookup table.  If your MySQL key values are numeric you
can use them as the shape index and have them returned by queryByPoint()
and look up the record in MySQL. No lookup table required.'

This is the method I always use when drawing point data. There is a Perl
example here:

http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples35ex19






More information about the mapserver-users mailing list