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
28d8bc89
Commit
28d8bc89
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
Writing text
parent
dce2b949
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
mapnikFromVectorData.cxx
+18
-0
18 additions, 0 deletions
mapnikFromVectorData.cxx
myOwnMapnik.cxx
+3
-1
3 additions, 1 deletion
myOwnMapnik.cxx
with
21 additions
and
1 deletion
mapnikFromVectorData.cxx
+
18
−
0
View file @
28d8bc89
...
...
@@ -18,6 +18,7 @@
#include
<mapnik/config_error.hpp>
#include
<mapnik/memory_datasource.hpp>
#include
<mapnik/value.hpp>
// ./mapnikFromVectorData ~/OTB/trunk/OTB-Data/Input/ToulouseRoad-examples.shp
...
...
@@ -89,8 +90,21 @@
typedef
boost
::
shared_ptr
<
mapnik
::
raster
>
raster_ptr
;
typedef
mapnik
::
feature
<
mapnik
::
geometry2d
,
raster_ptr
>
Feature
;
typedef
boost
::
shared_ptr
<
Feature
>
feature_ptr
;
// typedef std::map<std::string,mapnik::value> mapType;
// mapType myMap;
// myMap["name"] = mapnik::value("test");
// std::cout << myMap.size() << std::endl;
feature_ptr
mfeature
=
feature_ptr
(
new
Feature
(
1
));
// feature_ptr mfeature = feature_ptr(new Feature(myMap));
mfeature
->
add_geometry
(
line
);
// mfeature->properties().insert(make_pair(std::string("name"),
// std::string("test")));
boost
::
put
(
*
mfeature
,
"name"
,
mapnik
::
value
(
"test"
));
std
::
cout
<<
mfeature
->
props
().
size
()
<<
std
::
endl
;
std
::
cout
<<
(
*
mfeature
)[
"name"
]
<<
std
::
endl
;
mDatasource
->
push
(
mfeature
);
...
...
@@ -199,6 +213,10 @@ int main(int argc, char * argv[])
rule
.
set_max_scale
(
1000000
);
// rule.set_min_scale(500000);
rule
.
append
(
mapnik
::
line_symbolizer
(
mapnik
::
color
(
"#809bc0"
),
8.0
));
// TextSymbolizer name="name" face_name="DejaVu Sans Book" size="9" fill="#000" halo_radius="1" placement="line"
// text_symbolizer (std::string const &name, std::string const &face_name, unsigned size, color const &fill)
// text_symbolizer (std::string const &name, unsigned size, color const &fill)
rule
.
append
(
mapnik
::
text_symbolizer
(
"name"
,
"DejaVu Sans Book"
,
9
,
mapnik
::
color
(
"#000"
)));
style
.
add_rule
(
rule
);
m
.
insert_style
(
"roads"
,
style
);
}
...
...
This diff is collapsed.
Click to expand it.
myOwnMapnik.cxx
+
3
−
1
View file @
28d8bc89
#define BOOST_SPIRIT_THREADSAFE
// #define BOOST_SPIRIT_THREADSAFE
// #define BOOST_DISABLE_ASSERTS 1
#include
<mapnik/map.hpp>
#include
<mapnik/datasource_cache.hpp>
...
...
@@ -11,6 +12,7 @@
#include
<mapnik/memory_datasource.hpp>
#include
<iostream>
int
main
(
int
argc
,
char
**
argv
)
{
using
namespace
mapnik
;
...
...
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