Ascii
extends ThematicEffect
in package
Fetch ASCII thematic effect data from HSIT portal
Table of Contents
Constants
- fileExtension = 'txt'
- templateUrl = 'https://e.hsit.it/%d/%d_%s.%s'
- dataStartsAtLine = 7
Properties
- $idQuake : Id
- $localFileFullPath : string|null
- $places : array<string|int, mixed>
- $thematicEffectStudyName : string
Methods
- __construct() : mixed
- fetch() : int
- fetch data from url (remote or local - if $localFileFullPath is set in __construct)
- getIterator() : array<string|int, mixed>
- get all places percentage
- fetchFromLocalPath() : array<string|int, mixed>
- fetch data from local path - if $localFileFullPath is set in __construct)
- fetchFromUrl() : array<string|int, mixed>
- fetch data from remote url path - if $localFileFullPath is set NOT in __construct)
- isValidType() : bool
- check if thematic effect study is supported
Constants
fileExtension
protected
mixed
fileExtension
= 'txt'
templateUrl
protected
mixed
templateUrl
= 'https://e.hsit.it/%d/%d_%s.%s'
dataStartsAtLine
private
mixed
dataStartsAtLine
= 7
Properties
$idQuake
protected
Id
$idQuake
$localFileFullPath
protected
string|null
$localFileFullPath
= null
$places
protected
array<string|int, mixed>
$places
= array()
$thematicEffectStudyName
protected
string
$thematicEffectStudyName
Methods
__construct()
public
__construct(Id $fdsnQuakeId, string $thematicEffectStudyName[, string|null $localFileFullPath = null ]) : mixed
Parameters
- $fdsnQuakeId : Id
- $thematicEffectStudyName : string
- $localFileFullPath : string|null = null
fetch()
fetch data from url (remote or local - if $localFileFullPath is set in __construct)
public
fetch() : int
Return values
int —number of data found
getIterator()
get all places percentage
public
getIterator() : array<string|int, mixed>
Return values
array<string|int, mixed> —locality percentage (array of associative arrays[lat, lon, percentage, reports, placeName] )
fetchFromLocalPath()
fetch data from local path - if $localFileFullPath is set in __construct)
protected
fetchFromLocalPath() : array<string|int, mixed>
Return values
array<string|int, mixed> —data from file, splitted in array of lines
fetchFromUrl()
fetch data from remote url path - if $localFileFullPath is set NOT in __construct)
protected
fetchFromUrl() : array<string|int, mixed>
Return values
array<string|int, mixed> —data from file, splitted in array of lines
isValidType()
check if thematic effect study is supported
private
isValidType(string $thematicEffectStudyName) : bool
Parameters
- $thematicEffectStudyName : string
-
name of the thematic effect study
Return values
bool —TRUE if is supported, FALSE otherwise