Subject: RE: [R-sig-Geo] maptools package rejects some polygon shapefiles?

Nicholas Lewin-Koh nikko at hailmail.net
Thu May 12 17:55:32 CEST 2005


Hi,
Wouldn't it make more sense to handle 3d file as 3d?
In outher words store 3d poionts as 3d points. For dealing 
with this in R, we could write methods that would display the 
3rd dimension as an attribute. I don't think it would be hard to change
the
underlying C code to reade shape 3d files. I think the challange would
be in the
R data structure and methods.

Nicholas

Date: Thu, 12 May 2005 10:58:31 +0200 (CEST)
From: Roger Bivand <Roger.Bivand at nhh.no>
Subject: RE: [R-sig-Geo] maptools package rejects some polygon
        shapefiles?
To: Rick Reeves <reeves at nceas.ucsb.edu>
Cc: r-sig-geo at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.44.0505121055521.11044-100000 at reclus.nhh.no>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 11 May 2005, Rick Reeves wrote:

>
> Roger:
>
> Thanks for the quick response. Here is the file,
> and I will follow your suggestions.....
> The ArcCatalog metadata section claims that this
> is a Simple Polygon file, Topology FALSE,
> feature count 558, spatial index = TRUE,
> Linear Referencing = TRUE, geographic coord system


Rick:

(I'm replying to the list too to ask for comments)

The file is recognised by ogrinfo as:

$ ogrinfo NorthAmericaBest.shp
INFO: Open of `NorthAmericaBest.shp'
using driver `ESRI Shapefile' successful.
1: NorthAmericaBest (3D Polygon)

It should not be too difficult to change read.shape to read 3D points as
3D, and 3D lines and polygons as 2D. I guess that stripping the Z values
is not a problem for anybody (excepting points I think)?

Thanks for your help - with a sample file to study, making this work
will
be much easier. Does anyone have 3D lines and 3D points files?

Best wishes,

Roger


>
> Regards,
> Rick R
>
>
> Scientific Programmer / Quantitative Analyst
> National Center for Ecological Analysis and Synthesis
> University of California, Santa Barbara
> 805 892 2534
> reeves at nceas.ucsb.edu
>
>
>
> -----Original Message-----
> From: Roger Bivand [mailto:Roger.Bivand at nhh.no]
> Sent: Wednesday, May 11, 2005 12:08 PM
> To: Rick Reeves
> Cc: r-sig-geo at stat.math.ethz.ch
> Subject: RE: [R-sig-Geo] maptools package rejects some polygon
> shapefiles?
>
>
> On Wed, 11 May 2005, Rick Reeves wrote:
>
> > News flash: the read.shapefile() method in the shapefiles package
> reads
> > the file.
>
> It would be useful to see what getinfo.shape(filen) says, and to have a
> sight of the file. The error message suggests that it is neither type 3
> (PolyLine) nor type 5 (Polygon), so ArcGIS 9 must be using other codes
> (perhaps for PolyLineM, PolyLineeM, or their polygon equivalents). If
> you
> could make the file available, it may be possible to try to handle files
>
> like this (benefitting others, since you have a working solution).
>
> Roger
>
> >
> > btw, this is a shapefile based on the VMAP0 / DCW dataset.
> >
> > RR
> >
> > Scientific Programmer / Quantitative Analyst
> > National Center for Ecological Analysis and Synthesis
> > University of California, Santa Barbara
> > 805 892 2534
> > reeves at nceas.ucsb.edu
> >
> >
> >
> > -----Original Message-----
> > From: r-sig-geo-bounces at stat.math.ethz.ch
> > [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Rick Reeves
> > Sent: Wednesday, May 11, 2005 9:46 AM
> > To: r-sig-geo at stat.math.ethz.ch
> > Subject: [R-sig-Geo] maptools package rejects some polygon shapefiles?
> >
> >
> >
> >
> > Greetings:
> >
> > Using maptools in the Win XP environment, trying to
> > display an ESRI Shapefile (created with ArcMAP GIS ver 9)
> > outline map of North America. read.shape throws error:
> > Error in read.shape: Not a valid shape type.
> >
> > read.sahpe does read (and plot displays) a point shapefile
> > created on the same platform.
> >
> > Any hints on determining the problem with 'not valid' shapefiles
> > in R?
> >
> > Thanks,
> > Rick R
> >
> >
> > Scientific Programmer / Quantitative Analyst
> > National Center for Ecological Analysis and Synthesis
> > University of California, Santa Barbara
> > 805 892 2534
> > reeves at nceas.ucsb.edu
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list