Skip to content
Prev 692 / 29559 Next

OGR dataset to R

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

            
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.