[Mapserver-users] How do I use ms_newShapefileObj()?

Lowell Filak lfilak at medinaco.org
Wed Jul 28 14:58:00 EDT 2004


Just a thought - is it possible that the permissions are not correct for
the webserver to create a new (shape)file in the directory?

HTH

Lowell

The following message was sent by BONNER S KARGER
<bskarger at students.wisc.edu> on Wed, 28 Jul 2004 13:32:34 -0500.

> List:
> 
> I am trying to populate a NEW shapefile (that is, uncreated until
there is an SQL result for point coordinates), but I get the following
error:
> 
> Warning: [MapServer Error]: msNewSHPFile(): (testshapefile) in
test/setpoint.php-cgi on line 5
> 
> Fatal error: Failed to open shapefile testshapefile in
test/setpoint.php-cgi on line 5
> 
> I am trying to create a new shapefile and populate it with points that
are coming in from a MySQL query. The points will display fine on the
map, but I want to be able to query them, so I need to create a
shapefile and .dbf. I can't get past creating the shapefile, however. 
> 
> Here is the php code that is found in the "for loop":
> ------------------------------------------------
> <?php
> $value = mysql_fetch_array($result); 
> $point = ms_newPointObj();
> $point->setXY($value[20],$value[21]);
> $newshapefile = ms_newShapefileObj(testshapefile, MS_SHP_POINT);
> $newshapefile->addPoint($point);
> $point->draw($map, $layer, $img, 0 ,'map image');
> $point->free();
> ?>
> 
> 
> I thought that by passing MS_SHP_POINT, it would create a new file. Am
I wrong?
> Any ideas?
> 
> Thanks
> 
> Bonner
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list