Skip to content
Snippets Groups Projects
Site-Specification.md 4.99 KiB
Newer Older
  • Learn to ignore specific revisions
  • Powers, Peter M.'s avatar
    Powers, Peter M. committed
    # Site Specification
    
    The sites at which to perform hazard and related calculations may be defined in a variety of
    ways. Examples of the file formats described below are available in the resource directory:
    
    [`etc/nshm`](../../etc/nshm/README.md).
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    **Note on Coordinates:** *nshmp-haz* supports longitude and latitude values in the closed
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    ranges `[-360° ‥ 360°]` and `[-90° ‥ 90°]`. However, mixing site and/or source
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    coordinates across the antimeridian (the -180° to 180° transition) will yield unexpected results.
    For Pacific models and calculations, always use positive or negative longitudes exclusively.
    
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    For any site parameter values that are not supplied in the file formats below, the following
    defaults are used:
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    
    ```text
        name: Unnamed
        vs30: 760.0
        z1p0: null (GMM will use default basin depth model)
        z2p5: null (GMM will use default basin depth model)
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
        zSed: null
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    ```
    
    For basin depth parameters `z1p0` and `z2p5`, a `null` value indicates that a GMM should use
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    it's 'default' basin depth scale factor, which is usually included in it's Vs30 site term.
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    
    ## Comma-Delimited Format (\*.csv)
    
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    * Header row must identify columns.
    * Valid and [optional] column names are:
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
      `[name,] lon, lat [, vs30] [, z1p0] [, z2p5]`  
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    * At a minimum, `lon` and `lat` must be defined.
    * Columns can be in any order and any missing fields will be populated with the default values
      listed above.
    * If a site `name` is supplied, it is included in the first column of any output curve files.
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    
    ## GeoJSON Format (\*.geojson)
    
    Although more verbose than the comma-delimited format, [GeoJSON](http://geojson.org) is a more
    
    versatile format for encoding geographic data. *nshmp-haz* uses GeoJSON for both lists of sites
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    and to define map regions. If you encounter problems when formatting JSON files, use
    [JSONLint](http://jsonlint.com) or [GeoJSONLint](http://geojsonlint.com) for validation.
    
    ### Site Lists
    
    A site list is expected as a `FeatureCollection` of `Point` features. For example:
    
    ```json
    {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [-122.25, 37.80]
          },
          "properties": {
            "title": "Oakland CA",
            "vs30": 760.0,
            "z1p0": 0.048,
            "z2p5": 0.607
          }
        }
      ]
    }
    ```
    
    As with the CSV format, the minimum required data is a `geometry` `coordinates` array. All
    `properties` are optional. When using GeoJSON, the `title` property maps to the name of the site.
    
    Additional properties, if present, are ignored by *nshmp-haz* but permitted as they may be
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    relevant for other applications. For example, [styling
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    properties](https://github.com/mapbox/simplestyle-spec/tree/master/1.1.0)
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    may be used to improve rendering in mapping applications. For a fully fledged example, see the
    
    [NSHM test sites](../../etc/nshm/sites-nshmp.geojson) file.
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    
    ### Map Regions
    
    
    GeoJSON is also used to define *nshmp-haz* map regions. For example, see the file that defines a
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    region commonly used when creating hazard and other maps for the
    
    [Los Angeles basin](../../etc/nshm/map-la-basin.geojson).
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    
    
    A map region is expected as a `Polygon` `FeatureCollection`. Currently, *nshmp-haz* only supports
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    a `FeatureCollection` with 1 or 2 polygons. When a single polygon is defined, it must consist of a
    single, simple closed loop. Additional arrays that define holes in the polygon (per the GeoJSON
    spec) are not processed and results are undefined for self-intersecting coordinate arrays. This
    polygon feature supports the same (optional and/or extra) `properties` as the `Point` features
    described above. The site properties are applied to all sites in the defined region. In addition,
    this feature *must* define a `spacing` property with a value in decimal degrees that governs the
    site density within the region. This polygon defines the area over which hazard calculations are
    to be performed.
    
    A second polygon may be used to define a map region. This polygon *must* be defined first, *must*
    have a feature `id` of `Extents`, and *must* be rectangular (in a mercator projection) with edges
    parallel to lines of latitude and longitude. Any points in the 'calculation' polygon outside the
    'extents' polygon are ignored; hazard values at any points within the 'extents' polygon but
    outside the 'calculation' polygon are set to zero. For an example, see the
    
    [NSHMP Western US](../../etc/nshm/map-wus.geojson) map site file.
    
    
    ## Related Pages
    
    * [Building & Running](./Building-&-Running.md#building-&-running)
      * [Developer Basics](./Developer-Basics.md#developer-basics)
      * [Calculation Configuration](./Calculation-Configuration.md#calculation-configuration)
      * [Site Specification](./Site-Specification.md#site-specification)
    
      * [Using Docker](./Using-Docker.md#using-docker)
      * See also the [examples](../../etc/examples) directory
    
    Powers, Peter M.'s avatar
    Powers, Peter M. committed
    * [**Documentation Index**](../README.md)
    
    ![USGS logo](./images/usgs-icon.png)  [U.S. Geological Survey](https://www.usgs.gov)
    
    National Seismic Hazard Mapping Project ([NSHMP](https://earthquake.usgs.gov/hazards/))