Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
dce2b949
Commit
dce2b949
authored
Mar 30, 2009
by
Emmanuel Christophe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on style
parent
642575a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
mapnikFromVectorData.cxx
mapnikFromVectorData.cxx
+22
-3
No files found.
mapnikFromVectorData.cxx
View file @
dce2b949
...
...
@@ -18,6 +18,9 @@
#include <mapnik/config_error.hpp>
#include <mapnik/memory_datasource.hpp>
// ./mapnikFromVectorData ~/OTB/trunk/OTB-Data/Input/ToulouseRoad-examples.shp
typedef
otb
::
VectorData
<>
VectorDataType
;
typedef
otb
::
DataNode
<
double
,
2
,
double
>
DataNodeType
;
typedef
DataNodeType
::
Pointer
DataNodePointerType
;
...
...
@@ -160,7 +163,8 @@ int main(int argc, char * argv[])
// 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"
));
// m.set_background(mapnik::color_factory::from_string("cadetblue"));
m
.
set_background
(
mapnik
::
color
(
"#f2efe9"
));
{
mapnik
::
feature_type_style
style
;
mapnik
::
rule_type
rule
;
...
...
@@ -189,7 +193,22 @@ int main(int argc, char * argv[])
style
.
add_rule
(
rule
);
m
.
insert_style
(
"coast-poly"
,
style
);
}
{
mapnik
::
feature_type_style
style
;
mapnik
::
rule_type
rule
;
rule
.
set_max_scale
(
1000000
);
// rule.set_min_scale(500000);
rule
.
append
(
mapnik
::
line_symbolizer
(
mapnik
::
color
(
"#809bc0"
),
8.0
));
style
.
add_rule
(
rule
);
m
.
insert_style
(
"roads"
,
style
);
}
// <Filter>[highway] = 'motorway' or [highway] = 'motorway_link'</Filter>
// <MaxScaleDenominator>1000000</MaxScaleDenominator>
// <MinScaleDenominator>500000</MinScaleDenominator>
// <LineSymbolizer>
// <CssParameter name="stroke">#809bc0</CssParameter>
// <CssParameter name="stroke-width">3</CssParameter>
// </LineSymbolizer>
datasource_ptr
mDatasource
=
datasource_ptr
(
new
mapnik
::
memory_datasource
);
...
...
@@ -209,7 +228,7 @@ int main(int argc, char * argv[])
mapnik
::
Layer
lyr
(
"world"
);
// lyr.set_datasource(mapnik::datasource_cache::instance()->create(p));
lyr
.
set_datasource
(
mDatasource
);
lyr
.
add_style
(
"
c
oas
t-poly
"
);
lyr
.
add_style
(
"
r
oa
d
s"
);
m
.
addLayer
(
lyr
);
...
...
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