Giter Club home page Giter Club logo

paraview-plugins's Introduction

N-Cube ParaView plugin for 3D/4D GIS Data Visualization

Hint: You can sponsor the software development on Patreon.

About the project

N-Cube ParaView plugin is MIT-licensed set of ParaView data readers/sources/filters/writers to load, process, and write well-known GIS datasets like to shapefiles, GeoTIFF rasters, etc.

We use this plugin on MacOS only although it's cross platform and can be used with Linux and Windows ParaView builds too.

N-Cube ParaView Plugin Readers:

N-Cube LAS Well Log Reader - Read Well Log versions 1.2 and 2.0 of the LAS file specification.

N-Cube ParaView Plugin Writers:

ESRI Shapefile - Use ParaView menu Save -> Save Data -> ESRI Shapefile(*.shp) to save geometry as ESRI Shapefile (Point). By performance reasons in case when the geometry includes more than 1M points only bounding box will be saved.

N-Cube ParaView Plugin Sources:

N-Cube Image On Topography Source - data source for georeferenced image. Optionally GeoTIFF or NetCDF topography (DEM) raster using to define Z coordinates. Optional "Use Sea Level for Negative Topography" parameter allows to replace negative topography values by zeroes.

N-Cube Reproject Filter - TODO.

N-Cube Shapefile On Topography Block Source - data source for 2D/3D Shapefile or GeoJSON. Optionally GeoTIFF or NetCDF topography (DEM) raster using to define Z coordinates. Optional "Group by Field" parameter produces a set of layers from geometries grouped by the field. When the "Group by Field" parameter is not defined ("None") all the geometries separated as the layers. All shapefile fields presented in the ouput.

N-Cube Table Block Source - data source for CSV table data to produce geometries like to wells.

N-Cube Table on Topography Block Source - data source for CSV table data to produce geometries on optional topography. See for details NCubeTableOnTopographyBlockSource

N-Cube Topography Block Source - data source for GeoTIFF or NetCDF topography (DEM) raster visualization as 3D surface. Only "Group by Field" parameter presented in the ouput.

Geometry coordinate system re-projecting to raster coordinate system and the geometry cropping to the raster extent when the topography file using and the both coordinate systems are defined.

How to Use ParaView 5.9.0 With Python 3.8 on MacOS

Fortunately, ParaView 5.9 on MacOS supports Python 3.8 and we can drop Python 2.7 support now! Today protected MacOS applications (signed and hardened) are not able to load 3rd party binary libraries (required for the plugin) and we need to use special ParaView build to load them: ParaView-5.9.0-MPI-OSX10.13-Python3.8-64bit.unsigned.dmg

Note: while I tried to sign 3rd party binaries compiled by GCC compiler by self-issued certificate it doesn't work (missed Apple compiler specific LC_VERSION_MIN) and we need to use the special ParaView build. Let me know if you know how to resolve the issue!

To extend your ParaView by 3rd party Python libraries and ParaView Python plugins follow instructions below:

  • [One-time step] Install Python 3.8 using Homebrew:
brew install [email protected]
  • [One-time step] Install required Python modules:
/usr/local/opt/[email protected]/bin/python3 -m pip install --upgrade \
  numpy xarray pandas geopandas shapely vtk rasterio lasio
  • [One-time step] Create ParaView wrapper script pv5.9 with this content:
#!/bin/sh
PYTHONPATH=/usr/local/lib/python3.8/site-packages
GDAL_DATA="$PYTHONPATH/rasterio/gdal_data"
APPPATH=/Applications/ParaView-5.9.0.app

mkdir -p "$APPPATH/Contents//Libraries/lib/python3.8/lib-dynload/"
cp /usr/local/Cellar/[email protected]/3.8.*/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_lzma.cpython-38-darwin.so \
	"$APPPATH/Contents//Libraries/lib/python3.8/lib-dynload/_lzma.cpython-38-darwin.so"

PYTHONPATH="$PYTHONPATH" GDAL_DATA="$GDAL_DATA" "$APPPATH/Contents/MacOS/paraview"
  • Launch ParaView from MacOS Terminal by command below and save the Terminal window open while you use ParaView:
pv5.9

