[R-sig-Geo] Replacement shapefiles with SpatiaLite for R-geo packages(spdep, rgeos etc.)

Roger Bivand Roger.Bivand at nhh.no
Sun Dec 2 15:40:25 CET 2012


On Sun, 2 Dec 2012, hi_ono2001 at ybb.ne.jp wrote:

> Hello.
>
> Recently SpatiaLite 4.0 was released. It has lots of powerful, fast and 
> robust functions for Geoprocessing(spatial queries, overlay analysis, 
> creating topology, network analysis, gridding, creating TIN/voronois). 
> Some people say SpatiaLite is one of candidate to next standard spatial 
> data format.

Spatialite is supported by OGR in rgdal if the drivers are available. Its 
future status is unknown, but of course we should try to make life easier 
for its users. If you could document how easy it is to include the driver 
in the CRAN Windows and OSX binaries, that would help. In my opinion, 
Spatialite should be used through OGR in R, and should not be used for 
topological operations, which blunt the sense of having shared classes in 
R for spatial data. Using OGR means that things stay maintainable.

>
> Current rgeos package seems to be slower and unstable for bigger spatial 
> data. And I think if using SpatiaLite, spdep could create spatial weight 
> matrices more speedy than current ones. If this, R will be exactly "R as 
> a GIS".

Since Spatialite uses the same GEOS dependency as rgeos, you should 
substaniate this claim with clear reproducible cases; rgeos is now pretty 
stable, and misbehaviour now is usually because of erroneous topologies 
(overlaps, slivers and dangles). I would strongly advise against thinking 
that exporting to Spatialite then GEOS, doing GEOS there, and importing 
again, will be faster or more stable than converting Spatial* objects to 
GEOS objects, doing GEOS, and converting back again - the steps are very 
similar, and such a claim would need to be studied carefully. The same 
time could rather be used to contribute to rgeos. Spatial weights matrices 
created in spdep can use STRtrees from GEOS, and are fast (90K polygons in 
10 seconds). But this isn't the default, you need to use extra arguments.

>
> Unfortunately SQLiteMap, R package for accessing SpatiaLite, has been 
> removed from CRAN since this September.

CRAN has been making its management more systematic - if maintainers do 
not respond to requests for corrections, the source packages are archived 
until the maintainers comply. This is why maintainability is crucial. 
Arguably, the package would also be redundant if OGR Spatialite drivers 
were available for those dependent on the CRAN rgdal binaries.

>
> Any plan to employing  this SpatiaLite for current R-geo packages.
>

Please contribute a vignette to a suitable package, showing how one can 
use this storage format with R already. For use of SQL, rather consider 
contributing to helping add OGR SQL to readOGR in rgdal, then other 
drivers would benefit too.

Best wishes,

Roger

> Thanks in advance.
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
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