IDatamanager Class Referenceabstract

Interface to an Datamanager (ODM) object. More...

#include "IDatamanager.hpp"

+ Inheritance diagram for IDatamanager:

Public Types

typedef ConstIterator< IGeometryconst_iterator_geometry
 Geometry iterator.
 
typedef ConstIterator< IPointconst_iterator_point
 Point iterator.
 
typedef ConstIterator< IPolylineconst_iterator_line
 Polyline iterator.
 
typedef ConstIterator< IFileconst_iterator_file
 File iterator.
 
typedef InsertIterator< IGeometryinsert_iterator_geometry
 Geometry insert iterator (used in searchGeometry function)
 
typedef InsertIterator< IPointinsert_iterator_point
 Point insert iterator (used in searchPoint functions)
 
typedef InsertIterator< IPolylineinsert_iterator_line
 Polyline insert iterator (used in searchPolyline functions)
 

Public Member Functions

virtual BoxHandle getLimit () const =0
 
virtual int64_t sizeGeometry () const =0
 
virtual int64_t sizePoint () const =0
 
virtual int64_t sizePolyline () const =0
 
virtual int64_t sizePolylinePoint () const =0
 
virtual int64_t sizePolygon () const =0
 
virtual int64_t sizePolygonPoint () const =0
 
virtual DatamanagerHeaderHandle getHeader () const =0
 
virtual bool storesOrder () const =0
 
virtual bool threadSafe () const =0
 
virtual int indexDim () const =0
 
virtual bool readOnly () const =0
 
virtual PointIndexHandle getPointIndex ()=0
 
virtual PolylineIndexHandle getPolylineIndex ()=0
 
virtual PolygonHandle getBoundary (BoundaryOption type, double alphaRadius=0.) const =0
 
virtual bool getBoundaryFlag (BoundaryOption type) const =0
 
virtual GeometryHandle getGeometry (int64_t id) const =0
 access object by its id
 
virtual UnsignedRasterHandle getDensityOverview (double &xLowerLeftCellCenter, double &yLowerLeftCellCenter, double &cellSize)=0
 Get a matrix of point counts in native resolution.
 
virtual DoubleRasterHandle getZMatrixOverview (double &xLowerLeftCellCenter, double &yLowerLeftCellCenter, double &cellSize, const double &nullValue=0)=0
 
virtual void save ()=0
 
virtual ImportError doImport (IImport &impObj, DM::ControlObjectHandle control=ControlObjectHandle(), bool preserveFileIdOrder=false)=0
 import from import object More...
 
virtual ExportError doExport (IExport &expObj, bool restoreOrder=false, DM::ControlObjectHandle control=ControlObjectHandle())=0
 
virtual ExportError doExport (IExport &expObj, BoxHandle box, DM::ControlObjectHandle control=ControlObjectHandle())=0
 
virtual ExportError doExport (IExport &expObj, bool ascending, DM::AddInfoLayoutHandle &layout, DM::ControlObjectHandle control=ControlObjectHandle())=0
 
virtual const_iterator_geometry beginGeometry (IteratorOrder order=IteratorOrder::internal) const =0
 
virtual const_iterator_geometry endGeometry (IteratorOrder order=IteratorOrder::internal) const =0
 
virtual const_iterator_point beginPoint (IteratorOrder order=IteratorOrder::internal) const =0
 
virtual const_iterator_point endPoint (IteratorOrder order=IteratorOrder::internal) const =0
 
virtual const_iterator_line beginPolyline (IteratorOrder order=IteratorOrder::internal) const =0
 
virtual const_iterator_line endPolyline (IteratorOrder order=IteratorOrder::internal) const =0
 
virtual const_iterator_file beginFile () const =0
 
virtual const_iterator_file endFile () const =0
 
virtual PointIndexLeafHandle getPointIndexLeaf (const_iterator_geometry &it)=0
 
virtual void searchGeometry (const IWindow &win, insert_iterator_geometry &instIt, bool includeRightBoundary=true)=0
 
virtual void searchGeometry (const IBox &box, insert_iterator_geometry &instIt, bool includeRightBoundary=true)=0
 
virtual void searchGeometry (const IPolygon &p, insert_iterator_geometry &instIt)=0
 
