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

DOC: otbVectorDataProjectionFilter

parent cc3e07cf
No related branches found
No related tags found
No related merge requests found
......@@ -31,30 +31,31 @@ namespace otb
* \brief Reproject vector data in a different coordinate system
*
* This class is used to reproject vector data into a different coordinate system.
* the input and output coordinate system can be a map projection, a raw image from a
* sensor (the sensor model will be used), or the local coordinate system of an image.
*
* This filter works on otb::VectorData as input and output.
*
* The process goes as follow:
* - offset/scaling of the input coordinates
* - transform to get the data in geographic coordinates (lon/lat)
* - transform from geographic coordinates
* - offset/scaling of the output coordinates
*
* Each of this step is optional and would default to and identity transform is nothing
* is specified.
*
* The offset/scaling step are necessary only when working with the local coordinate
* system of the image. The value need to be provided by the SetInputSpacing, SetInputOrigin,
* SetOutputSpacing and SetOutputOrigin methods.
*
* The two transforms are itk::Transform that will be instanciated as otb::GenericMapProjection
* or otb::InverseSensorModel or otb::ForwardSensorModel.
* the input and output coordinate system can be a map projection, a raw image from a
* sensor (the sensor model will be used), or the local coordinate system of an image.
*
* This filter works on otb::VectorData as input and output.
*
* The process goes as follow:
* - offset/scaling of the input coordinates
* - transform to get the data in geographic coordinates (lon/lat)
* - transform from geographic coordinates
* - offset/scaling of the output coordinates
*
* Each of this step is optional and would default to an identity transform if nothing
* is specified.
*
* The offset/scaling steps are necessary only when working with the local coordinate
* system of the image (origin on the top left). The value need to be provided by the
* SetInputSpacing, SetInputOrigin, SetOutputSpacing and SetOutputOrigin methods.
*
* The two transforms derived from itk::Transform and will be instanciated as
* otb::GenericMapProjection or otb::InverseSensorModel or otb::ForwardSensorModel
* (according to the available information).
*
* \ingroup VectorDataFilter
* \ingroup Projection
*/
* \ingroup Projection
*/
template <class TInputVectorData, class TOutputVectorData>
class ITK_EXPORT VectorDataProjectionFilter :
......
......@@ -197,27 +197,14 @@ namespace otb
VectorDataProjectionFilter<TInputVectorData,TOutputVectorData>
::ReprojectPoint(PointType pointCoord) const
{
// typedef typename LineType::VertexListType::ConstPointer VertexListConstPointerType;
// typedef typename LineType::VertexListConstIteratorType VertexListConstIteratorType;
// VertexListConstPointerType vertexList = line->GetVertexList();
// VertexListConstIteratorType it = vertexList->Begin();
// typename LineType::Pointer newLine = LineType::New();
// while ( it != vertexList->End())
// {
itk::Point<double,2> point;
// itk::ContinuousIndex<double,2> index;
// typename LineType::VertexType pointCoord = it.Value();
pointCoord[0] = pointCoord[0] * m_InputSpacing[0] + m_InputOrigin[0];
pointCoord[1] = pointCoord[1] * m_InputSpacing[1] + m_InputOrigin[1];
point = m_Transform->TransformPoint(pointCoord);
point[0] = (point[0] - m_OutputOrigin[0]) / m_OutputSpacing[0];
point[1] = (point[1] - m_OutputOrigin[1]) / m_OutputSpacing[1];
// index[0]=point[0];
// index[1]=point[1];
// otbMsgDevMacro(<< "Converting: " << it.Value() << " -> " << pointCoord << " -> " << point << " -> " << index);
// newLine->AddVertex(index);
// it++;
// }
itk::Point<double,2> point;
pointCoord[0] = pointCoord[0] * m_InputSpacing[0] + m_InputOrigin[0];
pointCoord[1] = pointCoord[1] * m_InputSpacing[1] + m_InputOrigin[1];
point = m_Transform->TransformPoint(pointCoord);
point[0] = (point[0] - m_OutputOrigin[0]) / m_OutputSpacing[0];
point[1] = (point[1] - m_OutputOrigin[1]) / m_OutputSpacing[1];
return point;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment