Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
5e7eec38
Commit
5e7eec38
authored
Nov 25, 2014
by
Julien Malik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
COMP: missing file added
parent
044198c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
Code/Common/otbMapnikAdapter.h
Code/Common/otbMapnikAdapter.h
+85
-0
No files found.
Code/Common/otbMapnikAdapter.h
0 → 100644
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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment