[Mapserver-users] Z values from 3D shapefiles (PHP MapScript)

Daniel Morissette morissette at dmsolutions.ca
Mon Jan 6 13:36:13 EST 2003


MapScript supports 2D shapefiles (x,y), and measured shapefiles (x,y,m),
but it doesn't support shapefiles with Z values (x,y,z).  I would think
that someone could add this fairly easily by looking at the latest
version of Shapelib and porting the changes to suppport the Z types to
the MapServer version of shapelib.  Perhaps you could file this as an
enhancement in bugzilla, and if someone ever has time...

Daniel


"Hankley, Chip" wrote:
> 
> Is there a way to access the Z-values of the vertices in a 3D shapefile? I
> have a 3D LINE shapefile that I created in ArcView. When I try to loop
> through the shapefile, each shape type is returned as MS_SHAPE_NULL. I'm not
> able to access the individual 'lines', apparently, for this type.
> 
> The code I'm using is:
> 
>   //Open the shapefile and spit out the results for each line.
>   $oShpFile = ms_newShapefileObj($shpPath, -1);
>   for ($i=0;$i < $oShpFile->numshapes;$i++) {
>     $oShp = $oShpFile->getShape($i);
>     for($j=0; $j < $oShp->numlines; $j++) {
>       $oLine = $oShp->line($i);
>       for($k=0; $k<$oLine->numpoints; $k++) {
>         $point = $oLine->point($k);
>         echo $point->x . "," . $point->y . "," . $point->m . "<BR>";
>       }
>     //$oLine->free();
>     }
>   $oShp->free();
>   }
>   $oShpFile->free();
> 
> Thanks!
> 
> Chip



More information about the mapserver-users mailing list