virtual void searchPoint (const IWindow &win, insert_iterator_point &instIt, bool includeRightBoundary=true, DM::ControlObjectHandle control=ControlObjectHandle())=0
 
virtual void searchPoint (const IBox &box, insert_iterator_point &instIt, bool includeRightBoundary=true, DM::ControlObjectHandle control=ControlObjectHandle())=0
 
virtual void searchPoint (const IPolygon &p, insert_iterator_point &instIt)=0
 
virtual void searchPolyline (const IWindow &win, insert_iterator_line &instIt, bool includeRightBoundary=true)=0
 
virtual void searchPolyline (const IBox &box, insert_iterator_line &instIt, bool includeRightBoundary=true)=0
 
virtual void searchPolyline (const IPolygon &p, insert_iterator_line &instIt)=0
 
virtual int64_t addPoint (const IPoint &p, bool cloneAddInfo=true, int fileId=-1, int layerId=-1)=0
 
virtual void replacePoint (const IPoint &p, bool attributeOnly=false)=0
 
virtual void deletePoint (int64_t id)=0
 
virtual int64_t addPolyline (const IPolyline &l, bool cloneAddInfo=true, int fileId=-1, int layerId=-1)=0
 
virtual void replacePolyline (const IPolyline &l, bool attributeOnly=false)=0
 
virtual void deletePolyline (int64_t id)=0
 
virtual int64_t addPolygon (const IPolygon &p, bool cloneAddInfo=true, int fileId=-1, int layerId=-1)=0
 
virtual void replacePolygon (const IPolygon &p, bool attributeOnly=false)=0
 
virtual void deletePolygon (int64_t id)=0
 
virtual AddInfoStatisticsHandle getAddInfoStatistics () const =0
 get the statistics of all addinfo objects
 
virtual const char * getFilename () const =0
 get filename of manager;
 
virtual void outputDiskmanagerStatistics () const =0
 output statistics parameter how the data are actually stored on disk
 
virtual void freeMemory () const =0
 drop all freeable memory object
 
virtual void interrupt (bool inter=true)=0
 mark the odm that processing should be interrupted
 
virtual bool isInterrupted () const =0
 check if the interrupt flag was set
 
virtual bool isManagerCorrupt () const =0
 
virtual HistogramSetHandle getHistogramSet (const IAddInfoLayout &layout, int maxDistinctValues=1000, FilterHandle filter=FilterHandle())=0
 get histograms of all attributes described by the layout
 
virtual const char * getCRS () const =0
 get the coordinate reference system as a WKT string
 
virtual void setCRS (const char *crs)=0
 set the coordinate reference system from a WKT string
 
virtual void prepareLayout (const IAddInfoLayout &layout, bool readOnly) const =0
 
virtual void prepareLayout (const ICalculator &calc) const =0
 
- Public Member Functions inherited from ObjectBase
virtual void Delete ()
 

Static Public Member Functions

static IDatamanagerNew (const char *filename, bool openIfExists=true, bool readOnly=false, bool threadSafety=true)
 
static IDatamanagerNew (const char *filename, const IParameterSet &, bool openIfExists=true, bool readOnly=false, bool threadSafety=true)
 
static IDatamanagerNew (void *instance, const char *filename, bool openIfExists=true, bool readOnly=false, bool threadSafety=true)
 Create a new datamanager instance from an existing ODM file or by creating an ODM file. More...
 
static IDatamanagerNew (void *instance, const char *filename, const IParameterSet &, bool openIfExists=true, bool readOnly=false, bool threadSafety=true)
 
static IDatamanagerload (const char *filename, bool readOnly=false, bool threadSafety=true)
 
static IDatamanagercreate (const char *filename, bool threadSafety=true)
 
static bool existsODM (const char *filename)
 
static bool isValidODM (const char *filename)
 
static bool isValidODM (const char *filename, TextHandle &errorMsg)
 
static DatamanagerHeaderHandle getHeaderODM (const char *filename)
 get the full header information of an odm, without actually openning the odm (much faster)
 
static BoxHandle getLimitODM (const char *filename)
 get the limits of an odm, without actually openning the odm (internally uses getHeaderODM)
 
