AddingSpatialIndex.cpp
Go to the documentation of this file.
1 // Examples
2 #include "DataAccessExamples.h"
3 
4 te::da::Index* AddSpatialIndex(const std::string& datasetname,
6 {
7  te::da::Index* spidx = new te::da::Index("our_country_spatial_data_spidx", te::da::R_TREE_TYPE);
8 
9  //std::unique_ptr<te::dt::Property> sp = transactor->getProperty(datasetname,"spatial_data");
10  //spidx->add(sp.get());
11 
12  spidx->add((transactor->getProperty(datasetname,"spatial_data")).release());
13  std::map<std::string, std::string> opt;
14 
15  transactor->addIndex(datasetname,spidx,opt);
16 
17  return spidx;
18 }
19 
virtual std::unique_ptr< te::dt::Property > getProperty(const std::string &datasetName, const std::string &name)=0
It retrieves the property with the given name from the dataset.
te::da::Index * AddSpatialIndex(const std::string &datasetname, te::da::DataSourceTransactor *transactor)
void add(te::dt::Property *p)
It adds the property to the list of properties of the index.
virtual void addIndex(const std::string &datasetName, Index *idx, const std::map< std::string, std::string > &options)=0
It adds an index to the dataset.
Examples on how to access/manipulate DataSources in TerraLib.
A DataSourceTransactor can be viewed as a connection to the data source for reading/writing things in...
It describes an index associated to a DataSetType.