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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
David Youssefi
otb
Commits
a5f6f89f
Commit
a5f6f89f
authored
12 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Ensure that the SRS is the same
parent
561e195e
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/otbPersistentImageToOGRLayerFilter.txx
+18
-3
18 additions, 3 deletions
Code/Common/otbPersistentImageToOGRLayerFilter.txx
Testing/Code/Segmentation/otbStreamingImageToOGRLayerSegmentationFilter.cxx
+2
-2
2 additions, 2 deletions
...ntation/otbStreamingImageToOGRLayerSegmentationFilter.cxx
with
20 additions
and
5 deletions
Code/Common/otbPersistentImageToOGRLayerFilter.txx
+
18
−
3
View file @
a5f6f89f
...
...
@@ -87,8 +87,16 @@ template<class TImage>
void
PersistentImageToOGRLayerFilter<TImage>
::Initialize()
{}
{
// Ensure that spatial reference of the output layer matches with
// the spatial reference of the input image
OGRSpatialReference oSRS(this->GetInput()->GetProjectionRef().c_str());
if(!oSRS.IsSame(m_OGRLayer.GetSpatialRef()))
{
itkExceptionMacro(<<"Spatial reference of input image and target layer do not match!");
}
}
template<class TImage>
void
...
...
@@ -108,7 +116,14 @@ PersistentImageToOGRLayerFilter<TImage>
// call the processing function for this tile
OGRDataSourcePointerType currentTileVD = this->ProcessTile();
OGRLayerType srcLayer = currentTileVD->GetLayerChecked(0);
// Check spatial reference matches
if(!srcLayer.GetSpatialRef()->IsSame(m_OGRLayer.GetSpatialRef()))
{
itkExceptionMacro(<<"Spatial reference of internal and target layers do not match!");
}
//Copy features contained in the memory layer (srcLayer) in the output layer
itk::TimeProbe chrono;
chrono.Start();
...
...
This diff is collapsed.
Click to expand it.
Testing/Code/Segmentation/otbStreamingImageToOGRLayerSegmentationFilter.cxx
+
2
−
2
View file @
a5f6f89f
...
...
@@ -100,10 +100,10 @@ int otbStreamingImageToOGRLayerSegmentationFilter(int argc, char * argv[])
// TODO: Change once flags have been updated
otb
::
ogr
::
DataSource
::
Pointer
ogrDS
=
otb
::
ogr
::
DataSource
::
New
(
dataSourceName
,
otb
::
ogr
::
DataSource
::
Modes
::
write
);
OGRSpatialReference
*
oSRS
=
static_cast
<
OGRSpatialReference
*>
(
OSRNewSpatialReference
(
reader
->
GetOutput
()
->
GetProjectionRef
().
c_str
())
)
;
OGRSpatialReference
oSRS
(
reader
->
GetOutput
()
->
GetProjectionRef
().
c_str
());
// Create the layer
otb
::
ogr
::
Layer
oLayer
=
ogrDS
->
CreateLayer
(
layerName
,
oSRS
,
wkbMultiPolygon
,
NULL
);
otb
::
ogr
::
Layer
oLayer
=
ogrDS
->
CreateLayer
(
layerName
,
&
oSRS
,
wkbMultiPolygon
,
NULL
);
// Create the field
OGRFieldDefn
field
(
fieldName
.
c_str
(),
OFTInteger
);
...
...
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