3D Visualization of Map Data

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

3D Visualization of Map Data

Ron Chapman
Malcolm,
 
I'm having problems trying to implement your suggestion. 
 
>>One approach would be to run an elevation filter on your 3D map (to create scalar values) and then a >>transform with scale set to 1.0,1.0,0.0 which will set all your z values to 0.0. Then probe this dataset >>with your overlay features (which are at elevation 0.0) and run the output through vtkWarpScalars (to >>apply the sampled elevations to your overlay). The only problem is that sampling will only take place at >>points defined in your overlay dataset and the result may not look good due to non-sampled >>intersections with your 3D map. Adding some extra elevation to your overlay may fix this.
 
I do understand that reconfiguring my 2D shape file to have points located on the edges of my 3d mesh is the best approach, and will attempt this once I get the above working first.
 
Here is my pipeline
 
....
 
// run the elevation filter to get the elevation scalars
 
 vtkElevationFilter *Elevation = vtkElevationFilter::New();
 Elevation->SetInput(Mesh3D);
 
 // convert our 3d mesh to 2d
 
 vtkTransform *Transform = vtkTransform::New();
 Transform->Scale(1.0,1.0,0.0);
 
 vtkTransformPolyDataFilter *transFilter = vtkTransformPolyDataFilter::New();
 transFilter->SetInput(Mesh);
 transFilter->SetTransform(Transform);
 
 
 // probe 2d mesh with shape data
 
    vtkProbeFilter *Probe = vtkProbeFilter::New();
   Probe->SetInput(Shape2D);
   Probe->SetSource(trasnFilter->GetOutput());
   
 // apply the sampled elevation to the overlay
 
 vtkWarpScalar *Warp = vtkWarpScalar::New();
 Warp->SetInput(Probe->GetPolyDataOutput());
 Warp->XYPlaneOn();
 
....
 
I'm confused as to how the elevation filter and warpscalars are working together to get my 2D shape file into 3D?  The above pipeline is giving me garbage.
 
Ron
 

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: 3D Visualization of Map Data

Malcolm Drummond
Hi Ron
 
You want to sample values from your terrain to points in your Shapefile data - this can't be done directly as they don't coincide in 3D. My approach is to store the terrain elevation data as scalars (via vtkElevationFilter) before flattening the terrain to coincide with the Shapefile data. At that stage you can probe one with the other. Then you map the probed scalar values back to the z component (via vtkWarpScalars).
 
The input to your  vtkTransformPolyDataFilter should be the output from the elevation filter i.e. ...
 
transFilter->SetInput(Elevation->GetOutput());
 
... this is to get your mesh into the same plane (z = 0.0) as your shapefile output. If they don't coincide then the probing will produce no data.
 
I'd take this in stages - much easier to do with Python or TCL scripting. First visualize the output of the transform filter and check that it is flat and that the elevation data is showing as scalars. Then add the shapefile to the visualization and check that they coincide (I just assumed that it was at z = 0.0, maybe not). Then add the probe filter and check that the probing works (i.e the output has interpolated scalar values). Finally add the warpscalars to get your elevation back.  
 
HTH
Malcolm Drummond
----- Original Message -----
Sent: Wednesday, February 15, 2006 6:28 AM
Subject: [vtkusers] 3D Visualization of Map Data

Malcolm,
 
I'm having problems trying to implement your suggestion. 
 
>>One approach would be to run an elevation filter on your 3D map (to create scalar values) and then a >>transform with scale set to 1.0,1.0,0.0 which will set all your z values to 0.0. Then probe this dataset >>with your overlay features (which are at elevation 0.0) and run the output through vtkWarpScalars (to >>apply the sampled elevations to your overlay). The only problem is that sampling will only take place at >>points defined in your overlay dataset and the result may not look good due to non-sampled >>intersections with your 3D map. Adding some extra elevation to your overlay may fix this.
 
I do understand that reconfiguring my 2D shape file to have points located on the edges of my 3d mesh is the best approach, and will attempt this once I get the above working first.
 
Here is my pipeline
 
....
 
// run the elevation filter to get the elevation scalars
 
 vtkElevationFilter *Elevation = vtkElevationFilter::New();
 Elevation->SetInput(Mesh3D);
 
 // convert our 3d mesh to 2d
 
 vtkTransform *Transform = vtkTransform::New();
 Transform->Scale(1.0,1.0,0.0);
 
 vtkTransformPolyDataFilter *transFilter = vtkTransformPolyDataFilter::New();
 transFilter->SetInput(Mesh);
 transFilter->SetTransform(Transform);
 
 
 // probe 2d mesh with shape data
 
    vtkProbeFilter *Probe = vtkProbeFilter::New();
   Probe->SetInput(Shape2D);
   Probe->SetSource(trasnFilter->GetOutput());
   
 // apply the sampled elevation to the overlay
 
 vtkWarpScalar *Warp = vtkWarpScalar::New();
 Warp->SetInput(Probe->GetPolyDataOutput());
 Warp->XYPlaneOn();
 
....
 
I'm confused as to how the elevation filter and warpscalars are working together to get my 2D shape file into 3D?  The above pipeline is giving me garbage.
 
Ron
 


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers