Proposal simple Regionalization storage
Following our discussion, here a sketch of what is roughly implemented in eGSIM. The main idea is to try the same here and see how to proceed afterwards, e.g., move to geopandas, or remove the eGSIM implementation and make this an imported library of eGSIM, although this is maybe not really feasible because eGSIM works on a SQL database behind the hood (sorry I did not think about it in the call).
Anyway, a simple regionalization can be achieved via two different JSON files, a regionalization and a "gsim selection".
- The regionalization is a GeoJSON object, basically a list of geographic regions, with associated tectonic region type (trt):
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[102.0, 0.5], ... ]
},
"properties": {
"trt": "Active shallow crust"
}
},
...
]
}
- A a "gsim selection" is a JSON object, i.e. a
dict
mapping a trt to a list of GSIMs (just an example with the first two random GSIMs I can recall):
{
"Active shallow crust": ["AkkarBommer2010", "CauzziFaccioli2008"],
...
}
In eGSIM, given a point, we iterate over each region in the geoJSON and check if the point is in the region (using the methods of the Python shapely
library I guess). When a point is in the region, we return the GSIMs of that region from the "gsim selection" JSON object.
From my experience, the only issue I had with this approach is naming conventions (different TRTs denoting the same concept), which is solved in eGSIM with another database table (here we might define our unique names and be strict). Obviously, there is also scalability: for hundreds of regions I never had problems. Above, I don't know.
Last note: in eGSIM we have several "gsim selection" dicts, one for each research project model, e.g. SHARE, ESHM2020 (still ongoing), but this is not an issue here I guess, so we can stick to a single "gsim selection" dict