GemGIS
Geographic information processing for geomodeling
Overview
GemGIS
is a Python-based, open-source geographic information processing library. It is capable of preprocessing spatial data such as vector data (shape files, geojson files, geopackages), raster data, data obtained from WMS services or XML/KML files. Preprocessed data can be stored in a dedicated Data Class to be passed to the geomodeling package GemPy in order to accelerate to model building process. Postprocessing of model results will allow export from GemPy
to geoinformation systems such as QGIS and ArcGIS or to Google Earth for further use.
GemGIS
uses the full functionality of GeoPandas, rasterio, OWSLib, Pandas and NumPy.
All provided maps and examples were taken from the books 'Interpretation of Geological Structures Through Maps: An Introductory Practical Manual' by D. Powell and "An Introduction to Geological Structures and Maps" by G.M. Bennison referenced at the bottom. referenced at the bottom.
Table of Contents
Installation
Due to rasterio. GemGIS must be used with python==3.7
conda install geopandas
conda install rasterio
pip install gemgis
Structure of Package
The core of GemGIS
is made of the GemPyData
class (gemgis.py
). Its attributes can directly be utilized by GemPy
making it easier for users to load data. Methods of the GemPyData
class allow users to directly set these attributes. Multiple other files contain functions to manipulate vector data, raster data, etc.:
gemgis.py
- core file containing theGemPyData
classvector.py
- file containing functions to manipulate vector dataraster.py
- file containing functions to manipulate raster datautils.py
- file containing utility functions frequently used for the manipulation of vector/raster datawms.py
- file containing methods to load WMS services as arrays/rastersvisualization.py
- file containing functions to simplify plotting of spatial datapostprocessing.py
- file containing functions to postprocess GemPy geo_model datanotebooks
- folder containing tutorial notebooks explaining the features ofGemGIS
and example notebooks applying these features
Features
Extracting Data from Vector Files
Data stored as points, lines or polygons as shape-files, geopackages or geojson files can easily be imported into GemGIS
GeoPandas GeoDataFrames. X and Y coordinates can then be extracted for these objects for direct use in GemPy
. Digital elevations models can be interpolated if contour lines with height values are provided. If the loaded the exceeds the desired modeling/working are extent, the data can be cropped.
Extracting Data from Raster Files
Rasters (stored as arrays in Python) such as digital elevation models store height information. The height of interface points can be extracted from these rasters. In addition, if a raster represents a layer in the subsurface, orientation values can be sampled for the use in GemPy
. Orientations are calculated via the slope and aspect of the provided raster. It is also possible to resize rasters, clip rasters or save rasters as referenced geotiffs again.
Extracting Data from Online Services
Online services provide a wide range of possibilities to work with spatial data. Currently, it is possible to load data from WMS services into GemGIS
. The functionality will be extended to WCS and WFS services in the future.
Extracting Data from XML/KML Files
XML/KML Data export will be available in the future.
Visualization of Data in PyVista
PyVista
is the main 3D visualization package of GemPy
. In order for new users to get used to the package, it is possible to plot the input data as a PyVista
plot.
Utility Tools
GemGIS
offers a wide range of utility tools. These includes
- Conversion of vector data into custom sections directly usable in
GemPy
- Conversion of GeoDataFrames into Pandas DataFrames for
GemPy
- Setting the extent and resolution for a
GemPy
model based on vector data and lists - Load and save QGIS style files (QML) for the use as color_dict in
GemPy
- Calculate orientations based on strike lines
- Interpolate missing strike lines to calculate orientations
- Read CSV files as GeoDataFrames
- and many more to come
Postprocessing of GemPy geo_model data
GemGIS
also offers postprocessing methods to use the data of the GemPy
model. These include:
- Export of the geological map as shape file
- Extract boreholes from
GemPy
models - Create depth maps of surfaces
- and many more to come
Documentation
References
- de la Varga, M., Schaaf, A., and Wellmann, F.: GemPy 1.0: open-source stochastic geological modeling and inversion, Geosci. Model Dev., 12, 1-32, https://doi.org/10.5194/gmd-12-1-2019, 2019
- Powell, D.: Interpretation of Geological Structures Through Maps: An Introductory Practical Manual, Longman, pp. 192, 1992
- Bennison, G.M.: An Introduction to Geological Structures and Maps, Hodder Education Publication, pp. 78, 1990