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
7a0c16a0
Commit
7a0c16a0
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add overlay option (change background behaviour)
parent
5a21f385
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbVectorDataToImageFilter.h
+12
-0
12 additions, 0 deletions
Code/Common/otbVectorDataToImageFilter.h
Code/Common/otbVectorDataToImageFilter.txx
+11
-4
11 additions, 4 deletions
Code/Common/otbVectorDataToImageFilter.txx
with
23 additions
and
4 deletions
Code/Common/otbVectorDataToImageFilter.h
+
12
−
0
View file @
7a0c16a0
...
...
@@ -129,6 +129,13 @@ template <class TVectorData, class TImage>
m_StyleList
.
clear
();
}
/** Specify if the output image is to be uses as an overlar
* (with transparent background) or not (with blue background).
*/
itkSetMacro
(
UseAsOverlay
,
bool
);
itkGetMacro
(
UseAsOverlay
,
bool
);
itkBooleanMacro
(
UseAsOverlay
)
protected
:
/** Constructor */
VectorDataToImageFilter
();
...
...
@@ -169,9 +176,14 @@ template <class TVectorData, class TImage>
//style list
std
::
vector
<
std
::
string
>
m_StyleList
;
//Overlay option: change the backgroup (blue or transparent)
bool
m_UseAsOverlay
;
//Projection in the proj.4 format (for mapnik)
std
::
string
m_VectorDataProjectionProj4
;
};
// end class
}
// end namespace otb
...
...
This diff is collapsed.
Click to expand it.
Code/Common/otbVectorDataToImageFilter.txx
+
11
−
4
View file @
7a0c16a0
...
...
@@ -47,7 +47,8 @@ namespace otb
template <class TVectorData, class TImage>
VectorDataToImageFilter<TVectorData, TImage>
::VectorDataToImageFilter() :
m_StyleList()
m_StyleList(),
m_UseAsOverlay(true)
{
this->SetNumberOfRequiredInputs( 1 );
m_Spacing.Fill(1.0);
...
...
@@ -214,9 +215,15 @@ namespace otb
mapnik::freetype_engine::register_font("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
//Set the default backgroup to transparent
m_Map.set_background(mapnik::color(255,255,255,0));
if(m_UseAsOverlay)
{
//Set the default backgroup to transparent
m_Map.set_background(mapnik::color(255,255,255,0));
}
else
{
m_Map.set_background(mapnik::color("#b5d0d0"));
}
//Load the OSM styles using helper class
otb::VectorDataStyle::Pointer styleLoader = otb::VectorDataStyle::New();
styleLoader->SetScaleFactor(m_ScaleFactor);
...
...
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