# Web app for visualizing geophysical data

**URL:** https://discourse.vtk.org/t/web-app-for-visualizing-geophysical-data/15223
**Category:** Web
**Tags:** python, vtkjs
**Created:** [January 29, 2025, 12:34pm UTC](https://discourse.vtk.org/t/web-app-for-visualizing-geophysical-data/15223 "2025-01-29T12:34:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![spasquet](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/9e8a1a/32.png) [@spasquet](https://discourse.vtk.org/u/spasquet)
#### Post date: [January 29, 2025, 12:34pm UTC](https://discourse.vtk.org/t/web-app-for-visualizing-geophysical-data/15223/1 "2025-01-29T12:34:18Z")

</div>

Hi there,

I’m trying to develop a web application for visualizing 3D geophysical data. This data would be either in form of .vtk profiles, or .tiff maps.

I created a basic example using pyvista (and trame in the background) that works locally.

> **[Sylvain PASQUET / GeoVizPy · GitLab](https://gitlab.in2p3.fr/spasquet/geovizpy)**
>
> Gitlab IN2P3

When trying to set it on a server, I found out about Glance. Glance seems to do everything I was trying to get my app doing…Now I’m wondering if I could generate a .vtkjs or .glance file from my python script, that I would then import in Glance.

I tried the following code which seems to work :

```auto
# Create PyVista plotter
pl = pv.Plotter()

# Create and add cone
cone = pv.Cone()
pl.add_mesh(cone)

# Force render
pl.reset_camera()
pl.render()

# Get render window
render_window = pl.render_window

# Export scene
from vtkmodules.vtkIOExport import vtkJSONSceneExporter
exporter = vtkJSONSceneExporter()
exporter.SetFileName('test.vtkjs')
exporter.SetRenderWindow(render_window)
exporter.Write()

```

But when trying with my own vtk meshes, it creates the following file which I can’t open in Glance  
[https://filesender.renater.fr/?s=download&token=6ff804b0-750f-44a3-bbcf-77182ea3f8d3](https://filesender.renater.fr/?s=download&token=6ff804b0-750f-44a3-bbcf-77182ea3f8d3)

I don’t know if that makes any sense.  
I can code in Python, but I don’t know much about JS.

Thanks

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [January 29, 2025, 8:57pm UTC](https://discourse.vtk.org/t/web-app-for-visualizing-geophysical-data/15223/2 "2025-01-29T20:57:57Z")

</div>

It is because you exported a vtkUnstructuredGrid. Glance (and VTK.js under the hood) can only support vtkPolyData (surface meshes).

You would need to use a `vtkGeometryFilter` to extract the outer surface of your mesh.

HTH
