Angular 14 - read data from a gz file but reading gibberish unless gunzip the file at the command line beforehand

Viewed 8

radarFiles: string = '/assets/data/CASSR_202005200000_1440_60_PA_PRECIP_1HOURLY.meta.gz'; // radarFiles: string = '/assets/data/CASSR_202005200000_1440_60_PA_DPQPE_1HOURLY.meta';

processRadarData() {

const httpOptions: Object = {
  headers: new HttpHeaders({
    'Content-Type': 'application/gzip',
    'Content-Encoding': 'gzip'
  }),
  responseType: 'text'
};
this.httpClient.get( this.radarFiles, httpOptions ).subscribe(
  res => {
    console.log('Result:', res);

  },
);

}

Result: ����vs�^��CASSR_202005200000_1440_60_PA_PRECIP_1HOURLY.meta���]�,Ǚ�

After gunzip the file at the command line... Result: MajorProductType RADAR ValidTime 202005200000 Title PA RevisionDate 2010-12-08b DataType GeoReferencedField FieldType Range,Theta

0 Answers
Related