Code Monkey home page Code Monkey logo

Comments (5)

nyalldawson avatar nyalldawson commented on August 25, 2024

It should be tab in its own, because it is not relying on any service

This is not a trivial change -- I'll need to discuss a price variation with @ghtmtt before we can proceed with this

from qquake.

MarioLocati avatar MarioLocati commented on August 25, 2024

There is some adjustment that should be implemented.

  1. I have tested some QuakeML 1.2 file, some is loaded correctly, some don't load at all. Attached a zip with those that cause an error (see at the end of this issue). As far as I understood, files downloaded from the following pages cannot be loaded:

QuakeML_test_files_with_problems.zip

  1. The plugin does not apply any symbology to the loaded data, neither to the epicentres, nor to the layer with macroseismic data in the case of QuakeML 2.0.

  2. When trying to load a local file clicking on "Import from file" the file dialog allow selecting files with the extension ".xml" only, whereas some organisations adopted ".qml" as the extension for QuakeML. Please, add ".qml" among the default filters, and add the possibility to show all files in the folder.

  3. In the current implementation, the name of the the plugin assign as label to the QGIS layer, the name of the service currently selected. This is OK when loading an URL, but in the case of loading a local file, the label of the layer should correspond to the loaded file name.

@nyalldawson Could you please take care of this?

An error has occurred while executing Python code: 

ValueError: could not convert string to float: 'original mag_type: ML' 
Traceback (most recent call last):
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\fetcher.py", line 246, in 
    reply.finished.connect(lambda r=reply: self._reply_finished(r))
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\fetcher.py", line 314, in _reply_finished
    self.result.parse_initial(reply.readAll())
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\quakeml_parser.py", line 1685, in parse_initial
    self.add_events(content)
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\quakeml_parser.py", line 1700, in add_events
    event = Event.from_element(event_element)
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\quakeml_parser.py", line 1644, in from_element
    comments.append(Comment.from_element(comment_nodes.at(e).toElement()))
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\quakeml_parser.py", line 818, in from_element
    return Comment(text=parser.float('text', optional=False),
  File "C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qquake\quakeml_parser.py", line 320, in float
    return float(child.text())
ValueError: could not convert string to float: 'original mag_type: ML'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.16.1-Hannover Hannover, b381a90dca 

Python Path:
C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python
C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.16\apps\Python37
C:\PROGRA~1\QGIS3~1.16\apps\Python37\Scripts
C:\Program Files\QGIS 3.16\bin\python37.zip
C:\PROGRA~1\QGIS3~1.16\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib
C:\Program Files\QGIS 3.16\bin
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\Pythonwin
C:/Users/mario/AppData/Roaming/QGIS/QGIS3\profiles\default/python

from qquake.

nyalldawson avatar nyalldawson commented on August 25, 2024

@MarioLocati I'll look into these.

Regarding:

The plugin does not apply any symbology to the loaded data, neither to the epicentres, nor to the layer with macroseismic data in the case of QuakeML 2.0.

Which style should we be applying here? Given that all the styling information is service specific and we don't have a particular service associated when we are just directly using the xml, I'm not sure which style we should be applying...

from qquake.

MarioLocati avatar MarioLocati commented on August 25, 2024

@nyalldawson

FDSN-event services
The symbology to use should be the first available style of type "events". At the moment we have only one style of this kind, called "CPTI".

Macroseismic services
For the events output layer the symbology to use should be the first available style of type "events". At the moment we have only one style of this kind, called "CPTI".
For the macroseismic data output layer the symbology to use should be the first available style of type "macroseismic". At the moment we have only one style of this kind, called "AHEAD_intensities".

Below an extract from the "styles" section in the current version of "config.json"

[...]
  "styles": {
    "CPTI": {
      "type": "events",
	  "url": "https://www.emidius.eu/qquake/symbology/CPTI15_symbols.qml"
    },
    "AHEAD_intensities": {
      "type": "macroseismic",
      "url": "https://www.emidius.eu/qquake/symbology/AHEAD_intensities.qml"
    },
[...]

from qquake.

nyalldawson avatar nyalldawson commented on August 25, 2024

This is all fixed now -- I had the wrong issue number in the PR so it didn't get auto-closed

from qquake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.