40 std::string connInfo(
"file://");
41 std::string data_dir = TERRALIB_DATA_DIR;
44 std::cout <<
"Inform the user to access your Microsoft Access database (ENTER if there is none): ";
45 std::getline(std::cin, aux);
46 connInfo += aux.empty() ?
"" : aux +
":";
48 std::cout <<
"Inform the Password to access Microsoft Access database (ENTER if there is none): ";
49 std::getline(std::cin, aux);
50 connInfo += aux.empty() ?
"" : aux +
"@";
52 std::cout <<
"Inform the location of your Microsoft Access database (ENTER to accept default \'" << (data_dir +
"/ado/ADODataSource.mdb") <<
"\'): ";
53 std::getline(std::cin, aux);
57 connInfo += data_dir +
"/ado/ADODataSource.mdb";
60 connInfo +=
"?&PROVIDER=Microsoft.Jet.OLEDB.4.0";
62 connInfo +=
"?&PROVIDER=Microsoft.ACE.OLEDB.12.0";
70 std::unique_ptr<te::da::DataSetType> inDst = inDs->getDataSetType(dataSetName);
72 std::unique_ptr<te::da::DataSet> inDset = inDs->getDataSet(dataSetName);
74 std::map<std::string, std::string> options;
84 std::string connInfo(
"file://");
85 std::string data_dir = TERRALIB_DATA_DIR;
88 std::cout <<
"Inform the location of your data source (ENTER to accept default \'" << (data_dir +
"/shape/poligono_unico.shp") <<
"\'): ";
89 std::getline(std::cin, aux);
93 connInfo += data_dir +
"/shape/poligono_unico.shp";
99 Copy(aux, std::move(inDs),
ds);
101 Copy(
"poligono_unico", std::move(inDs), ds);
static std::unique_ptr< DataSource > create(const std::string &dsType, const std::string &connInfo)
It creates a new repository for a data source.
static std::unique_ptr< DataSource > make(const std::string &driver, const te::core::URI &connInfo)
Examples that show how to access/manipulate an ADO data source.
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
void Copy(std::string dataSetName, std::unique_ptr< te::da::DataSource > inDs, te::da::DataSource *outDs)
TEDATAACCESSEXPORT void Create(DataSource *ds, DataSetType *dt, DataSet *d, std::size_t limit=0)
It creates the dataset definition in a data source and then fill it with data from the input dataset...
A factory for data sources.
Utility functions for the data access module.
void CreateDataSource(std::string name)
This file contains include headers for the TerraLib Common Runtime module.
void CopyFromShapeFile(te::da::DataSource *ds)
It copies a shapefile to the given datasource.