libs/core/src/lib/dataset-api/splitted-data-api-interface.service.ts
constructor(httpservice: HttpService, internalDatasetId: InternalIdHandler, translate: TranslateService)
|
||||||||||||
Parameters :
|
Public getData | ||||||||||||||||||||||||
getData(id: string, apiUrl: string, timespan: Timespan, params: DataParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||||||||||
Type parameters :
|
||||||||||||||||||||||||
Parameters :
Returns :
any
|
Public getTsData | ||||||||||||||||||||||||
getTsData(id: string, apiUrl: string, timespan: Timespan, params: DataParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||||||||||
Type parameters :
|
||||||||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Public getCategories | ||||||||||||
getCategories(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:162
|
||||||||||||
Parameters :
Returns :
Observable<Category[]>
|
Public getCategory | ||||||||||||
getCategory(id: string, apiUrl: string, params?: ParameterFilter)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:167
|
||||||||||||
Parameters :
Returns :
Observable<Category>
|
Public getData | ||||||||||||||||||||||||
getData(id: string, apiUrl: string, timespan: Timespan, params: DataParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||||||||||
Defined in
DatasetImplApiInterface:266
|
||||||||||||||||||||||||
Type parameters :
|
||||||||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Public getDataset | |||||||||||||||
getDataset(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:254
|
|||||||||||||||
Parameters :
Returns :
Observable<Dataset>
|
Public getDatasetByInternalId | ||||||||||||
getDatasetByInternalId(internalId: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:261
|
||||||||||||
Parameters :
Returns :
Observable<Dataset>
|
Public getDatasets | ||||||||||||
getDatasets(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:247
|
||||||||||||
Parameters :
Returns :
Observable<Dataset[]>
|
Public getFeature | |||||||||||||||
getFeature(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:207
|
|||||||||||||||
Parameters :
Returns :
Observable<Feature>
|
Public getFeatures | ||||||||||||
getFeatures(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:202
|
||||||||||||
Parameters :
Returns :
Observable<Feature[]>
|
Public getOffering | |||||||||||||||
getOffering(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:192
|
|||||||||||||||
Parameters :
Returns :
Observable<Offering>
|
Public getOfferings | ||||||||||||
getOfferings(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:187
|
||||||||||||
Parameters :
Returns :
Observable<Offering[]>
|
Public getPhenomena | ||||||||||||
getPhenomena(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:172
|
||||||||||||
Parameters :
Returns :
Observable<Phenomenon[]>
|
Public getPhenomenon | |||||||||||||||
getPhenomenon(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:177
|
|||||||||||||||
Parameters :
Returns :
Observable<Phenomenon>
|
Public getPlatform | |||||||||||||||
getPlatform(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:237
|
|||||||||||||||
Parameters :
Returns :
Observable<Platform>
|
Public getPlatforms | ||||||||||||
getPlatforms(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:232
|
||||||||||||
Parameters :
Returns :
Observable<Platform[]>
|
Public getProcedure | |||||||||||||||
getProcedure(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:222
|
|||||||||||||||
Parameters :
Returns :
Observable<Procedure>
|
Public getProcedures | ||||||||||||
getProcedures(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:217
|
||||||||||||
Parameters :
Returns :
Observable<Procedure[]>
|
Public getService | |||||||||||||||
getService(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:48
|
|||||||||||||||
Parameters :
Returns :
Observable<Service>
|
Public getServices | ||||||||||||
getServices(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:34
|
||||||||||||
Parameters :
Returns :
Observable<Service[]>
|
Public getSingleTimeseries | ||||||||||||
getSingleTimeseries(id: string, apiUrl: string, params?: ParameterFilter)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:126
|
||||||||||||
Parameters :
Returns :
Observable<Timeseries>
|
Public getSingleTimeseriesByInternalId | |||||||||
getSingleTimeseriesByInternalId(internalId: string, params?: ParameterFilter)
|
|||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||
Defined in
DatasetImplApiInterface:136
|
|||||||||
Parameters :
Returns :
Observable<Timeseries>
|
Public getStation | |||||||||||||||
getStation(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:67
|
|||||||||||||||
Parameters :
Returns :
Observable<Station>
|
Public getStations | ||||||||||||
getStations(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:62
|
||||||||||||
Parameters :
Returns :
Observable<Station[]>
|
Public getTimeseries | ||||||||||||
getTimeseries(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:77
|
||||||||||||
Parameters :
Returns :
Observable<Timeseries[]>
|
Public getTimeseriesData | |||||||||||||||
getTimeseriesData(apiUrl: string, ids: string[], timespan: Timespan, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:98
|
|||||||||||||||
Parameters :
Returns :
Observable<TimeseriesData[]>
|
Public getTimeseriesExtras |
getTimeseriesExtras(id: string, apiUrl: string)
|
Inherited from
DatasetImplApiInterface
|
Defined in
DatasetImplApiInterface:141
|
Returns :
Observable<TimeseriesExtras>
|
Public getTsData | ||||||||||||||||||||||||
getTsData(id: string, apiUrl: string, timespan: Timespan, params: DataParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||||||||||
Defined in
DatasetImplApiInterface:146
|
||||||||||||||||||||||||
Type parameters :
|
||||||||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Private prepareDataset |
prepareDataset(datasetObj: Dataset, apiUrl: string)
|
Inherited from
DatasetImplApiInterface
|
Defined in
DatasetImplApiInterface:299
|
Returns :
any
|
Private requestApiTexted | ||||||||||||||||
requestApiTexted(url: string, params: ParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||
Defined in
DatasetImplApiInterface:286
|
||||||||||||||||
Parameters :
Returns :
Observable<string>
|
Private requestApiTextedPost | ||||||||||||||||
requestApiTextedPost(url: string, params: ParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||
Defined in
DatasetImplApiInterface:293
|
||||||||||||||||
Parameters :
Returns :
Observable<Object>
|
Public Abstract getCategories | ||||||||||||
getCategories(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:63
|
||||||||||||
Parameters :
Returns :
Observable<Category[]>
|
Public Abstract getCategory | |||||||||||||||
getCategory(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:64
|
|||||||||||||||
Parameters :
Returns :
Observable<Category>
|
Public Abstract getData | ||||||||||||||||||
getData(id: string, apiUrl: string, timespan: Timespan, params?: DataParameterFilter, options?: HttpRequestOptions)
|
||||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||||
Defined in
DatasetImplApiInterface:52
|
||||||||||||||||||
Type parameters :
|
||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Public Abstract getDataset | |||||||||||||||
getDataset(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:50
|
|||||||||||||||
Parameters :
Returns :
Observable<Dataset>
|
Public Abstract getDatasetByInternalId | ||||||||||||
getDatasetByInternalId(internalId: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:51
|
||||||||||||
Parameters :
Returns :
Observable<Dataset>
|
Public Abstract getDatasets | ||||||||||||
getDatasets(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:49
|
||||||||||||
Parameters :
Returns :
Observable<Dataset[]>
|
Public Abstract getFeature | |||||||||||||||
getFeature(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:70
|
|||||||||||||||
Parameters :
Returns :
Observable<Feature>
|
Public Abstract getFeatures | ||||||||||||
getFeatures(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:69
|
||||||||||||
Parameters :
Returns :
Observable<Feature[]>
|
Public Abstract getOffering | |||||||||||||||
getOffering(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:68
|
|||||||||||||||
Parameters :
Returns :
Observable<Offering>
|
Public Abstract getOfferings | ||||||||||||
getOfferings(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:67
|
||||||||||||
Parameters :
Returns :
Observable<Offering[]>
|
Public Abstract getPhenomena | ||||||||||||
getPhenomena(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:65
|
||||||||||||
Parameters :
Returns :
Observable<Phenomenon[]>
|
Public Abstract getPhenomenon | |||||||||||||||
getPhenomenon(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:66
|
|||||||||||||||
Parameters :
Returns :
Observable<Phenomenon>
|
Public Abstract getPlatform | |||||||||||||||
getPlatform(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:48
|
|||||||||||||||
Parameters :
Returns :
Observable<Platform>
|
Public Abstract getPlatforms | ||||||||||||
getPlatforms(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:47
|
||||||||||||
Parameters :
Returns :
Observable<Platform[]>
|
Public Abstract getProcedure | |||||||||||||||
getProcedure(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:72
|
|||||||||||||||
Parameters :
Returns :
Observable<Procedure>
|
Public Abstract getProcedures | ||||||||||||
getProcedures(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:71
|
||||||||||||
Parameters :
Returns :
Observable<Procedure[]>
|
Public Abstract getService | |||||||||||||||
getService(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:54
|
|||||||||||||||
Parameters :
Returns :
Observable<Service>
|
Public Abstract getServices | ||||||||||||
getServices(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:53
|
||||||||||||
Parameters :
Returns :
Observable<Service[]>
|
Public Abstract getSingleTimeseries | |||||||||||||||
getSingleTimeseries(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:59
|
|||||||||||||||
Parameters :
Returns :
Observable<Timeseries>
|
Public Abstract getSingleTimeseriesByInternalId | ||||||||||||
getSingleTimeseriesByInternalId(internalId: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:60
|
||||||||||||
Parameters :
Returns :
Observable<Timeseries>
|
Public Abstract getStation | |||||||||||||||
getStation(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:56
|
|||||||||||||||
Parameters :
Returns :
Observable<Station>
|
Public Abstract getStations | ||||||||||||
getStations(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:55
|
||||||||||||
Parameters :
Returns :
Observable<Station[]>
|
Public Abstract getTimeseries | ||||||||||||
getTimeseries(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||
Defined in
DatasetImplApiInterface:57
|
||||||||||||
Parameters :
Returns :
Observable<Timeseries[]>
|
Public Abstract getTimeseriesData | |||||||||||||||
getTimeseriesData(apiUrl: string, ids: string[], timespan: Timespan, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetImplApiInterface
|
|||||||||||||||
Defined in
DatasetImplApiInterface:58
|
|||||||||||||||
Parameters :
Returns :
Observable<TimeseriesData[]>
|
Public Abstract getTimeseriesExtras |
getTimeseriesExtras(id: string, apiUrl: string)
|
Inherited from
DatasetImplApiInterface
|
Defined in
DatasetImplApiInterface:61
|
Returns :
Observable<TimeseriesExtras>
|
Public Abstract getTsData | ||||||||||||||||||
getTsData(id: string, apiUrl: string, timespan: Timespan, params?: DataParameterFilter, options?: HttpRequestOptions)
|
||||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||||
Defined in
DatasetImplApiInterface:62
|
||||||||||||||||||
Type parameters :
|
||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Protected prepareParams | ||||||
prepareParams(params: ParameterFilter)
|
||||||
Inherited from
DatasetImplApiInterface
|
||||||
Defined in
DatasetImplApiInterface:85
|
||||||
Parameters :
Returns :
HttpParams
|
Protected requestApi | ||||||||||||||||
requestApi(url: string, params: ParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||
Inherited from
DatasetImplApiInterface
|
||||||||||||||||
Defined in
DatasetImplApiInterface:74
|
||||||||||||||||
Type parameters :
|
||||||||||||||||
Parameters :
Returns :
Observable<T>
|
Protected createBasicAuthHeader | ||||||
createBasicAuthHeader(token: string)
|
||||||
Inherited from
DatasetImplApiInterface
|
||||||
Defined in
DatasetImplApiInterface:19
|
||||||
Parameters :
Returns :
HttpHeaders
|
Protected createRequestTimespan | ||||||
createRequestTimespan(timespan: Timespan)
|
||||||
Inherited from
DatasetImplApiInterface
|
||||||
Defined in
DatasetImplApiInterface:15
|
||||||
Parameters :
Returns :
string
|
Protected createRequestUrl |
createRequestUrl(apiUrl: string, endpoint: string, id?: string)
|
Inherited from
DatasetImplApiInterface
|
Defined in
DatasetImplApiInterface:8
|
Returns :
string
|
Protected createBasicAuthHeader | ||||||
createBasicAuthHeader(token: string)
|
||||||
Inherited from
DatasetImplApiInterface
|
||||||
Defined in
DatasetImplApiInterface:19
|
||||||
Parameters :
Returns :
HttpHeaders
|
Protected createRequestTimespan | ||||||
createRequestTimespan(timespan: Timespan)
|
||||||
Inherited from
DatasetImplApiInterface
|
||||||
Defined in
DatasetImplApiInterface:15
|
||||||
Parameters :
Returns :
string
|
Protected createRequestUrl |
createRequestUrl(apiUrl: string, endpoint: string, id?: string)
|
Inherited from
DatasetImplApiInterface
|
Defined in
DatasetImplApiInterface:8
|
Returns :
string
|
Public Abstract getCategories | ||||||||||||
getCategories(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:63
|
||||||||||||
Parameters :
Returns :
Observable<Category[]>
|
Public Abstract getCategory | |||||||||||||||
getCategory(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:64
|
|||||||||||||||
Parameters :
Returns :
Observable<Category>
|
Public Abstract getData | ||||||||||||||||||
getData(id: string, apiUrl: string, timespan: Timespan, params?: DataParameterFilter, options?: HttpRequestOptions)
|
||||||||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||||||||
Defined in
DatasetApiInterface:52
|
||||||||||||||||||
Type parameters :
|
||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Public Abstract getDataset | |||||||||||||||
getDataset(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:50
|
|||||||||||||||
Parameters :
Returns :
Observable<Dataset>
|
Public Abstract getDatasetByInternalId | ||||||||||||
getDatasetByInternalId(internalId: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:51
|
||||||||||||
Parameters :
Returns :
Observable<Dataset>
|
Public Abstract getDatasets | ||||||||||||
getDatasets(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:49
|
||||||||||||
Parameters :
Returns :
Observable<Dataset[]>
|
Public Abstract getFeature | |||||||||||||||
getFeature(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:70
|
|||||||||||||||
Parameters :
Returns :
Observable<Feature>
|
Public Abstract getFeatures | ||||||||||||
getFeatures(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:69
|
||||||||||||
Parameters :
Returns :
Observable<Feature[]>
|
Public Abstract getOffering | |||||||||||||||
getOffering(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:68
|
|||||||||||||||
Parameters :
Returns :
Observable<Offering>
|
Public Abstract getOfferings | ||||||||||||
getOfferings(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:67
|
||||||||||||
Parameters :
Returns :
Observable<Offering[]>
|
Public Abstract getPhenomena | ||||||||||||
getPhenomena(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:65
|
||||||||||||
Parameters :
Returns :
Observable<Phenomenon[]>
|
Public Abstract getPhenomenon | |||||||||||||||
getPhenomenon(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:66
|
|||||||||||||||
Parameters :
Returns :
Observable<Phenomenon>
|
Public Abstract getPlatform | |||||||||||||||
getPlatform(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:48
|
|||||||||||||||
Parameters :
Returns :
Observable<Platform>
|
Public Abstract getPlatforms | ||||||||||||
getPlatforms(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:47
|
||||||||||||
Parameters :
Returns :
Observable<Platform[]>
|
Public Abstract getProcedure | |||||||||||||||
getProcedure(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:72
|
|||||||||||||||
Parameters :
Returns :
Observable<Procedure>
|
Public Abstract getProcedures | ||||||||||||
getProcedures(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:71
|
||||||||||||
Parameters :
Returns :
Observable<Procedure[]>
|
Public Abstract getService | |||||||||||||||
getService(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:54
|
|||||||||||||||
Parameters :
Returns :
Observable<Service>
|
Public Abstract getServices | ||||||||||||
getServices(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:53
|
||||||||||||
Parameters :
Returns :
Observable<Service[]>
|
Public Abstract getSingleTimeseries | |||||||||||||||
getSingleTimeseries(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:59
|
|||||||||||||||
Parameters :
Returns :
Observable<Timeseries>
|
Public Abstract getSingleTimeseriesByInternalId | ||||||||||||
getSingleTimeseriesByInternalId(internalId: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:60
|
||||||||||||
Parameters :
Returns :
Observable<Timeseries>
|
Public Abstract getStation | |||||||||||||||
getStation(id: string, apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:56
|
|||||||||||||||
Parameters :
Returns :
Observable<Station>
|
Public Abstract getStations | ||||||||||||
getStations(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:55
|
||||||||||||
Parameters :
Returns :
Observable<Station[]>
|
Public Abstract getTimeseries | ||||||||||||
getTimeseries(apiUrl: string, params?: ParameterFilter, options?: HttpRequestOptions)
|
||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||
Defined in
DatasetApiInterface:57
|
||||||||||||
Parameters :
Returns :
Observable<Timeseries[]>
|
Public Abstract getTimeseriesData | |||||||||||||||
getTimeseriesData(apiUrl: string, ids: string[], timespan: Timespan, options?: HttpRequestOptions)
|
|||||||||||||||
Inherited from
DatasetApiInterface
|
|||||||||||||||
Defined in
DatasetApiInterface:58
|
|||||||||||||||
Parameters :
Returns :
Observable<TimeseriesData[]>
|
Public Abstract getTimeseriesExtras |
getTimeseriesExtras(id: string, apiUrl: string)
|
Inherited from
DatasetApiInterface
|
Defined in
DatasetApiInterface:61
|
Returns :
Observable<TimeseriesExtras>
|
Public Abstract getTsData | ||||||||||||||||||
getTsData(id: string, apiUrl: string, timespan: Timespan, params?: DataParameterFilter, options?: HttpRequestOptions)
|
||||||||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||||||||
Defined in
DatasetApiInterface:62
|
||||||||||||||||||
Type parameters :
|
||||||||||||||||||
Parameters :
Returns :
Observable<Data<T>>
|
Protected prepareParams | ||||||
prepareParams(params: ParameterFilter)
|
||||||
Inherited from
DatasetApiInterface
|
||||||
Defined in
DatasetApiInterface:85
|
||||||
Parameters :
Returns :
HttpParams
|
Protected requestApi | ||||||||||||||||
requestApi(url: string, params: ParameterFilter, options: HttpRequestOptions)
|
||||||||||||||||
Inherited from
DatasetApiInterface
|
||||||||||||||||
Defined in
DatasetApiInterface:74
|
||||||||||||||||
Type parameters :
|
||||||||||||||||
Parameters :
Returns :
Observable<T>
|
Protected createBasicAuthHeader | ||||||
createBasicAuthHeader(token: string)
|
||||||
Inherited from
DatasetApiInterface
|
||||||
Defined in
DatasetApiInterface:19
|
||||||
Parameters :
Returns :
HttpHeaders
|
Protected createRequestTimespan | ||||||
createRequestTimespan(timespan: Timespan)
|
||||||
Inherited from
DatasetApiInterface
|
||||||
Defined in
DatasetApiInterface:15
|
||||||
Parameters :
Returns :
string
|
Protected createRequestUrl |
createRequestUrl(apiUrl: string, endpoint: string, id?: string)
|
Inherited from
DatasetApiInterface
|
Defined in
DatasetApiInterface:8
|
Returns :
string
|
Protected createBasicAuthHeader | ||||||
createBasicAuthHeader(token: string)
|
||||||
Inherited from
ApiInterface
|
||||||
Defined in
ApiInterface:19
|
||||||
Parameters :
Returns :
HttpHeaders
|
Protected createRequestTimespan | ||||||
createRequestTimespan(timespan: Timespan)
|
||||||
Inherited from
ApiInterface
|
||||||
Defined in
ApiInterface:15
|
||||||
Parameters :
Returns :
string
|
Protected createRequestUrl |
createRequestUrl(apiUrl: string, endpoint: string, id?: string)
|
Inherited from
ApiInterface
|
Defined in
ApiInterface:8
|
Returns :
string
|
import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import moment from 'moment';
import { forkJoin, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Data } from '../model/dataset-api/data';
import { DataParameterFilter, HttpRequestOptions } from '../model/internal/http-requests';
import { Timespan } from '../model/internal/timeInterval';
import { DatasetImplApiInterface } from './dataset-impl-api-interface.service';
import { HttpService } from './http.service';
import { InternalIdHandler } from './internal-id-handler.service';
@Injectable()
export class SplittedDataDatasetApiInterface extends DatasetImplApiInterface {
constructor(
protected httpservice: HttpService,
protected internalDatasetId: InternalIdHandler,
protected translate: TranslateService
) {
super(httpservice, internalDatasetId, translate);
}
public getTsData<T>(
id: string,
apiUrl: string,
timespan: Timespan,
params: DataParameterFilter = {},
options: HttpRequestOptions
): Observable<Data<T>> {
const maxTimeExtent = moment.duration(1, 'year').asMilliseconds();
if ((timespan.to - timespan.from) > maxTimeExtent) {
const requests: Array<Observable<Data<T>>> = [];
let start = moment(timespan.from).startOf('year');
let end = moment(timespan.from).endOf('year');
while (start.isBefore(moment(timespan.to))) {
const chunkSpan = new Timespan(start.unix() * 1000, end.unix() * 1000);
requests.push(super.getTsData<T>(id, apiUrl, chunkSpan, params, options));
start = end.add(1, 'millisecond');
end = moment(start).endOf('year');
}
return forkJoin(requests).pipe(map((e) => {
const mergedResult = e.reduce((previous, current) => {
const next: Data<T> = {
referenceValues: {},
values: []
};
if (previous.values && current.values) {
next.values = previous.values.concat(current.values);
}
if (previous.valueBeforeTimespan) {
next.valueBeforeTimespan = previous.valueBeforeTimespan;
}
if (current.valueAfterTimespan) {
next.valueAfterTimespan = current.valueAfterTimespan;
}
for (const key in previous.referenceValues) {
if (previous.referenceValues.hasOwnProperty(key) && current.referenceValues.hasOwnProperty(key)) {
const refVal = previous.referenceValues[key];
if (refVal instanceof Array) {
next.referenceValues[key] = refVal.concat(current.referenceValues[key]);
} else {
const currRefValData = (current.referenceValues[key] as never) as Data<T>;
const prevRefValData = (refVal as Data<T>);
const nextRefValData: Data<T> = {
referenceValues: {},
values: []
};
if (prevRefValData.values && currRefValData.values) {
nextRefValData.values = prevRefValData.values.concat(currRefValData.values);
}
if (prevRefValData.valueBeforeTimespan) {
nextRefValData.valueBeforeTimespan = prevRefValData.valueBeforeTimespan;
}
if (currRefValData.valueAfterTimespan) {
nextRefValData.valueAfterTimespan = currRefValData.valueAfterTimespan;
}
next.referenceValues[key] = nextRefValData as never;
}
}
}
return next;
});
if (mergedResult.values && mergedResult.values.length > 0) {
// cut first
const fromIdx = mergedResult.values.findIndex(el => el[0] >= timespan.from);
mergedResult.values = mergedResult.values.slice(fromIdx);
// cut last
const toIdx = mergedResult.values.findIndex(el => el[0] >= timespan.to);
if (toIdx >= 0) { mergedResult.values = mergedResult.values.slice(0, toIdx + 1); }
}
return mergedResult;
}));
} else {
return super.getTsData<T>(id, apiUrl, timespan, params, options);
}
}
public getData<T>(
id: string,
apiUrl: string,
timespan: Timespan,
params: DataParameterFilter = {},
options: HttpRequestOptions
) {
const maxTimeExtent = moment.duration(1, 'year').asMilliseconds();
if ((timespan.to - timespan.from) > maxTimeExtent) {
const requests: Array<Observable<Data<T>>> = [];
let start = moment(timespan.from).startOf('year');
let end = moment(timespan.from).endOf('year');
while (start.isBefore(moment(timespan.to))) {
const chunkSpan = new Timespan(start.unix() * 1000, end.unix() * 1000);
requests.push(super.getData<T>(id, apiUrl, chunkSpan, params, options));
start = end.add(1, 'millisecond');
end = moment(start).endOf('year');
}
return forkJoin(requests).pipe(map((e) => {
const mergedResult = e.reduce((previous, current) => {
const next: Data<T> = {
referenceValues: {},
values: []
};
if (previous.values && current.values) {
next.values = previous.values.concat(current.values);
}
if (previous.valueBeforeTimespan) {
next.valueBeforeTimespan = previous.valueBeforeTimespan;
}
if (current.valueAfterTimespan) {
next.valueAfterTimespan = current.valueAfterTimespan;
}
for (const key in previous.referenceValues) {
if (previous.referenceValues.hasOwnProperty(key) && current.referenceValues.hasOwnProperty(key)) {
const refVal = previous.referenceValues[key];
if (refVal instanceof Array) {
next.referenceValues[key] = refVal.concat(current.referenceValues[key]);
} else {
const currRefValData = (current.referenceValues[key] as never) as Data<T>;
const prevRefValData = (refVal as Data<T>);
const nextRefValData: Data<T> = {
referenceValues: {},
values: []
};
if (prevRefValData.values && currRefValData.values) {
nextRefValData.values = prevRefValData.values.concat(currRefValData.values);
}
if (prevRefValData.valueBeforeTimespan) {
nextRefValData.valueBeforeTimespan = prevRefValData.valueBeforeTimespan;
}
if (currRefValData.valueAfterTimespan) {
nextRefValData.valueAfterTimespan = currRefValData.valueAfterTimespan;
}
next.referenceValues[key] = nextRefValData as never;
}
}
}
return next;
});
if (mergedResult.values && mergedResult.values.length > 0) {
// cut first
const fromIdx = mergedResult.values.findIndex(el => el[0] >= timespan.from);
mergedResult.values = mergedResult.values.slice(fromIdx);
// cut last
const toIdx = mergedResult.values.findIndex(el => el[0] >= timespan.to);
if (toIdx >= 0) { mergedResult.values = mergedResult.values.slice(0, toIdx + 1); }
}
return mergedResult;
}));
} else {
return super.getData<T>(id, apiUrl, timespan, params, options);
}
}
}