[R-sig-Geo] OGR dataset to R

Roger Bivand Roger.Bivand at nhh.no
Sun Dec 11 20:00:13 CET 2005


On Sun, 11 Dec 2005, Fernando González Cortés wrote:

> Hello,
> 
>         I'm new to R and I was looking for a package to read different
> kinds of datasets (shapefiles, postGIS, dxf, ...) when I received this
> mail. I've read the answers to this mail so I know that the RMap package
> can do it. Is there another way to do it using grass? has it any
> drawbacks so people are looking for another way?

Of course you can use ogr2ogr to make shapefiles, or v.in.ogr to import
into GRASS 6 to build topology and clean the spatial representation,
before writing out a shapefile (v.out.ogr) to be read through the maptools
package. I have found that using GRASS 6 to clean shapefiles as well is
often helpful, there seem to be a lot in the wild that do not follow the
ESRI specification (or maybe I'm unlucky). Indeed other converters can be
used as well to get to shapefiles, which are probably the easiest way in
to R at the moment.

The reason for the difference is that maptools includes a version of the
current shapelib code, and so does not depend on external software for
reading shapefiles. Rmap and rgdal link against external libraries,
meaning that they are much more difficult to distribute cleanly across
platforms, although do work well when installed from source.

> 
> Thanks in advance
> Fernando
> 
> _______________________________________________
> 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