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
Julien Cabieces
otb
Commits
5e7eec38
Commit
5e7eec38
authored
10 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
COMP: missing file added
parent
044198c0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Common/otbMapnikAdapter.h
+85
-0
85 additions, 0 deletions
Code/Common/otbMapnikAdapter.h
with
85 additions
and
0 deletions
Code/Common/otbMapnikAdapter.h
0 → 100644
+
85
−
0
View file @
5e7eec38
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include
<mapnik/datasource_cache.hpp>
#include
<mapnik/font_engine_freetype.hpp>
#include
<mapnik/agg_renderer.hpp>
#include
<mapnik/filter_factory.hpp>
#include
<mapnik/color_factory.hpp>
#include
<mapnik/image_util.hpp>
#include
<mapnik/config_error.hpp>
#include
<mapnik/memory_datasource.hpp>
#include
<mapnik/layer.hpp>
#include
<mapnik/map.hpp>
#include
<mapnik/value.hpp>
#ifdef OTB_MAPNIK_COMPATIBILITY_API07
namespace
mapnik
{
typedef
Layer
layer
;
typedef
Image32
image_32
;
}
#endif
namespace
otb
{
namespace
mapnik_otb
{
// this should be removed once mapnik support for version < 2.0 is dropped.
// should be around 01/2013.
#ifdef OTB_MAPNIK_COMPATIBILITY_API07
static
size_t
get_num_layer
(
const
mapnik
::
Map
&
map
)
{
return
map
.
layerCount
();
}
static
unsigned
get_height
(
const
mapnik
::
Map
&
map
)
{
return
map
.
getHeight
();
}
static
unsigned
get_width
(
const
mapnik
::
Map
&
map
)
{
return
map
.
getWidth
();
}
typedef
mapnik
::
Envelope
<
double
>
box2d
;
static
void
zoom_to_box
(
mapnik
::
Map
*
map
,
const
mapnik
::
Envelope
<
double
>&
envelope
)
{
map
->
zoomToBox
(
envelope
);
}
typedef
mapnik
::
geometry2d
geom
;
static
geom
*
create_geom
(
int
geom_type
)
{
geom
*
g
=
0
;
switch
(
geom_type
)
{
case
mapnik
::
Point
:
g
=
new
mapnik
::
point
<
mapnik
::
vertex
<
double
,
2
>
>
;
case
mapnik
::
LineString
:
g
=
new
mapnik
::
line_string
<
mapnik
::
vertex
<
double
,
2
>
,
mapnik
::
vertex_vector2
>
;
case
mapnik
::
Polygon
:
g
=
new
mapnik
::
polygon
<
mapnik
::
vertex
<
double
,
2
>
,
mapnik
::
vertex_vector2
>
;
default:
std
::
cerr
<<
"Please fix otb::mapnik_otb::create_geom for mapnik 0.7"
<<
std
::
endl
;
}
return
g
;
}
#else
static
size_t
get_num_layer
(
const
mapnik
::
Map
&
map
)
{
return
map
.
layer_count
();
}
static
unsigned
get_height
(
const
mapnik
::
Map
&
map
)
{
return
map
.
height
();
}
static
unsigned
get_width
(
const
mapnik
::
Map
&
map
)
{
return
map
.
width
();
}
typedef
mapnik
::
box2d
<
double
>
box2d
;
static
void
zoom_to_box
(
mapnik
::
Map
*
map
,
const
mapnik
::
box2d
<
double
>&
envelope
)
{
map
->
zoom_to_box
(
envelope
);
}
typedef
mapnik
::
vertex
<
double
,
2
>
vertex2d
;
typedef
mapnik
::
geometry
<
vertex2d
>
geom
;
static
geom
*
create_geom
(
mapnik
::
eGeomType
geom_type
)
{
return
new
geom
(
geom_type
);
}
#endif
}
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