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

STYLE: cleaning

parent 71e0e2b2
Branches
Tags
No related merge requests found
......@@ -28,13 +28,16 @@
#include "otbImage.h"
#include "otbVectorDataToImageFilter.h"
// ./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/LargeInput/VECTOR/MidiPyrenees/roads.shp output.png
int otbVectorDataToImageFilter(int argc, char * argv[])
{
if (argc < 3 )
{
std::cout << argv[0] <<" <input vector filename> <input image filename>" << std::endl;
return EXIT_FAILURE;
}
//Read the vector data
typedef otb::VectorData<> VectorDataType;
typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType;
......@@ -46,7 +49,7 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> ProjectionFilterType;
ProjectionFilterType::Pointer projection = ProjectionFilterType::New();
projection->SetInput(reader->GetOutput());
// projection->Update();
std::string projectionRefWkt ="PROJCS[\"UTM Zone 31, Northern Hemisphere\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AXIS[\"Lat\",NORTH],AXIS[\"Long\",EAST],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",3],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]";
projection->SetOutputProjectionRef(projectionRefWkt);
......@@ -59,20 +62,14 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
typedef otb::Image<PixelType,2> ImageType;
ImageType::SizeType size;
// size[0] = 1000;
// size[1] = 1000;
size[0] = 500;
size[1] = 500;
ImageType::PointType origin;
// origin[0] = 1.3769;//UL lon
// origin[1] = 43.5455;//UL lat
origin[0] = 374149.980555821;//UL easting
origin[1] = 4829183.99443839;//UL northing
ImageType::SpacingType spacing;
// spacing[0] = 0.00002;
// spacing[1] = -0.00002;
spacing[0] = 0.6;
spacing[1] = -0.6;
......@@ -98,7 +95,6 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
vectorDataRendering->SetOrigin(origin);
vectorDataRendering->SetSpacing(spacing);
//Save the image in a file
typedef otb::ImageFileWriter<ImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
......@@ -106,7 +102,5 @@ int otbVectorDataToImageFilter(int argc, char * argv[])
writer->SetFileName(argv[2]);
writer->Update();
return EXIT_SUCCESS;
}
......@@ -27,7 +27,7 @@
int otbVectorDataProjectionFilterFromMapToSensor(int argc, char * argv[])
{
if (argc < 3 )
if (argc < 4 )
{
std::cout << argv[0] <<" <input vector filename> <input image filename>"
<< " <output vector filename> " << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment