Event
in package
implements
IteratorAggregate
PHP library to access FDSN Webservices and request Event (earthquake) information in text format
Tags
Table of Contents
Interfaces
- IteratorAggregate
Properties
- $counter : int
- $dateTimeRange : DateTimeRange
- $depthRange : DepthRange
- $event : Quake
- $eventId : Id
- $eventList : string
- $events : array<string|int, mixed>
- $fdns_server : string
- $format : string
- $latlon : LatLon
- $magnitudeRange : MagnitudeRange
- $radiusRange : RadiusRange
- $square : LatLonRange
- $url : string
- $user : string
- $webserviceFullPath : string
Methods
- __construct() : mixed
- addFilterByBoundingBox() : void
- Add filter based on geographical selection
- addFilterByDateTimeRange() : void
- Add filter based on datetime range
- addFilterByDepthRange() : void
- Add filter based on depth range
- addFilterByEventId() : void
- Add filter based on ID Event (see https://terremoti.ingv.it/ to get event ids)
- addFilterByMagnitudeRange() : void
- Add filter based on magnitude range
- addFilterByRadiusRange() : void
- Add filter based on latlon->radius
- fetch() : int
- Apply all filter and DO the request to the Official ONT Webservice
- getIterator() : array<string|int, mixed>
- Iterate over events found
- getNumRows() : int
- Return the number of elems found
- getSingleElemFound() : Quake
- Get single event found, if only one event was found (filtering by eventId or when only one event is found by fetch() )
- composeURL() : void
- Compose URL before do the request
- fdsnSupportedVersion() : bool
- Check if FDSN server version is supported
- formatIsValid() : bool
- Check if format set is valid
- parse() : int
- Loop over found elems found (in text format) and convert the to \Fdsn\DataStructure\Quake obj
Properties
$counter
private
int
$counter
= 0
$dateTimeRange
private
DateTimeRange
$dateTimeRange
$depthRange
private
DepthRange
$depthRange
$event
private
Quake
$event
$eventId
private
Id
$eventId
$eventList
private
string
$eventList
$events
private
array<string|int, mixed>
$events
= array()
$fdns_server
private
string
$fdns_server
$format
private
string
$format
= 'text'
$latlon
private
LatLon
$latlon
$magnitudeRange
private
MagnitudeRange
$magnitudeRange
$radiusRange
private
RadiusRange
$radiusRange
$square
private
LatLonRange
$square
$url
private
string
$url
$user
private
string
$user
$webserviceFullPath
private
string
$webserviceFullPath
Methods
__construct()
public
__construct(string $format, string $user, string|null $fdns_server) : mixed
Parameters
- $format : string
- $user : string
- $fdns_server : string|null
addFilterByBoundingBox()
Add filter based on geographical selection
public
addFilterByBoundingBox(LatLonRange $square) : void
Parameters
- $square : LatLonRange
-
Lat/Lon min -> Lat/Lon max
addFilterByDateTimeRange()
Add filter based on datetime range
public
addFilterByDateTimeRange(DateTimeRange $dateTimeRange) : void
Parameters
- $dateTimeRange : DateTimeRange
-
Datetime min -> Datetime max (default value is TODAY)
addFilterByDepthRange()
Add filter based on depth range
public
addFilterByDepthRange(DepthRange $depthRange) : void
Parameters
- $depthRange : DepthRange
-
Depth min -> Depth max
addFilterByEventId()
Add filter based on ID Event (see https://terremoti.ingv.it/ to get event ids)
public
addFilterByEventId(Id $eventId) : void
Parameters
- $eventId : Id
-
Unique event ID
addFilterByMagnitudeRange()
Add filter based on magnitude range
public
addFilterByMagnitudeRange(MagnitudeRange $magnitudeRange) : void
Parameters
- $magnitudeRange : MagnitudeRange
-
Magnitude min -> Magnitude max
addFilterByRadiusRange()
Add filter based on latlon->radius
public
addFilterByRadiusRange(LatLon $latlon, RadiusRange $radiusRange) : void
Parameters
- $latlon : LatLon
-
lat/lon as coordinate to start search
- $radiusRange : RadiusRange
-
radius min->max to search ( valid range [0:180] for both radius )
fetch()
Apply all filter and DO the request to the Official ONT Webservice
public
fetch() : int
Return values
int —Return the number of elems found
getIterator()
Iterate over events found
public
getIterator() : array<string|int, mixed>
Return values
array<string|int, mixed> —array of \Fdsn\DataStructure\Quake obj
getNumRows()
Return the number of elems found
public
getNumRows() : int
Return values
int —The number of elems found
getSingleElemFound()
Get single event found, if only one event was found (filtering by eventId or when only one event is found by fetch() )
public
getSingleElemFound() : Quake
Return values
Quake —Quake obj
composeURL()
Compose URL before do the request
private
composeURL() : void
fdsnSupportedVersion()
Check if FDSN server version is supported
private
fdsnSupportedVersion() : bool
Return values
boolformatIsValid()
Check if format set is valid
private
formatIsValid(string $format) : bool
Parameters
- $format : string
Return values
bool —format is valid?
parse()
Loop over found elems found (in text format) and convert the to \Fdsn\DataStructure\Quake obj
private
parse(string $response) : int
Parameters
- $response : string