GNS-Science / solvis

NSHM opensha inversion solution analysis python module
GNU Affero General Public License v3.0
1 stars 1 forks source link

Feature: add elevation to GeoJSON output #46

Closed voj closed 1 day ago

voj commented 2 months ago

Description

Running the following code returns 2-dimensional GeoJSON. We want elevation data to be included, for example to render 3D visualisations.

import json
from IPython.display import GeoJSON

# NSHM libraries ..
import nzshm_model as nm
import solvis

# we need a matching source_logic_tree (CBC do we really ???)
slt = nm.get_model_version("NSHM_v1.0.4").source_logic_tree

# load the composite_solution using the source logic tree
csol = solvis.CompositeSolution.from_archive("../NSHM_v1.0.4_CompositeSolution.zip", slt)

# get the the Crustal FaultSystemSolution
fss = csol._solutions['CRU']
gj = json.loads(fss.fault_surfaces().to_json())

This is sample code from solvis-jupyterlab

We need a decision on whether to include elevation as depth in km as is done in openSHA, or as elevation in m as is expected by all 3rd party tools.

See https://github.com/GNS-Science/solvis/tree/feature/46-3d-geojson for a partial solution.

chrisbc commented 3 weeks ago

this is closed by #48