There are actually two limitations, the Line and Polygon classes
(underlying the higher levels) disallow more than two coordinate columns,
and readOGR rejects the 3rd (or more) dimensions when reading from vector
sources.

It's pretty simple to create versions of the classes that work with extra
dimensions, but more complicated to read them from shapefile - you need to
customize and rebuild readOGR for that purpose. You could convert to
GeoJSON and reconstruct the objects in R.

(There are other read functions in packages "shapefiles" and "fastshp" that
might be worth exploring, fastshp sticks to XY but shapefiles does read the
Z, I think).

Note that topologically there's no problem with extra coordinate columns in
the OGC/OGR vector model for lines, but for polygons it's more complicated
because the simple "rings" used for polygons don't extend sensibly to 3D
(in simple cases it might be fine, but probably only if each ring is just a
triangle).

You might be better off working with your coordinates in more raw form,
using triangulation in the geometry package and visualize with rgl.

Cheers, Mike.


On Fri, Apr 11, 2014 at 11:07 PM, Manuel Campagnolo <mlc@isa.ulisboa.pt>wrote:

>
> I realized that sp classes SpatialPolygons and SpatialLines do not handle
> Z coordinates. Are there alternatives for spatial geometries with  Z
> coordinates? I would like to read and write 3D line and polygon shapefiles
> (that represent roads, streams, ridges or basins) and analyse them in R.
>
> Thanks in advance for suggestions,
> Manuel
>
> --
> _________________
> Manuel Campagnolo
> http://math.isa.utl.pt/~mlc/
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner@gmail.com

	[[alternative HTML version deleted]]

