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
Constants
- fdsnSupportedVersion = '^1.60'
Properties
- $counter : int
- $dateTimeRange : DateTimeRange
- $depthRange : DepthRange
- $event : Quake
- $eventId : int
- $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
- 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 search() )
- search() : int
- Apply all filter and DO the request to the Official ONT Webservice
- analizeEventsList() : void
- Loop over found elems found (in text format) and convert the to \Fdsn\DataStructure\Quake obj
- 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
Constants
fdsnSupportedVersion
public
mixed
fdsnSupportedVersion
= '^1.60'
Properties
$counter
private
int
$counter
= 0
$dateTimeRange
private
DateTimeRange
$dateTimeRange
$depthRange
private
DepthRange
$depthRange
$event
private
Quake
$event
$eventId
private
int
$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(int $eventId) : void
Parameters
- $eventId : int
-
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 )
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 search() )
public
getSingleElemFound() : Quake
Return values
Quake —Quake obj
search()
Apply all filter and DO the request to the Official ONT Webservice
public
search() : int
Return values
int —Return the number of elems found
analizeEventsList()
Loop over found elems found (in text format) and convert the to \Fdsn\DataStructure\Quake obj
private
analizeEventsList() : void
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?