Travis-CI Build Status

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

manifoldr

Manifoldr allows direct connection to Manifold .map projects from R via ODBC. We can read tables in full, or issue SQL queries to select or dynamically create new tables.

library(manifoldr)
mapfile <- system.file("extdata", "AreaDrawing.map", package = "manifoldr")
(x <- Drawing(mapfile))

Note the mixed types which are now available in R via sf

Basic Manifold queries work, using the "WHERE" argument.

Drawing(mapfile, WHERE = "WHERE [Type (I)] = 2")

Drawing(mapfile, WHERE = "WHERE IsLine(ID) AND [Length (I)] < 2500")

Exciting!

Installation

1) manifoldr relies on ManifoldĀ® System GIS, it's of no use if you don't have this installed and working.

2) manifoldr is only available from GitHub: the easiest way to install it is to use the devtools package.

if (packageVersion("devtools") < 1.6) {
  install.packages("devtools")
}
devtools::install_github("mdsumner/manifoldr")

(Future versions may become available on CRAN. )

NOTES:

alt text

All the standard Manifold SQL is available.

NOTE: this will be merged with mdsumnner/dplrodbc in some way. Was originally called RforManifold.

Manifold GIS and R make for a powerful partnership, but the coupling between them has been relatively loose and sketchy.

Two key recent R packages make the coupling more compelling:

The main ways we connect R and Manifold are

1) read drawing layers with data from Manifold .map files via SQL queries 2) drive the Manifold API directly via .Net. 3) (developing) simplify the queries via dplyr

The first provides a pretty tight mapping of high-level data types, i.e. in Manifold we have a drawing and in R we have a Spatial layer and moving from one to the other is easy.

The second provides a lot more power but we need to do more work to transfer data between the systems.

There are lots of other pathways, including GDAL as a third/fourth party and via file transfer.

Examples

See the package vignettes for examples.

Problems

TODO

https://github.com/mdsumner/talks/blob/master/SQL_3/SQL_3.rmd



mdsumner/manifoldr documentation built on May 22, 2019, 4:45 p.m.