[mapserver-users] Classify individual shapes from DB attributes

Michael Schulz mschulz at webgis.de
Tue May 28 06:09:00 EDT 2002


Dear List,

i have a question about classifying shapes on-the-fly via PHP/Mapscript.

I have a shape with no classification information. This information
should come from a database (currently MySQL because of the ISP's
prerequisites and that this classification information is updated
hourly).

There seem to be two ways to go:
1. on-the-fly create a new shapefile and join the information of the DB
into the dbf attribute table, then display
2. change the classindex attribute of each shape to values queried from
the database (this means: query this layer to get a handle on the shapes

in mapext, for each resulting shape query the db with the shp-index,
assign the queried value to the classindex parameter and draw the shape)

I tried the second way for a small test-shape and it kinda worked. But i

am not sure how this solution will scale when i use the original
shapefile with a filesize of 8Mb (only lineshapes). Could anyone who has

some experience with mapscript and drawing layers on-the-fly comment on
this?

I am sure there are other and better ways. Any ideas?

And: PHP/mapscript bug? In my attempts to draw the classified shape i
use shapeObj's draw method that should take the argument int
class_index, but it didn't work.

Thanks, Michael

P.S.: mapserv3.5, php406

--
-----------------------------------------------------------
Michael Schulz                                in medias res
Dipl.-Geologe                              Gesellschaft für
                                Informationstechnologie mbH
                             Sautierstr. 38, 79104 Freiburg
                                     0761 55695-95 (Fax 96)
mschulz at webgis.de                             www.webgis.de







More information about the mapserver-users mailing list