What's wrong?
Daniel Morissette
morissette at dmsolutions.ca
Tue Mar 6 11:27:14 PST 2001
aborruso at spaziogis.it wrote:
>
> I am able to create .shp file and .shx file, but not dbf. When I try to
> open this shapefile I have an error messagge.
> This is my code:
>
> $newshapefile=ms_newShapefileObj("try",MS_SHP_ARC);
> $newline=ms_newLineObj();
> $newline->addXY(2420000,4200000);
> $newline->addXY(2440000,4230000);
> $newline->addXY(2460000,4245000);
> $newline->addXY(2480000,4260000);
> $newshape=ms_newShapeObj(MS_SHP_ARC);
> $newshape->add($newline);
> $newshapefile->addShape($newshape);
> $newshapefile->free();
>
> What's wrong?
>
The shapeFileObj takes care only of the .SHP/.SHX files. You are
responsible of creating the DBF file and adding the records to it.
See mapserver/mapscript/php3/test_writeshape.phtml in the MapServer
source distribution for an example.
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
http://www.dmsolutions.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list