GeneralTransform that has a GeoProjection does not correctly perform inverse

It looks like the vtkGeoTransform is incomplete, it doesn’t implement the InternalDeepCopy() copy method. The vtkGeneralTransform needs to be able to copy the internal transforms before it inverts them.

To work around this bug, the easiest option is to create two copies of the GeoTransform:

  vtkNew<vtkGeoTransform> geoTransform;
  geoTransform->SetDestinationProjection(proj);

  vtkNew<vtkGeoTransform> geoTransformInverse;
  geoTransformInverse->SetSourceProjection(proj);

and two copies of the combined transform:

  vtkNew<vtkGeneralTransform> totalProjection;
  totalProjection->PostMultiply();
  totalProjection->Identity();
  totalProjection->Concatenate(geoTransform);
  totalProjection->Concatenate(linearTransform);

  vtkNew<vtkGeneralTransform> totalProjectionInverse;
  totalProjectionInverse->PostMultiply();
  totalProjectionInverse->Identity();
  totalProjectionInverse->Concatenate(linearTransform->GetInverse());
  totalProjectionInverse->Concatenate(geoTransformInverse);

A proper bug fix would require adding an InternalDeepCopy() method to vtkGeoTransform within the VTK code itself. Something like this:

void vtkGeoTransform::InternalDeepCopy(vtkAbstractTransform* transform)
{
  vtkGeoTransform* t = static_cast<vtkGeoTransform*>(transform);
  this->SetSourceProjection(t->GetSourceProjection());
  this->SetDestinationProjection(t->GetDestinationProjection());
  this->SetTransformZCoordinate(t->GetTransformZCoordinate());
}