################# Lightning Strikes ################# ======== Overview ======== Request Types ------------- This portion of the API concerns lightning strikes, which are point data affecting a geographic region (defined by an extent) or proximity around a location (defined by a point and radius). There are 2 request types, providing different levels of detail. Each response identifies a possible transition to further information. These can be depicted as follows: .. image:: _static/lightning.png :alt: Lightning Request Transition Diagram :align: center .. _lightning_parameters: Request Parameters ------------------ Lightning summary and history requests allow for additional parameters beyond those specified by the :ref:`request_format`. * **OPTIONAL**: A list of strike types (*types*) to include in the response. Accepted values are ``cloud`` (cloud-to-cloud lightning only), ``ground`` (cloud-to-ground lightning only), or both, separated by a comma. If unspecified, only ground strikes are included. * **OPTIONAL** (proximity requests only): A radius in statute miles or kilometers (*radius*) around the given location defining a search area for lightning strikes included in the response. If unspecified, *radius* defaults to 1. The maximum allowed radius is 20 statute miles. * **OPTIONAL** (proximity requests only): A unit designator (*units*) for interpretation of the radius as well as the distance included in the response. Accepted values are ``miles`` or ``km``. If unspecified, *units* defaults to statute miles. * **OPTIONAL** (proximity history requests only): A sort order (*sort*) for lightning strikes in the response. Accepted values include ``distance`` (nearest to farthest) or ``time`` (oldest to newest). If unspecified, results are sorted by distance. Response Content ---------------- The following fields are included in each representation of a lightning strike: * **id** (string) * **date/time** (`RFC 3339`_ string including milliseconds) * **type** (string): "cloud" or "ground" * **location** (`ISO 6709`_ string) * **peak current** * **unit** (string): "amps" * **value** (integer) * **distance** (proximity requests only) * **unit** (string): "miles" or "km" * **value** (decimal) * **bearing** (proximity requests only) * **unit** (string): "degrees from north" * **value** (decimal) ======================= Proximity-Based Summary ======================= This request returns the total number of lightning strikes impacting the proximity around a specific location within a date range (the last 24 hours by default). Results are returned as `JSON`_ or `XML`_. A link to the `proximity-based history`_ (within the same date range) is included in the response to facilitate a client-side transition. URI Examples ------------ :: forensic.api.wdtinc.com/v2/lightning/summary/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t= forensic.api.wdtinc.com/v2/lightning/summary/+DD.ddd-DDD.ddd.xml?radius=&units=&begin=&end=&types=&u=&t= See prior sections for a description of the :ref:`request_format` and :ref:`lightning_parameters`. .. rst-class:: html-toggle JSON Response ------------- The JSON representation of the resource is structured as follows (loosely based on Google's `JSON style guide`_):: { "apiVersion": "2.5.8", "lightningSummary": { "dateRange": { "begin": "YYYY-MM-DDThh:mm:ss", "end": "YYYY-MM-DDThh:mm:ss" }, "location": "+DD.ddd-DDD.ddd", "radius": { "unit": "", "value": DD.dd } "selfLink": "/v2/lightning/summary/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t=", "strikeCount": nn, "lightningHistoryLink": "/v2/lightning/history/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t=", } } .. rst-class:: html-toggle XML Response ------------ The XML representation of the resource is structured as follows (based on Google's `XML style guide`_): .. code-block:: xml +DD.ddd-DDD.ddd DD.dd nn ==================== Region-Based Summary ==================== This request returns the total number of lightning strikes impacting a given region within a date range (the last 24 hours by default). The region is required to be no more than 40 miles wide in either direction. Results are returned as `JSON`_ or `XML`_. A link to the `region-based history`_ (within the same date range) is included in the response to facilitate a client-side transition. URI Examples ------------ :: forensic.api.wdtinc.com/v2/lightning/summary/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t= forensic.api.wdtinc.com/v2/lightning/summary/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd.xml?begin=&end=&types=&u=&t= See prior sections for a description of the :ref:`request_format` and :ref:`lightning_parameters`. .. rst-class:: html-toggle JSON Response ------------- The JSON representation of the resource is structured as follows (loosely based on Google's `JSON style guide`_):: { "apiVersion": "2.5.8", "lightningSummary": { "dateRange": { "begin": "YYYY-MM-DDThh:mm:ss", "end": "YYYY-MM-DDThh:mm:ss" }, "region": "+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd", "selfLink": "/v2/lightning/summary/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t=", "strikeCount": nn, "lightningHistoryLink": "/v2/lightning/history/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t=", } } .. rst-class:: html-toggle XML Response ------------ The XML representation of the resource is structured as follows (based on Google's `XML style guide`_): .. code-block:: xml +DD.ddd-DDD.ddd+DD.ddd-DDD.ddd nn ======================= Proximity-Based History ======================= This request returns the history of lightning strikes impacting the proximity around a specific location within a date range (the last 24 hours by default). The region is required to be no more than 40 miles wide in either direction. Results are returned as `GeoJSON`_, `KML`_, or `XML`_. An empty list (feature collection) is returned if there are no strikes. A link to the `proximity-based summary`_ (within the same date range) is included in the response to facilitate a client-side transition. URI Examples ------------ :: forensic.api.wdtinc.com/v2/lightning/history/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&sort=&u=&t= forensic.api.wdtinc.com/v2/lightning/history/+DD.ddd-DDD.ddd.kml?radius=&units=&begin=&end=&types=&sort=&u=&t= forensic.api.wdtinc.com/v2/lightning/history/+DD.ddd-DDD.ddd.xml?radius=&units=&begin=&end=&types=&sort=&u=&t= See prior sections for a description of the :ref:`request_format` and :ref:`lightning_parameters`. .. rst-class:: html-toggle GeoJSON Response ---------------- The GeoJSON representation of the resource is structured as follows:: { "apiVersion": "2.5.8", "lightningHistory": { "dateRange": { "begin": "YYYY-MM-DDThh:mm:ss", "end": "YYYY-MM-DDThh:mm:ss" }, "features": [ { "geometry": { "coordinates": [ -85.930000000000007, 38.079999999999998 ], "type": "Point" }, "properties": { "timestamp": "YYYY-MM-DDThh:mm:ss.ssss", "id": "...", "location": "+DD.ddd-DDD.ddd", "peakCurrent": { "unit": "amps", "value": DDD }, "proximity": { "bearing": { "unit": "degrees from north", "value": DD.dd }, "distance": { "unit": "", "value": DD.dd } }, "type": "cloud" }, "type": "Feature" }, { "geometry": { "coordinates": [ -74.930000000000007, 42.019999999999998 ], "type": "Point" }, "properties": { "timestamp": "YYYY-MM-DDThh:mm:ss.ssss", "id": "...", "location": "+DD.ddd-DDD.ddd", "peakCurrent": { "unit": "amps", "value": DDD }, "proximity": { "bearing": { "unit": "degrees from north", "value": DD.dd }, "distance": { "unit": "", "value": DD.dd } }, "type": "ground" }, "type": "Feature" }, : : ], "lightningSummaryLink": "/v2/lightning/summary/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t=", "location": "+DD.ddd-DDD.ddd", "radius": { "unit": "miles", "value": DD.dd }, "selfLink": "/v2/lightning/history/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t=", "type": "FeatureCollection" } } .. rst-class:: html-toggle KML Response ------------ The KML representation of the resource is structured as follows: .. code-block:: xml Lightning History /v2/lightning/history/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t= YYYY-MM-DDThh:mm:ssZ YYYY-MM-DDThh:mm:ssZ +DD.ddd-DDD.ddd DD.ddd miles /v2/lightning/summary/+DD.ddd-DDD.ddd?radius=&units=&begin=&end=&types=&u=&t= id YYYY-MM-DDThh:mm:ss.sssZ ... ... ... degrees from north DDD amps cloud -91.95,39.5024 id YYYY-MM-DDThh:mm:ss.sssZ ... ... ... degrees from north DDD amps ground -81.847,42.7024 : : .. rst-class:: html-toggle XML Response ------------ The XML representation of the resource is structured as follows (based on Google's `XML style guide`_): .. code-block:: xml +DD.ddd-DDD.ddd DD.ddd YYYY-MM-DDThh:mm:ss.sssZ +DD.ddd-DDD.ddd DDD DD.dd DD.dd cloud YYYY-MM-DDThh:mm:ss.sssZ +DD.ddd-DDD.ddd DDD DD.dd DD.dd ground : : ==================== Region-Based History ==================== This request returns the history of lightning strikes impacting a given region within a date range (the last 24 hours by default). Results are returned as `GeoJSON`_, `KML`_, or `XML`_. An empty list (feature collection) is returned if there are no strikes. A link to the `region-based summary`_ (within the same date range) is included in the response to facilitate a client-side transition. URI Examples ------------ :: forensic.api.wdtinc.com/v2/lightning/history/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&sort=&u=&t= forensic.api.wdtinc.com/v2/lightning/history/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd.kml?begin=&end=&types=&sort=&u=&t= forensic.api.wdtinc.com/v2/lightning/history/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd.xml?begin=&end=&types=&sort=&u=&t= See prior sections for a description of the :ref:`request_format` and :ref:`lightning_parameters`. .. rst-class:: html-toggle GeoJSON Response ---------------- The GeoJSON representation of the resource is structured as follows:: { "apiVersion": "2.5.8", "lightningHistory": { "dateRange": { "begin": "YYYY-MM-DDThh:mm:ss", "end": "YYYY-MM-DDThh:mm:ss" }, "features": [ { "geometry": { "coordinates": [ -85.930000000000007, 38.079999999999998 ], "type": "Point" }, "properties": { "timestamp": "YYYY-MM-DDThh:mm:ss.sss", "id": "...", "location": "+DD.ddd-DDD.ddd", "peakCurrent": { "unit": "amps", "value": DDD }, "type": "cloud" }, "type": "Feature" }, { "geometry": { "coordinates": [ -74.930000000000007, 42.019999999999998 ], "type": "Point" }, "properties": { "timestamp": "YYYY-MM-DDThh:mm:ss.sss", "id": "...", "location": "+DD.ddd-DDD.ddd", "peakCurrent": { "unit": "amps", "value": DDD }, "type": "ground" }, "type": "Feature" }, : : ], "lightningSummaryLink": "/v2/lightning/summary/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t=", "region": "+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd", "selfLink": "/v2/lightning/history/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t=", "type": "FeatureCollection" } } .. rst-class:: html-toggle KML Response ------------ The KML representation of the resource is structured as follows: .. code-block:: xml Lightning History /v2/lightning/history/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t= YYYY-MM-DDThh:mm:ssZ YYYY-MM-DDThh:mm:ssZ +DD.ddd-DDD.ddd+DD.ddd-DDD.ddd /v2/lightning/summary/+DD.ddd-DDD.ddd+DD.ddd-DDD.ddd?begin=&end=&types=&u=&t= id YYYY-MM-DDThh:mm:ss.sssZ DDD amps cloud -91.95,39.5024 id YYYY-MM-DDThh:mm:ss.sssZ DDD amps ground -81.847,42.7024 : : .. rst-class:: html-toggle XML Response ------------ The XML representation of the resource is structured as follows (based on Google's `XML style guide`_): .. code-block:: xml +DD.ddd-DDD.ddd+DD.ddd-DDD.ddd YYYY-MM-DDThh:mm:ss.sssZ +DD.ddd-DDD.ddd DDD cloud YYYY-MM-DDThh:mm:ss.sssZ +DD.ddd-DDD.ddd DDD ground : : .. _`GeoJSON`: http://en.wikipedia.org/wiki/GeoJSON .. _`ISO 6709`: http://en.wikipedia.org/wiki/ISO_6709 .. _`JSON`: http://en.wikipedia.org/wiki/JSON .. _`JSON style guide`: http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml .. _`KML`: https://developers.google.com/kml/documentation/ .. _`RFC 3339`: http://www.ietf.org/rfc/rfc3339.txt .. _`XML`: http://en.wikipedia.org/wiki/XML .. _`XML style guide`: http://google-styleguide.googlecode.com/svn/trunk/xmlstyle.html