[vtkusers] Geo Aligned Images in GeoVis

imran khan khan.imranh at gmail.com
Thu Nov 19 15:39:50 EST 2009


Hi:

I am trying to overlay images using GeoVis. My first question is that does
this capability exist today?

I tried inserting an image in a modified version of TestGeoView with the
following code

  char image2[200];
  sprintf(image2,"CL_40K.jpg");

 // Add second image representation
  vtkSmartPointer<vtkGeoAlignedImageRepresentation> imageRep2 =

vtkSmartPointer<vtkGeoAlignedImageRepresentation>::New();
   vtkGeoAlignedImageSource *imageSource2 = vtkGeoAlignedImageSource::New();
  VTK_CREATE(vtkJPEGReader, reader2);
  reader2->SetFileName(image2);
  reader2->Update();
  imageSource2->SetImage(reader2->GetOutput());
  imageSource2->SetLatitudeRange(35.5478020, 35.743050);  // corner points
for CL_40K.jpg image
  imageSource2->SetLongitudeRange(-117.832936, -117.456217);
  imageSource2->Initialize();

   vtkSmartPointer<vtkGeoSource> imageGeoSource;
  imageGeoSource.TakeReference(imageSource2);
  imageGeoSource->Initialize();

  imageRep2->SetSource(imageGeoSource);
  view->AddRepresentation(imageRep2);

This results in the image wrapping around the whole globe. What I wanted to
do was to have it appear in the range
of lat/lon specified by the corner points

  imageSource2->SetLatitudeRange(35.5478020, 35.743050);  // corner points
for CL_40K.jpg image
  imageSource2->SetLongitudeRange(-117.832936, -117.456217);

Is there a tutorial on how the set up the vtkGeoTreeNode?

Thanks in advance.

-- 
عمران ألحق خان
Imran H. Khan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091119/8c8e7855/attachment.htm>


More information about the vtkusers mailing list