Skip to content
Snippets Groups Projects
Commit b13091c9 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH: add dataNode methods using directly the OGR api -> need to use the OGRAdapters (wip)

parent 220d6e01
No related branches found
No related tags found
No related merge requests found
......@@ -266,6 +266,17 @@ public:
double EuclideanDistance(const DataNode* node);
double EuclideanDistance(const PointType point);
/**
* \return true if the two datanodes intersects
*/
bool Intersects(const DataNode* node);
/**
* \return true if the two datanodes intersects
*/
bool Within(const DataNode* node);
/**
* Clear all fields.
*/
......
......@@ -636,6 +636,32 @@ DataNode<TPrecision, VDimension, TValuePrecision>
return currentGeometry->Distance(&ogrPointSrc);
}
template <class TPrecision, unsigned int VDimension, class TValuePrecision>
bool
DataNode<TPrecision, VDimension, TValuePrecision>
::Intersects(const DataNode* node)
{
// Convert the nodes to OGRGeometries
OGRGeometry * dstGeomtery = this->ConvertDataNodeToOGRGeometry(node);
OGRGeometry * currentGeometry = this->ConvertDataNodeToOGRGeometry(this);
//
return currentGeometry->Intersects(dstGeomtery);
}
template <class TPrecision, unsigned int VDimension, class TValuePrecision>
bool
DataNode<TPrecision, VDimension, TValuePrecision>
::Within(const DataNode* node)
{
// Convert the nodes to OGRGeometries
OGRGeometry * dstGeomtery = this->ConvertDataNodeToOGRGeometry(node);
OGRGeometry * currentGeometry = this->ConvertDataNodeToOGRGeometry(this);
//
return currentGeometry->Within(dstGeomtery);
}
} // end namespace otb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment