shakemap.coremods.shape

class shakemap.coremods.shape.ShapeModule(eventid)[source]

Bases: CoreModule

shape – Generate shape files of the ground motion parameters

Instantiate a ShapeModule class with an event ID.

command_name = 'shape'
targets = ['products/shape\\.zip']
dependencies = [('products/shake_result.hdf', True)]
execute()[source]

Create shape files.

Raises:
shakemap.coremods.shape.create_polygons(container, datadir, logger, max_workers, method='pcontour')[source]

Generates a set of closed polygons (with or without holes) using the specified method (either pcontour or skimage), and uses fiona to convert the resulting GeoJSON objects into ESRI-style shape files which are then zipped into an archive along with .prj, .lyr, and metadata .xml files. A warning will be emitted if .lyr, or .xml files cannot be found for the ground motion parameter in question.

Parameters:
  • container (ShakeMapOutputContainer) – An open ShakeMap output container object.

  • datadir (str) – The products directory for the event in question.

  • logger (logger) – This module’s logger object.

  • method (str) – Contouring implementation to use (either ‘pcontour’ or ‘skimage’)

Returns:

Nothing.

Return type:

(nothing)

shakemap.coremods.shape.make_shape_files(adict, method='pcontour')[source]