PHP-Mapscript question

Lowell Filak lfilak at MEDINACO.ORG
Wed Sep 22 08:44:54 EDT 2004


The following message was sent by Ace Suares <ace at SUARES.NL> on Tue, 21
Sep 2004 18:24:26 -0400.

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Monday 20 September 2004 15:47, Ace Suares wrote:
> > Dear people,
> >
> > Mapserver is a great toy. Iit's the first time I am doing GIS in a
> > project and after looking around for quite some while, I decided to try
> > mapserver.
> >
> > But I've got some troubles, of course.
> >
> > I am using php-mapscript (I hope this is the right list ?)
> > and I would like to use a basic mapfile and then add dynamic data to
> > it.
> >
> > In this instance I have a shapefile with 483 cities, but the .dbf file
> > only has their name and number of inhabitants. Now I'd like to add a
> > score to it, which I retrieve live from a mysql database. The score can
> > be 1-7, depending on some questionaires that citizens filled in. Goal
> > is to color the cities different according to their score.
> >
> > I tried modifying the 'values' from the shapeObj(ects) but these are
> > readonly. I do *not* want to wrtie a .dbf file with the dynamic data to
> > disk, not do I want to use Postgress or Oracle or wait for mysql
> > spatial extentions.
> >
> > Anyone can point me in the right direction !?
> >
> > Grateful, as always,
> >
> > Ace
>
> Anyone !?
>
> +_Ace

Ace,

Note: This is only one way of doing it.
If your using mapscript then you have control over what is drawn when.
You can select the records from mysql that match a score of 1 and then
use mapscript to loop through each result and change the layer class
expression to include the city name(s) dynamically. This assumes that
your mysql table has the score & the city name as fields and your dbf
has the exact same city name as a field.

HTH

Lowell



More information about the mapserver-users mailing list