It's actually something I have long wanted to explore, but rgdal source is
still out of reach to me (just need to spend enough time). I think it would
be useful to read and write 3 and possibly 4-d objects, and apart from the
class validation and read/write this is possible for points and lines if
you generalize bbox. It would obviously break for a lot of downstream uses
of sp though.

Reading from shapefiles with Z would be enough for a lot of things, perhaps
it's worth chasing that and making a special class that won't break
anything else (Roger Bivand explained this offlist some time ago, and I can
do that but it's the read I want to figure out myself).  But, it has been a
long time since I compiled rgdal so even simple exploration is a way off
for me.

Note that polygons in OGC are composed of linear rings and so unless your
polys are composed completely of individual triangle facets they are rarely
going to be of any use. Lines are much simpler but still pose complications
for validation in 2d (think of intersecting lines) compared to 3d or higher.

As a workaround you can use gdal to extract the data to something more
generic, as here
https://stat.ethz.ch/pipermail/r-sig-geo/2009-November/006866.html


Cheers, Mike



On Monday, March 18, 2013, Agustin Lobo wrote:

> Thanks, this is what seemed to me, but the following phrase from the sp pdf
> "The classes document where the spatial location
> information resides, for 2D or 3D data"
>
> and some scattered info such as
>
> http://gis.stackexchange.com/questions/43342/how-to-use-z-coordinate-in-qgis
>
> http://grokbase.com/t/r/r-sig-geo/127s88jzc6/problem-extracting-z-value-from-line-shapefile
>
> make me think that some support for x,y,x coordinates actually exists
> in sp and perhaps writeOGR() could
> have taken advantage of it.
>
> I've got very good advice on how to create the 3d shapefiles using
> simple python scripting in the qgis list, I insert the link:
>
> http://osgeo-org.1560.n6.nabble.com/create-3d-shapefile-and-or-GPX-tp5040855p5040863.html
>
> Agus
>
> On Sat, Mar 16, 2013 at 2:00 PM, Michael Sumner <mdsumner@gmail.com>
> wrote:
> > It is not possible.
> >
> > Cheers, Mike
> >
> > On Saturday, March 16, 2013, Agustin Lobo wrote:
> >
> >> Is it possible to write point ESRI shapefiles with x,y,z
> >> coordinates using writeOGR()?
> >> According to what I've been able to find, it seems
> >> that spatial points can have 3 coordinates while
> >> spatial lines cannot. Nevertheless, coordinates() accepts
> >> 2 arguments (x,y) only. So actually, do not know how to define
> >> x,y,z coordinates for spatial points (data frame) objects.
> >> Is it possible?
> >>
> >> Thanks,
> >>
> >> Agus
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> R-sig-Geo@r-project.org <javascript:;>
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> >
> > --
> > Michael Sumner
> > Hobart, Australia
> > e-mail: mdsumner@gmail.com
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
Michael Sumner
Hobart, Australia
e-mail: mdsumner@gmail.com

	[[alternative HTML version deleted]]

