ShapefileObj ?

Stephen Lime steve.lime at dnr.state.mn.us
Wed Aug 23 12:26:09 PDT 2000


The main mapscript just considers the shapes, not the attributes. This is simply
because there are much better tools available for accessing .dbf files. In perl
I've just used mapscript and the xbase module to build the whole shapefile.
When you write the shape, write the attributes. Haven't had any problems
keeping things in sync. There is no relationship other than order so this is the
easiest way to do it.

Note that shapelib, the lib behind the scripting doesn't have a tight integration
between the shape and the attributes so you have use the same processes
in C as well.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Doyon, Jean-Francois" <Jean-Francois.Doyon at CCRS.NRCan.gc.ca> 08/23/00 01:50PM >>>
Hello everyone, it's me again :)

I was wondering if the the ms_newShapefileObj (PHP/Mapscript) only supports
shapes .(shp,.shx), or also attributes (.dbf) ?

I need to map the results of a search from a database, and I was thinking
one easy way to do it might be to
create a temporary shape file with the results (shapes and attributes), and
then work from there (It just so
happens that the results come in a different projection (Decimal Degrees
instead of lambert), so I was going
to take advantage of the Proj.4 features as well ) ...

The only problem right now is that the method doesn't seem to talk about
attribute data, only shapes.

And even then, when I add a shape, I won't know or have the index value, so
that maybe I could use the PHP
built in DBase routines to handle the attribute part ... Meaning I can't
maintain the relationship between a shape
and it's attributes ...

Has anybody come across this type of scenario ? Any suggestions on how best
to proceed ?

Thanks !






More information about the MapServer-users mailing list