Skip to content

direct to project file  #3

@mdsumner

Description

@mdsumner

This thread shows a way http://www.georeference.org/forum/t153736.3

We'd like to flesh out examples of accessing projection files directly, without configuring the ODBC interface.

This code relies on

  • installed version of Manifold 9.0 (not just the free viewer)
  • an existing project file at "C:\temp\test.map" or set that to suit

I've tried connection strings that use dev builds of Manifold (as listed in the ODBC interface), but the string is too long (?) and gives an error from the odbc package.

library(DBI)
library(odbc)
filepath <- "C:\\temp\\test.map"

template <- "DRIVER={Manifold 9.0 Project Driver (*.map)};DBQ=%s;Unicode=True;Ansi=False;OpenGIS=True;DSN=Default;"
dstring <- sprintf(template, filepath)

con <- dbConnect(odbc::odbc(), .connection_string = dstring)
dbListTables(con)

## need an existing table name  (mfd_meta is always present)
dbReadTable(con, "mfd_meta")

dbGetQuery(con, "SELECT * FROM mfd_meta")

To use dbplyr tbl_lazy needs a bit more groundwork (not yet pushed to this repo): https://twitter.com/mdsumner/status/1318017630981156864/photo/1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions