Skip to content

Instantly share code, notes, and snippets.

@endarthur
endarthur / msh.py
Last active November 30, 2020 17:06
Leapfrog Geo's msh file reader and converter to Wavefront .obj
# Contributors: Alexander Jüstel, Arthur Endlein Correia, Florian Wellmann
#
# This script is part of GemGIS, saved here as a standalone version.
#
# 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.
import xmltodict
def parse_categorized_qml(qml_fname):
with open(qml_fname, "rb") as f:
qml = xmltodict.parse(f)
column = qml["qgis"]["renderer-v2"]["@attr"]
symbols = {
symbol["@name"]:{
prop["@k"]:prop["@v"] for prop in symbol["layer"]["prop"]
}
# PyQt4 imports
from PyQt5 import QtGui, QtCore, QtWidgets, QtOpenGL
from PyQt5.QtOpenGL import QGLWidget
# PyOpenGL imports
import OpenGL.GL as gl
import OpenGL.arrays.vbo as glvbo
# Window creation function.
def create_window(window_class):
"""Create a Qt window in Python, or interactively in IPython with Qt GUI
@endarthur
endarthur / geofisica.DAT
Created October 26, 2011 01:07
Dados para o Software RES2DINV
CAMPO GEOFISICA 2
2.0
3
40
0
0
0.00 2.00 1.00 642.20
0.00 2.00 2.00 785.20
0.00 2.00 3.00 452.40
0.00 2.00 4.00 301.60