Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
7118b955
Commit
7118b955
authored
Mar 27, 2009
by
Emmanuel Christophe
Browse files
in progress
parent
01ba51d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
mapnikFromVectorData.cxx
View file @
7118b955
...
...
@@ -65,7 +65,7 @@
// }
case
otb
::
FEATURE_LINE
:
{
std
::
cout
<<
" ** Inserting new line **"
<<
std
::
endl
;
std
::
cout
<<
std
::
setprecision
(
15
)
<<
" ** Inserting new line **"
<<
std
::
endl
;
typedef
mapnik
::
vertex
<
double
,
2
>
vertex2d
;
typedef
mapnik
::
line_string
<
vertex2d
,
mapnik
::
vertex_vector2
>
line2d
;
typedef
boost
::
shared_ptr
<
line2d
>
line_ptr
;
...
...
@@ -80,7 +80,7 @@
++
itVertex
;
}
std
::
cout
<<
"Num points: "
<<
line
->
num_points
()
<<
std
::
endl
;
typedef
boost
::
shared_ptr
<
mapnik
::
raster
>
raster_ptr
;
...
...
@@ -149,13 +149,14 @@ int main(int argc, char * argv[])
VectorDataFileReaderType
::
Pointer
reader
=
VectorDataFileReaderType
::
New
();
reader
->
SetFileName
(
argv
[
1
]);
reader
->
Update
();
//
reader->Update();
typedef
otb
::
VectorDataProjectionFilter
<
VectorDataType
,
VectorDataType
>
ProjectionFilterType
;
ProjectionFilterType
::
Pointer
projection
=
ProjectionFilterType
::
New
();
projection
->
SetInput
(
reader
->
GetOutput
());
projection
->
Update
();
mapnik
::
datasource_cache
::
instance
()
->
register_datasources
(
"/
home/christop/opensource/mapnik/plugins/input/shape
"
);
mapnik
::
datasource_cache
::
instance
()
->
register_datasources
(
"/
usr/lib/mapnik/0.5/input
"
);
mapnik
::
freetype_engine
::
register_font
(
"/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"
);
mapnik
::
Map
m
(
800
,
600
);
m
.
set_background
(
mapnik
::
color_factory
::
from_string
(
"cadetblue"
));
...
...
@@ -187,14 +188,16 @@ int main(int argc, char * argv[])
ProcessNode
(
inputRoot
,
mDatasource
);
std
::
cout
<<
"Datasource size: "
<<
mDatasource
->
size
()
<<
std
::
endl
;
mapnik
::
parameters
p
;
p
[
"type"
]
=
"shape"
;
p
[
"file"
]
=
"world_borders"
;
mapnik
::
Layer
lyr
(
"world"
);
//
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr
.
set_datasource
(
mDatasource
);
lyr
.
set_datasource
(
mapnik
::
datasource_cache
::
instance
()
->
create
(
p
));
//
lyr.set_datasource(mDatasource);
lyr
.
add_style
(
"world"
);
m
.
addLayer
(
lyr
);
...
...
myOwnMapnik.cxx
View file @
7118b955
...
...
@@ -15,7 +15,8 @@
int
main
(
int
argc
,
char
**
argv
)
{
using
namespace
mapnik
;
datasource_cache
::
instance
()
->
register_datasources
(
"/home/christop/opensource/mapnik/plugins/input/shape"
);
mapnik
::
datasource_cache
::
instance
()
->
register_datasources
(
"/usr/lib/mapnik/0.5/input"
);
// datasource_cache::instance()->register_datasources( "/home/christop/opensource/mapnik/plugins/input/shape");
freetype_engine
::
register_font
(
"/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"
);
...
...
@@ -81,8 +82,8 @@ int main ( int argc , char** argv)
p
[
"file"
]
=
"world_borders"
;
Layer
lyr
(
"world"
);
//
lyr.set_datasource(datasource_cache::instance()->create(p));
lyr
.
set_datasource
(
mDatasource
);
lyr
.
set_datasource
(
datasource_cache
::
instance
()
->
create
(
p
));
//
lyr.set_datasource(mDatasource);
lyr
.
add_style
(
"world"
);
m
.
addLayer
(
lyr
);
...
...
Write
Preview
Supports
Markdown
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