Skip to content

OGR dataset to R

2 messages · Fernando González Cortés, Roger Bivand

#
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?

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