json to catalog object

Hello obspeople,

I am playing around with the idea of using Mongodb to store event data. I was delighted to find the Catalog write method already supports json as an output format. However, I have not been able to find a decode method for json in the documentation. Is this functionality implemented? If so how would I go about creating a Catalog object from json data?



Hi Derrick,

That was contributed by us (NSL), it’s actually a one-way encoder to GeoJSON (maybe the name should change?). We developed it as a way to quickly export events for mapping with javascript libraries that speak GeoJSON. It was done pretty easily because GeoJSON has a pretty straightforward format (dare I say “schema”?), at least until you get to “properties”, where we tried to put in the minimum to map an event. For converting QuakeML to JSON, I’m not aware of any major effort. The problem is, how to translate the schema. I know Chad Trabant has thrown stuff out for StationXML https://github.com/chad-iris/StationJSON , but I think you’re looking for the QML version of that? You’d probably have to roll your own, or open an issue, IMHO it would be really useful to have a standard (JSON schema) for this, based on the QuakeML 1.2 UML design.