static OverviewHandle getOverviewODM (const char *filename)
 get the overview object of an odm, without actually openning the odm
 
static void SetPointInMemoryLimit (unsigned limit)
 

Detailed Description

Interface to an Datamanager (ODM) object.

Datamanager objects are the central objects that can be managed by the DMlib. It allows managing huge geometry data sets with fast spatial access. For efficiency reasons points and other geometry objects (lines, polygons, etc.) are managed by different spatial indices. The interface gives access to the point index (see getPointIndex) and the other spatial index (see getPolylineIndex stores line and polygon data) separately or via the datamanager interface itself in a wrapped manner.

When create a datamanger instance, the datamanager uses a set of standard parameter which are appropriate for most data sets. However, it is possible to change these values using a ParameterSets object. The following parameters are supported:

Name type default Comment
StoreOrder bool false Flag if the order should be stored
PointsInMemory int 8*200000 Number of points that are kept in memory
AverageTilePointCount int 200000 Average point count per tile
TileSize double auto Tile size for tiling mode

Member Function Documentation

◆ addPoint()

virtual int64_t addPoint ( const IPoint p,
bool  cloneAddInfo = true,
int  fileId = -1,
int  layerId = -1 
)
pure virtual

adds point to the datamanager (secure that addinfo of the point is NOT linked to another datamanager or set the cloneAddInfo flag)

Parameters
[in]ppoint object
[in]cloneAddInfoflag if the addinfo object should be cloned, before adapting file and layer id in addinfo object
[in]fileIdthe point is inserted into the given file (it is assumed that the given file exists) or to the default file in case of -1
[in]layerIdthe point is inserted into the given layer of the given file (layer and file entry must exist) or to the default layer in case of -1
Returns
point id

◆ addPolygon()

virtual int64_t addPolygon ( const IPolygon p,
bool  cloneAddInfo = true,
int  fileId = -1,
int  layerId = -1 
)
pure virtual

adds a polygon to the datamanager (secure that addinfo of the polygon is NOT linked to another datamanager or set the cloneAddInfo flag)

Parameters
[in]ppolygon object
[in]cloneAddInfoflag if the addinfo object should be cloned, before adapting file and layer id in addinfo object
[in]fileIdthe point is inserted into the given file (it is assumed that the given file exists) or to the default file in case of -1
[in]layerIdthe point is inserted into the given layer of the given file (layer and file entry must exist) or to the default layer in case of -1
Returns
polyline id

◆ addPolyline()

virtual int64_t addPolyline ( const IPolyline l,
bool  cloneAddInfo = true,
int  fileId = -1,
int  layerId = -1 
)
pure virtual

adds a polyline to the datamanager (secure that addinfo of the polyline is NOT linked to another datamanager or set the cloneAddInfo flag)

Parameters
[in]lpolyline object
[in]cloneAddInfoflag if the addinfo object should be cloned, before adapting file and layer id in addinfo object
[in]fileIdthe point is inserted into the given file (it is assumed that the given file exists) or to the default file in case of -1
[in]layerIdthe point is inserted into the given layer of the given file (layer and file entry must exist) or to the default layer in case of -1
Returns
polyline id

◆ create()

static IDatamanager* create ( const char *  filename,
bool  threadSafety = true 
)
static

Create a new datamanager file (Convenient wrapper for IDatamanager::New)

Parameters
[in]filenameodm filename (incl. extension)
[in]threadSafetyif true a thread safe instance of the ODM is created. Otherwise a standard instance is created which may provide a bit better performance
Examples
DM_get_by_id.cpp.

◆ deletePoint()

virtual void deletePoint ( int64_t  id)
pure virtual

remove a point from from the datamanager by its id

Parameters
[in]idpoint id

◆ deletePolygon()

virtual void deletePolygon ( int64_t  id)
pure virtual

remove a polygon object from from the datamanager by its id

Parameters
[in]idpolygon id

◆ deletePolyline()

virtual void deletePolyline ( int64_t  id)
pure virtual

remove a polyline object from from the datamanager by its id

Parameters
[in]idpolyline id

◆ doImport()

