Commit 5dbce8ac authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: VectorDataExtractROI should copy metadata

parent c1a34561
......@@ -99,6 +99,8 @@ VectorDataExtractROI<TVectorData>
DataNodePointerType newDataNode = DataNodeType::New();
newDataNode->SetNodeType(inputRoot->Get()->GetNodeType());
newDataNode->SetNodeId(inputRoot->Get()->GetNodeId());
typename InternalTreeNodeType::Pointer outputRoot = InternalTreeNodeType::New();
outputRoot->Set(newDataNode);
tree->SetRoot(outputRoot);
......@@ -124,118 +126,119 @@ VectorDataExtractROI<TVectorData>
ChildrenListType children = source->GetChildrenList();
// For each child
for(typename ChildrenListType::iterator it = children.begin(); it!=children.end();++it)
{
{
typename InternalTreeNodeType::Pointer newContainer;
DataNodePointerType dataNode = (*it)->Get();
DataNodePointerType newDataNode = DataNodeType::New();
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetMetaDataDictionary(dataNode->GetMetaDataDictionary());
switch(dataNode->GetNodeType())
{
case ROOT:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
ProcessNode((*it),newContainer);
++m_Kept;
break;
}
case DOCUMENT:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FOLDER:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_POINT:
{
if(m_GeoROI.IsInside(this->PointToContinuousIndex(dataNode->GetPoint())))
case ROOT:
{
newDataNode->SetPoint(dataNode->GetPoint());
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
ProcessNode((*it),newContainer);
++m_Kept;
break;
}
break;
}
case FEATURE_LINE:
{
if(this->IsLineIntersectionNotNull(dataNode->GetLine()))
case DOCUMENT:
{
newDataNode->SetLine(dataNode->GetLine());
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
break;
}
case FEATURE_POLYGON:
{
if(this->IsPolygonIntersectionNotNull(dataNode->GetPolygonExteriorRing()))
case FOLDER:
{
newDataNode->SetPolygonExteriorRing(dataNode->GetPolygonExteriorRing());
newDataNode->SetPolygonInteriorRings(dataNode->GetPolygonInteriorRings());
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_POINT:
{
if(m_GeoROI.IsInside(this->PointToContinuousIndex(dataNode->GetPoint())))
{
newDataNode->SetPoint(dataNode->GetPoint());
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
}
break;
}
case FEATURE_LINE:
{
if(this->IsLineIntersectionNotNull(dataNode->GetLine()))
{
newDataNode->SetLine(dataNode->GetLine());
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
}
break;
}
case FEATURE_POLYGON:
{
if(this->IsPolygonIntersectionNotNull(dataNode->GetPolygonExteriorRing()))
{
newDataNode->SetPolygonExteriorRing(dataNode->GetPolygonExteriorRing());
newDataNode->SetPolygonInteriorRings(dataNode->GetPolygonInteriorRings());
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
}
break;
}
case FEATURE_MULTIPOINT:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_MULTILINE:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_MULTIPOLYGON:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_COLLECTION:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
break;
}
case FEATURE_MULTIPOINT:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_MULTILINE:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_MULTIPOLYGON:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
case FEATURE_COLLECTION:
{
newContainer = InternalTreeNodeType::New();
newContainer->Set(newDataNode);
destination->AddChild(newContainer);
++m_Kept;
ProcessNode((*it),newContainer);
break;
}
}
}
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment