IDatamanager.hpp
42 huge geometry data sets with fast spatial access. For efficiency reasons points and other geometry
43 objects (lines, polygons, etc.) are managed by different spatial indices. The interface gives access
47 When create a datamanger instance, the datamanager uses a set of standard parameter which are appropriate
48 for most data sets. However, it is possible to change these values using a ParameterSets object. The following
64 /// \param[in] openIfExists if true the existing ODM is opened, otherwise a new ODM file is created (which overrides a possible exisitng ODM file)
65 /// \param[in] readOnly if true the ODM is opened in read only mode, which never stores any modification made to the ODM object in memory
66 /// \param[in] threadSafety if true a thread safe instance of the ODM is created. Otherwise a standard instance is created which may provide a bit better performance
67 static IDatamanager* New(const char *filename, bool openIfExists = true, bool readOnly = false, bool threadSafety = true);
68 static IDatamanager* New(const char *filename, const IParameterSet &, bool openIfExists = true, bool readOnly = false, bool threadSafety = true);
71 /** Don't use this function outside OPALS, since it requires a pointer to an OPALS module instance as a first parameter
73 static IDatamanager* New(void *instance, const char *filename, bool openIfExists = true, bool readOnly = false, bool threadSafety = true);
74 static IDatamanager* New(void *instance, const char *filename, const IParameterSet &, bool openIfExists = true, bool readOnly = false, bool threadSafety = true);
78 /// \param[in] readOnly if true the ODM is opened in read only mode, which never stores any modification made to the ODM object in memory
79 /// \param[in] threadSafety if true a thread safe instance of the ODM is created. Otherwise a standard instance is created which may provide a bit better performance
80 static IDatamanager* load(const char *filename, bool readOnly = false, bool threadSafety = true);
83 /// \param[in] threadSafety if true a thread safe instance of the ODM is created. Otherwise a standard instance is created which may provide a bit better performance
107 // Iterator typedefs ============================================================================
113 typedef InsertIterator<IGeometry> insert_iterator_geometry; ///< Geometry insert iterator (used in searchGeometry function)
114 typedef InsertIterator<IPoint> insert_iterator_point; ///< Point insert iterator (used in searchPoint functions)
115 typedef InsertIterator<IPolyline> insert_iterator_line; ///< Polyline insert iterator (used in searchPolyline functions)
122 // General memeber functions ====================================================================
145 /// \param[in] alphaRadius in 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)
146 /// The approximative boundaries are computed on the fly, whereas the exact outlines needed to be computed using opalsBounds
147 virtual PolygonHandle getBoundary(BoundaryOption::Type type, double alphaRadius = 0.) const = 0;
154 // Overview matrix function =====================================================================
156 virtual UnsignedRasterHandle getDensityOverview(double &xLowerLeftCellCenter, double &yLowerLeftCellCenter, double &cellSize) = 0;
157 virtual DoubleRasterHandle getZMatrixOverview(double &xLowerLeftCellCenter, double &yLowerLeftCellCenter, double &cellSize, const double &nullValue = 0) = 0;
158 /*virtual void getDensityMatrix(const GdxLimit2d &limit, unsigned int rows, unsigned int cols, int *mat) const=0;
159 virtual void getPointPolylinesMatrix(const GdxLimit2d &limit, unsigned int rows, unsigned int cols, int *mat) const=0;
160 virtual void getFileMatrix(const GdxLimit2d &limit, unsigned int rows, unsigned int cols, int *mat) const=0;
163 // IO functions =================================================================================
166 // Import / Export functions ====================================================================
167 virtual bool doImport( IImport &impObj, DM::ControlObjectHandle control = ControlObjectHandle() ) = 0;
168 virtual bool doExport( IExport &expObj, bool restoreOrder = false, DM::ControlObjectHandle control = ControlObjectHandle() ) = 0;
169 virtual bool doExport( IExport &expObj, BoxHandle box, DM::ControlObjectHandle control = ControlObjectHandle() ) = 0;
172 // Iterator function ============================================================================
173 virtual const_iterator_geometry beginGeometry(E_IteratorOrder order = eORDER_INTERNAL) const = 0;
187 // Spatial access functions =====================================================================
188 virtual void searchGeometry(const IWindow &win, insert_iterator_geometry &instIt, bool includeRightBoundary = true) = 0;
189 virtual void searchGeometry(const IBox &box, insert_iterator_geometry &instIt, bool includeRightBoundary = true) = 0;
192 virtual void searchPoint(const IWindow &win, insert_iterator_point &instIt, bool includeRightBoundary = true) = 0;
193 virtual void searchPoint(const IBox &box, insert_iterator_point &instIt, bool includeRightBoundary = true) = 0;
196 virtual void searchPolyline (const IWindow &win, insert_iterator_line &instIt, bool includeRightBoundary = true) = 0;
197 virtual void searchPolyline (const IBox &box, insert_iterator_line &instIt, bool includeRightBoundary = true) = 0;
200 // Edit function ================================================================================
201 /// adds point to the datamanager (secure that addinfo of the point is NOT linked to another datamanager or
206 /// \param[in] fileId the point is inserted into the given file (it is assumed that the given file exists) or
208 /// \param[in] layerId the point is inserted into the given layer of the given file (layer and file entry must exist) or
211 virtual int64_t addPoint(const IPoint &p, bool cloneAddInfo = true, int fileId = -1, int layerId = -1 ) = 0;
215 /// \param[in] attributeOnly flag if complete point should be replace (i.e. coordinates have changed) or only the attribute object is updated
223 /// adds a polyline to the datamanager (secure that addinfo of the polyline is NOT linked to another datamanager or
228 /// \param[in] fileId the point is inserted into the given file (it is assumed that the given file exists) or
230 /// \param[in] layerId the point is inserted into the given layer of the given file (layer and file entry must exist) or
233 virtual int64_t addPolyline(const IPolyline &l, bool cloneAddInfo = true, int fileId = -1, int layerId = -1 ) = 0;
237 /// \param[in] attributeOnly flag if complete line should be replace (i.e. coordinates have changed) or only the attribute objects is updated
247 /// adds a polygon to the datamanager (secure that addinfo of the polygon is NOT linked to another datamanager or
252 /// \param[in] fileId the point is inserted into the given file (it is assumed that the given file exists) or
254 /// \param[in] layerId the point is inserted into the given layer of the given file (layer and file entry must exist) or
257 virtual int64_t addPolygon(const IPolygon &p, bool cloneAddInfo = true, int fileId = -1, int layerId = -1 ) = 0;
261 /// \param[in] attributeOnly flag if complete polygon should be replace (i.e. coordinates have changed) or only the attribute objects is updated
304 virtual HistogramSetHandle getHistogramSet(const IAddInfoLayout &layout, int maxDistinctValues = 1000, FilterHandle filter = FilterHandle()) = 0;
