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
eca89df6
Commit
eca89df6
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add handling of points
parent
fbd876c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Common/otbVectorDataToImageFilter.txx
+33
-8
33 additions, 8 deletions
Code/Common/otbVectorDataToImageFilter.txx
with
33 additions
and
8 deletions
Code/Common/otbVectorDataToImageFilter.txx
+
33
−
8
View file @
eca89df6
...
@@ -288,6 +288,7 @@ namespace otb
...
@@ -288,6 +288,7 @@ namespace otb
// lyr.add_style("roads");
// lyr.add_style("roads");
// lyr.add_style("roads-text");
// lyr.add_style("roads-text");
// lyr.add_style("world");
// lyr.add_style("world");
if (m_StyleList.size() == 0)
if (m_StyleList.size() == 0)
{
{
itkExceptionMacro(<<"No style is provided for the vector data");
itkExceptionMacro(<<"No style is provided for the vector data");
...
@@ -297,14 +298,8 @@ namespace otb
...
@@ -297,14 +298,8 @@ namespace otb
lyr.add_style(m_StyleList[i]);
lyr.add_style(m_StyleList[i]);
}
}
m_Map.addLayer(lyr);
// mapnik::Layer lyr2("text");
m_Map.addLayer(lyr);
// lyr2.set_srs(vectorDataProjectionProj4);
// lyr2.set_datasource(mDatasource);
// lyr2.add_style("roads-text");
//
// m_Map.addLayer(lyr2);
assert( (m_SensorModelFlip == 1)||(m_SensorModelFlip == -1) );
assert( (m_SensorModelFlip == 1)||(m_SensorModelFlip == -1) );
...
@@ -386,7 +381,37 @@ namespace otb
...
@@ -386,7 +381,37 @@ namespace otb
}
}
case FEATURE_POINT:
case FEATURE_POINT:
{
{
itkExceptionMacro(<<"This type (FEATURE_POINT) is not handle (yet) by VectorDataToImageFilter(), please request for it");
// itkExceptionMacro(<<"This type (FEATURE_POINT) is not handle (yet) by VectorDataToImageFilter(), please request for it");
// std::cout << std::setprecision(15);
// std::cout << " ** Inserting new point **" << std::endl;
typedef mapnik::vertex<double,2> vertex2d;
typedef mapnik::point<vertex2d> point2d;
typedef boost::shared_ptr<point2d> point_ptr;
mapnik::geometry2d * point = new point2d;
point->move_to(dataNode->GetPoint()[0],dataNode->GetPoint()[1]);
// std::cout << dataNode->GetPoint()[0] << ", " << dataNode->GetPoint()[1] << std::endl;
typedef boost::shared_ptr<mapnik::raster> raster_ptr;
typedef mapnik::feature<mapnik::geometry2d,raster_ptr> Feature;
typedef boost::shared_ptr<Feature> feature_ptr;
feature_ptr mfeature = feature_ptr(new Feature(1));
mfeature->add_geometry(point);
mapnik::transcoder tr("ISO-8859-15");
if (dataNode->HasField("place_name"))
boost::put(*mfeature, "name", tr.transcode((dataNode->GetFieldAsString("place_name")).c_str()));
boost::put(*mfeature, "place", tr.transcode("city"));
boost::put(*mfeature, "capital", tr.transcode("yes"));//FIXME more a question of style
mDatasource->push(mfeature);
break;
break;
}
}
case otb::FEATURE_LINE:
case otb::FEATURE_LINE:
...
...
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