virtual ImportError doImport ( IImport impObj,
DM::ControlObjectHandle  control = ControlObjectHandle(),
bool  preserveFileIdOrder = false 
)
pure virtual

import from import object

Parameters
[in]impObjimport object
[in]controlcontrol object for handling progress
[in]preserveFileIdOrderin case of odm import object, this variable allows preserving the order of the file ids of the import odm. if false, the file ids will be assigned by import occurrence. do not use import filter in conjunction with the flag being set to true.

◆ existsODM()

static bool existsODM ( const char *  filename)
static

checks if the odm file exists

Parameters
[in]filenamevalid names are <name>.odm, <name>.odm.dat and <name>.odm.idx
Returns
true if odm files exists, otherwise false

◆ getBoundary()

virtual PolygonHandle getBoundary ( BoundaryOption  type,
double  alphaRadius = 0. 
) const
pure virtual

Get the boundary polygon of the data set

Parameters
[in]typetype of boundary output polygon (
See also
BoundaryOption::Type)
Parameters
[in]alphaRadiusin case of alpha shapes a radius can be specified (if radius is zero, the smalles possible radius is select to result as sinlge part alpha shape) The approximative boundaries are computed on the fly, whereas the exact outlines needed to be computed using opalsBounds

◆ isValidODM()

static bool isValidODM ( const char *  filename)
static

checks if the specified file is a valid odm file (requires read access)

Parameters
[in]filenamevalid names are <name>.odm, <name>.odm.dat and <name>.odm.idx
Returns
true if valid odm file. otherwise false

◆ load()

static IDatamanager* load ( const char *  filename,
bool  readOnly = false,
bool  threadSafety = true 
)
static

Load an existing datamanager file (Convenient wrapper for IDatamanager::New)

Parameters
[in]filenameodm filename (incl. extension)
[in]readOnlyif true the ODM is opened in read only mode, which never stores any modification made to the ODM object in memory
[in]threadSafetyif true a thread safe instance of the ODM is created. Otherwise a standard instance is created which may provide a bit better performance
Examples
demoSegmentation.cpp, DM_attribute_handling.cpp, DM_attributes_statistic.cpp, DM_iterate_simple.cpp, and DM_spatial_processing.cpp.

◆ New() [1/2]

static IDatamanager* New ( const char *  filename,
bool  openIfExists = true,
bool  readOnly = false,
bool  threadSafety = true 
)
static

Create a new datamanager instance from an existing ODM file or by creating an ODM file

Parameters
[in]filenameodm filename (incl. extension)
[in]openIfExistsif true the existing ODM is opened, otherwise a new ODM file is created (which overrides a possible exisitng ODM file)
[in]readOnlyif true the ODM is opened in read only mode, which never stores any modification made to the ODM object in memory
[in]threadSafetyif true a thread safe instance of the ODM is created. Otherwise a standard instance is created which may provide a bit better performance

◆ New() [2/2]

static IDatamanager* New ( void *  instance,
const char *  filename,
bool  openIfExists = true,
bool  readOnly = false,
bool  threadSafety = true 
)
static

Create a new datamanager instance from an existing ODM file or by creating an ODM file.

Don't use this function outside OPALS, since it requires a pointer to an OPALS module instance as a first parameter

◆ replacePoint()

virtual void replacePoint ( const IPoint p,
bool  attributeOnly = false 
)
pure virtual

replace an existing point within the datamanager (the point is identified by its id)

Parameters
[in]ppoint object
[in]attributeOnlyflag if complete point should be replace (i.e. coordinates have changed) or only the attribute object is updated

◆ replacePolygon()

virtual void replacePolygon ( const IPolygon p,
bool  attributeOnly = false 
)
pure virtual

replace an existing polygon within the datamanager (the object is identified by its id)

Parameters
[in]ppolygon object
[in]attributeOnlyflag if complete polygon should be replace (i.e. coordinates have changed) or only the attribute objects is updated

◆ replacePolyline()

virtual void replacePolyline ( const IPolyline l,
bool  attributeOnly = false 
)
pure virtual

replace an existing polyline within the datamanager (the object is identified by its id)

Parameters
[in]lpolyline object
[in]attributeOnlyflag if complete line should be replace (i.e. coordinates have changed) or only the attribute objects is updated