Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Belvire
otb
Commits
1cf4a483
Commit
1cf4a483
authored
16 years ago
by
Otmane Lahlou
Browse files
Options
Downloads
Patches
Plain Diff
ENH: VectorDataExtractROI Test parameters
parent
d36f2a8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbVectorDataExtractROI.txx
+27
-13
27 additions, 13 deletions
Code/Common/otbVectorDataExtractROI.txx
Testing/Code/Common/CMakeLists.txt
+2
-1
2 additions, 1 deletion
Testing/Code/Common/CMakeLists.txt
with
29 additions
and
14 deletions
Code/Common/otbVectorDataExtractROI.txx
+
27
−
13
View file @
1cf4a483
...
@@ -64,7 +64,10 @@ VectorDataExtractROI<TVectorData>
...
@@ -64,7 +64,10 @@ VectorDataExtractROI<TVectorData>
typename VectorDataType::Pointer output = this->GetOutput();
typename VectorDataType::Pointer output = this->GetOutput();
/** put this here*/
/** put this here*/
output->SetProjectionRef(input->GetProjectionRef());
if(!input->GetProjectionRef().empty())
output->SetProjectionRef(input->GetProjectionRef());
else
if(!input)
if(!input)
return;
return;
...
@@ -93,7 +96,9 @@ VectorDataExtractROI<TVectorData>
...
@@ -93,7 +96,9 @@ VectorDataExtractROI<TVectorData>
DataNodePointerType newDataNodeFolder = DataNodeType::New();
DataNodePointerType newDataNodeFolder = DataNodeType::New();
DataNodePointerType newDataNodeMultiPolygon = DataNodeType::New();
DataNodePointerType newDataNodeMultiPolygon = DataNodeType::New();
DataNodePointerType newDataNodeMultiLine = DataNodeType::New();
DataNodePointerType newDataNodeMultiLine = DataNodeType::New();
DataNodePointerType newDataNodeMultiFeature = DataNodeType::New();
/** Walking trough the input vector data */
/** Walking trough the input vector data */
typedef itk::PreOrderTreeIterator<DataTreeType> TreeIteratorType;
typedef itk::PreOrderTreeIterator<DataTreeType> TreeIteratorType;
TreeIteratorType it(input->GetDataTree());
TreeIteratorType it(input->GetDataTree());
...
@@ -144,6 +149,12 @@ VectorDataExtractROI<TVectorData>
...
@@ -144,6 +149,12 @@ VectorDataExtractROI<TVectorData>
currentContainer = newDataNodeFolder;
currentContainer = newDataNodeFolder;
newFolder = false;
newFolder = false;
}
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature,currentContainer);
currentContainer = newDataNodeMultiFeature;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetPoint(dataNode->GetPoint());
newDataNode->SetPoint(dataNode->GetPoint());
...
@@ -164,8 +175,8 @@ VectorDataExtractROI<TVectorData>
...
@@ -164,8 +175,8 @@ VectorDataExtractROI<TVectorData>
}
}
if(newMultiFeature)
if(newMultiFeature)
{
{
tree->Add(newDataNodeMulti
Line
,currentContainer);
tree->Add(newDataNodeMulti
Feature
,currentContainer);
currentContainer = newDataNodeMulti
Line
;
currentContainer = newDataNodeMulti
Feature
;
newMultiFeature = false;
newMultiFeature = false;
}
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeType(dataNode->GetNodeType());
...
@@ -185,10 +196,11 @@ VectorDataExtractROI<TVectorData>
...
@@ -185,10 +196,11 @@ VectorDataExtractROI<TVectorData>
currentContainer = newDataNodeFolder;
currentContainer = newDataNodeFolder;
newFolder = false;
newFolder = false;
}
}
if(newMultiFeature)
if(newMultiFeature)
{
{
tree->Add(newDataNodeMulti
Polygon
,currentContainer);
tree->Add(newDataNodeMulti
Feature
,currentContainer);
currentContainer = newDataNodeMulti
Polygon;
currentContainer =
newDataNodeMulti
Feature ;
newMultiFeature = false;
newMultiFeature = false;
}
}
...
@@ -202,23 +214,24 @@ VectorDataExtractROI<TVectorData>
...
@@ -202,23 +214,24 @@ VectorDataExtractROI<TVectorData>
}
}
case FEATURE_MULTIPOINT:
case FEATURE_MULTIPOINT:
{
{
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNodeMultiFeature->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNodeMultiFeature ->SetNodeId(dataNode->GetNodeId());
tree->Add(newDataNode,currentContainer);
newMultiFeature = true;
currentContainer = newDataNode;
break;
break;
}
}
case FEATURE_MULTILINE:
case FEATURE_MULTILINE:
{
{
newDataNodeMulti
Line
->SetNodeType(dataNode->GetNodeType());
newDataNodeMulti
Feature
->SetNodeType(dataNode->GetNodeType());
newDataNodeMulti
Line
->SetNodeId(dataNode->GetNodeId());
newDataNodeMulti
Feature
->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
newMultiFeature = true;
break;
break;
}
}
case FEATURE_MULTIPOLYGON:
case FEATURE_MULTIPOLYGON:
{
{
newDataNodeMulti
Polygon
->SetNodeType(dataNode->GetNodeType());
newDataNodeMulti
Feature
->SetNodeType(dataNode->GetNodeType());
newDataNodeMulti
Polygon
->SetNodeId(dataNode->GetNodeId());
newDataNodeMulti
Feature
->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
newMultiFeature = true;
break;
break;
}
}
...
@@ -316,6 +329,7 @@ VectorDataExtractROI<TVectorData>
...
@@ -316,6 +329,7 @@ VectorDataExtractROI<TVectorData>
/** INVERSE : From long/lat to InputVectorData projection*/
/** INVERSE : From long/lat to InputVectorData projection*/
typedef otb::GenericMapProjection<otb::FORWARD> InverseMapProjectionType;
typedef otb::GenericMapProjection<otb::FORWARD> InverseMapProjectionType;
InverseMapProjectionType::Pointer mapInverseTransform = InverseMapProjectionType::New();
InverseMapProjectionType::Pointer mapInverseTransform = InverseMapProjectionType::New();
if(this->GetInput()->GetProjectionRef().empty())
if(this->GetInput()->GetProjectionRef().empty())
{
{
std::string inputProjectionRef = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
std::string inputProjectionRef = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
...
...
This diff is collapsed.
Click to expand it.
Testing/Code/Common/CMakeLists.txt
+
2
−
1
View file @
1cf4a483
...
@@ -138,7 +138,8 @@ ADD_TEST(coTvVectorDataExtractROI ${COMMON_TESTS2}
...
@@ -138,7 +138,8 @@ ADD_TEST(coTvVectorDataExtractROI ${COMMON_TESTS2}
otbVectorDataExtractROI
otbVectorDataExtractROI
${
INPUTDATA
}
/ToulousePoints-examples.shp
#${LARGEDATA}/TOULOUSE/QuickBird/GIS_FILES/000000128955_01_ORDER_SHAPE.shp
${
INPUTDATA
}
/ToulousePoints-examples.shp
#${LARGEDATA}/TOULOUSE/QuickBird/GIS_FILES/000000128955_01_ORDER_SHAPE.shp
${
TEMP
}
/coVectorDataExtractROIOutput.shp
${
TEMP
}
/coVectorDataExtractROIOutput.shp
1.588 48.2544 1.2222 1.33001
374369.48850211215904 4828951.58612491376698
# Origin of the CartoRegion
1000.25 25000.2
# Size of the Cartoregion
)
)
# ------- otb::MultiChannelExtractROI ------------------------------
# ------- otb::MultiChannelExtractROI ------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment