Skip to content
Snippets Groups Projects
Commit ae75e682 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ENH: Region extraction specification

parent 99987ac1
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
// ./mapnikOTBClasses /home/christop/OTB/trunk/OTB-Data/Input/waterways.shp output.png // ./mapnikOTBClasses /home/christop/OTB/trunk/OTB-Data/Input/waterways.shp output.png
// ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/Input/ToulouseRoad-examples.shp output.png // ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/Input/ToulouseRoad-examples.shp output.png
// ./mapnikOTBClasses ~/OTB/trunk/OTB-Data/LargeInput/VECTOR/MidiPyrenees/roads.shp output.png
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
...@@ -35,9 +36,17 @@ int main(int argc, char * argv[]) ...@@ -35,9 +36,17 @@ int main(int argc, char * argv[])
VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New(); VectorDataToImageFilterType::Pointer vectorDataRendering = VectorDataToImageFilterType::New();
vectorDataRendering->SetInput(projection->GetOutput()); vectorDataRendering->SetInput(projection->GetOutput());
ImageType::SizeType size; ImageType::SizeType size;
size[0]=1000; size[0] = 1000;
size[1]=1000; size[1] = 1000;
vectorDataRendering->SetSize(size); vectorDataRendering->SetSize(size);
ImageType::PointType origin;
origin[0] = 1.;//UL lon
origin[1] = 44;//UL lat
vectorDataRendering->SetOrigin(origin);
ImageType::SpacingType spacing;
spacing[0] = 0.001;
spacing[1] = -0.001;
vectorDataRendering->SetSpacing(spacing);
//Save the image in a file //Save the image in a file
......
...@@ -221,9 +221,14 @@ namespace otb ...@@ -221,9 +221,14 @@ namespace otb
// lyr.add_style("roads"); // lyr.add_style("roads");
m_Map.addLayer(lyr); m_Map.addLayer(lyr);
mapnik::Envelope<double> envelope(m_Origin[0],
m_Map.zoomToBox(lyr.envelope());//FIXME: use the Origin/Spacing to calculate this m_Origin[1]+m_Spacing[1]*m_Size[1],
std::cout << "Envelope: " << lyr.envelope() << std::endl; m_Origin[0]+m_Spacing[0]*m_Size[0],
m_Origin[1]);
// m_Map.zoomToBox(lyr.envelope());//FIXME: use the Origin/Spacing to calculate this
m_Map.zoomToBox(envelope);
// std::cout << "Envelope: " << lyr.envelope() << std::endl;
std::cout << "Envelope: " << envelope << std::endl;
mapnik::Image32 buf(m_Map.getWidth(),m_Map.getHeight()); mapnik::Image32 buf(m_Map.getWidth(),m_Map.getHeight());
mapnik::agg_renderer<mapnik::Image32> ren(m_Map,buf); mapnik::agg_renderer<mapnik::Image32> ren(m_Map,buf);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment