Error creating rupture enclosing polygon from area source

Bug #1091130 reported by Lars Butler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Critical
Lars Butler

Bug Description

Traceback (most recent call last):
  File "bin/openquake", line 467, in <module>
    main()
  File "bin/openquake", line 447, in main
    args.force_inputs, args.exports)
  File "bin/openquake", line 219, in run_hazard
    completed_job = engine2.run_hazard(job, log_level, log_file, exports)
  File "/usr/local/openquake/oq-engine/openquake/engine2.py", line 336, in run_hazard
    return _run_calc(job, log_level, log_file, exports, calc, 'hazard')
  File "/usr/local/openquake/oq-engine/openquake/engine2.py", line 403, in _run_calc
    _do_run_calc(job, exports, calc, job_type)
  File "/usr/local/openquake/oq-engine/openquake/engine2.py", line 476, in _do_run_calc
    calc.pre_execute()
  File "/usr/local/openquake/oq-engine/openquake/calculators/hazard/classical/core.py", line 229, in pre_execute
    self.initialize_sources()
  File "/usr/local/openquake/oq-engine/openquake/calculators/hazard/general.py", line 632, in initialize_sources
    src_db_writer.serialize()
  File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 217, in inner
    res = func(*args, **kwargs)
  File "/usr/local/openquake/oq-engine/openquake/input/source.py", line 351, in serialize
    geom = nhlib_src.get_rupture_enclosing_polygon()
  File "/usr/local/openquake/nhlib/nhlib/source/area.py", line 67, in get_rupture_enclosing_polygon
    return self.polygon.dilate(max_rup_radius + dilation)
  File "/usr/local/openquake/nhlib/nhlib/geo/polygon.py", line 149, in dilate
    return type(self)._from_2d(new_2d_polygon, self._projection)
  File "/usr/local/openquake/nhlib/nhlib/geo/polygon.py", line 99, in _from_2d
    xx, yy = numpy.transpose(polygon2d.boundary.coords)
  File "/usr/lib/python2.7/dist-packages/shapely/geometry/base.py", line 486, in coords
    "Multi-part geometries do not provide a coordinate sequence")
NotImplementedError: Multi-part geometries do not provide a coordinate sequence

This error originated from an area source, represented by a polygon which is rather convex. When we tried to dilate the polygon (`get_rupture_enclosing_polygon`), a hole was created in the geometry and resulted in a multipolygon.

There are two possible actions to address this error:

1) Give a more precise error message to the user, explaining which source, including ID and name, caused the error.
2) If the rupture enclosing polygon is a multipolygon, take the exterior of the shape so as to not include the hole. This is valid because the rupture enclosing polygon is only considered in site-to-source distance filtering.

Changed in openquake:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Lars Butler (lars-butler)
milestone: none → 0.9.0
status: Confirmed → In Progress
Changed in openquake:
importance: High → Critical
Revision history for this message
Lars Butler (lars-butler) wrote :
Changed in openquake:
status: In Progress → Fix Committed
Changed in openquake:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.