Note: you are able to see debug messages for developers in the Terminal Window.

  • [One-time step] For the first launch download the plugin code or clone the repository and load from ParaView("Tools" -> "Manage Plugins" -> "Load New ...") this file N-Cube ParaView plugin Python source file NCubeParaViewPlugin.py placed anywhere on your computer. Setup 'Auto Load' checkbox if you need to use the plugin later otherwise it should be loaded at next ParaView launches again.

  • Select one of the added data sources in ParaView "Sources" -> "Alphabetical" menu or "Sources" -> "Search ..."

How to Use old ParaView versions With Python 2.7

If you still need to have Python 2.7 compatible build see this link: Version compatiable with Python 2.7 and Python 3.7+ Use the same instructions as above for Python 3.8.

Note: there are some non-latin symbols issues with Python 2.7. Maybe you need to remove non-latin fields in your data files and rename them to use ASCII symbols only.

Project Goals

For our 3D geological modeling we need a good 3D visualization and data processing tools. We tested many commercial and Open Source 3D visualization packages and programming libraries and for our needs Open Source ParaView software and it's core VTK library are the best one. ParaView is the great 3D visualization and processing tool but without GIS data support. To fix the lack, we created ParaView geospatial plugins for our internal usage.

See also our code snippets repository ParaView Programmable Source and Programmable Filter examples and A brief explanation of the 3D Density-Depth model construction.

Screenshots

Used Technologies

We use this set of programming libraries and technologies:

VTK: The Visualization Toolkit

Xarray: N-D labeled arrays and datasets in Python

Rasterio: Python access to geospatial raster data

GeoPandas: Python geospatial operations on geometric types

Pandas: Python Data Analysis Library

Shapely: Python package for manipulation and analysis of planar geometric objects

GEOS: Geometry Engine, Open Source

PROJ: generic coordinate transformation software

Log ASCII Standard (LAS) files in Python

Authors

Alexey Pechnikov

https://orcid.org/0000-0001-9626-8615 (ORCID)

E-mail: [email protected]

paraview-plugins's People

Contributors

alexeypechnikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paraview-plugins's Issues

No module named 'NCubeReprojectFilter'

After following the instructions for installation (loading the NCubeParaViewPlugin.py file) I get the following message:

./pv5.9.sh
<class 'ModuleNotFoundError'>
(  92.456s) [paraview        ]vtkPVPythonAlgorithmPlu:187   WARN| Failed to load Python plugin:
Failed to call `paraview.detail.pythonalgorithm.load_plugin`.
Traceback (most recent call last):
  File "/Applications/ParaView-5.9.1.app/Contents/Python/paraview/detail/pythonalgorithm.py", line 509, in load_plugin
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/raulvalenzuela/Downloads/ParaView-plugins-master/NCube/NCubeParaViewPlugin.py", line 16, in <module>
    from NCubeReprojectFilter import *
ModuleNotFoundError: No module named 'NCubeReprojectFilter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/ParaView-5.9.1.app/Contents/Python/paraview/detail/pythonalgorithm.py", line 513, in load_plugin
    module = imp.load_source(modulename, filepath)
  File "/Applications/ParaView-5.9.1.app/Contents/Libraries/lib/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/raulvalenzuela/Downloads/ParaView-plugins-master/NCube/NCubeParaViewPlugin.py", line 16, in <module>
    from NCubeReprojectFilter import *
ModuleNotFoundError: No module named 'NCubeReprojectFilter'
(  92.600s) [paraview        ]  vtkPVPluginLoader.cxx:530    ERR| vtkPVPluginLoader (0x7fefd4438bf0): dlopen(/Users/raulvalenzuela/Downloads/ParaView-plugins-master/NCube/NCubeParaViewPlugin.py, 1): no suitable image found.  Did find:
	/Users/raulvalenzuela/Downloads/ParaView-plugins-master/NCube/NCubeParaViewPlugin.py: file too short
	/Users/raulvalenzuela/Downloads/ParaView-plugins-master/NCube/NCubeParaViewPlugin.py: file too short

It seems that NCubeReprojectFilter.py is missing in the package.

Questions for display my own data in paraview

Hi, i am a Phd student in OUC,i met a problem when i use Paraview python scripts.
I have a excel containing time steps (a total of 100s, one step per second). I want to display this data change when animating in Paraview. At first, I used "AnnotateTimeFilter" to display my customized data. However, I found that the built-in Format has fixed variables, so I can't recognize my data. I tried to read the excel file from the python script first, But I found that the Pandas library could not be used normally, so I wonder if you could provide a method to help me solve this problem? I also want to ask how to use the full python function?
Best Regards,
Junius Wang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.