Class UsgsShakeMapReader

java.lang.Object
nz.org.riskscape.usgs.UsgsShakeMapReader
Direct Known Subclasses:
UsgsShakeMapMultiDatasetReader

public class UsgsShakeMapReader extends Object

Helper to read a datasets from an USGS shakemap file (e.g. shake_result.hdf) and turn it into a spatial coverage. Shakemaps are slightly different to other HDF5 files in that the lat/long coordinates aren't present in a dataset, but instead the bounds/extent of the data is encoded as HDF5 attributes as part of the dataset, i.e. xmin, xmax, ymin, ymax.

  • Constructor Summary

    Constructors
    Constructor
    Description
    UsgsShakeMapReader(nz.org.riskscape.hdf5.H5File file, String datasetName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.data.coverage.Dataset2D>
    Returns the underlying HDF5 data in a form that can be queried by an x,y index.
    protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.data.coverage.Dataset2D>
    getDataset2D(String datasetPath)
     
    nz.org.riskscape.problem.ResultOrProblems<org.geotools.geometry.jts.ReferencedEnvelope>
    Reads the latitude/longitude co-ordinates used for the given dataset in the shakemap.
    protected nz.org.riskscape.hdf5.H5Dataset
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UsgsShakeMapReader

      public UsgsShakeMapReader(nz.org.riskscape.hdf5.H5File file, String datasetName)
  • Method Details

    • openDataset

      protected nz.org.riskscape.hdf5.H5Dataset openDataset(String dataset)
    • getData

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.data.coverage.Dataset2D> getData()

      Returns the underlying HDF5 data in a form that can be queried by an x,y index.

    • getDataset2D

      protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.data.coverage.Dataset2D> getDataset2D(String datasetPath)
    • getExtent

      public nz.org.riskscape.problem.ResultOrProblems<org.geotools.geometry.jts.ReferencedEnvelope> getExtent()

      Reads the latitude/longitude co-ordinates used for the given dataset in the shakemap.

      Returns:
      an envelope that holds the extent of the PGA grid