mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
support micaps data file with BOM using Apache commons io library
This commit is contained in:
parent
46d39b5681
commit
5fe37beab7
@ -74,6 +74,7 @@
|
||||
<orderEntry type="module" module-name="meteoinfo-dataframe" />
|
||||
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.formdev:flatlaf:2.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.formdev:flatlaf-extras:2.0.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.formdev:svgSalamander:1.1.3" level="project" />
|
||||
|
||||
@ -33,5 +33,6 @@
|
||||
<orderEntry type="module" module-name="meteoinfo-dataframe" />
|
||||
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@ -50,6 +50,11 @@
|
||||
<artifactId>juniversalchardet</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -273,6 +273,13 @@ public class MICAPS4DataInfo extends DataInfo implements IGridDataInfo {
|
||||
do {
|
||||
aLine = sr.readLine();
|
||||
if (aLine == null) {
|
||||
while (dataList.size() >= xNum) {
|
||||
for (i = 0; i < xNum; i++) {
|
||||
theData[col][i] = Float.parseFloat(dataList.get(i));
|
||||
}
|
||||
dataList = dataList.subList(xNum, dataList.size());
|
||||
col += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
aLine = aLine.trim();
|
||||
@ -374,6 +381,13 @@ public class MICAPS4DataInfo extends DataInfo implements IGridDataInfo {
|
||||
do {
|
||||
aLine = sr.readLine();
|
||||
if (aLine == null) {
|
||||
while (dataList.size() >= xNum) {
|
||||
for (i = 0; i < xNum; i++) {
|
||||
theData[col][i] = Float.parseFloat(dataList.get(i));
|
||||
}
|
||||
dataList = dataList.subList(xNum, dataList.size());
|
||||
col += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
aLine = aLine.trim();
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
*/
|
||||
package org.meteoinfo.data.meteodata.micaps;
|
||||
|
||||
import org.apache.commons.io.input.BOMInputStream;
|
||||
import org.meteoinfo.data.meteodata.MeteoDataType;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@ -45,7 +46,7 @@ public class MICAPSDataInfo {
|
||||
MeteoDataType mdType = null;
|
||||
try {
|
||||
String dataType;
|
||||
sr = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), "gbk"));
|
||||
sr = new BufferedReader(new InputStreamReader(new BOMInputStream(new FileInputStream(fileName)), "gbk"));
|
||||
String aLine;
|
||||
String[] dataArray;
|
||||
|
||||
|
||||
@ -82,6 +82,7 @@
|
||||
<orderEntry type="module" module-name="meteoinfo-dataframe" />
|
||||
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.meteothink:wContour:1.7.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.l2fprod:l2fprod-common-all:0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
|
||||
@ -83,6 +83,7 @@
|
||||
<orderEntry type="module" module-name="meteoinfo-dataframe" />
|
||||
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.formdev:flatlaf:2.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.formdev:flatlaf-extras:2.0.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.formdev:svgSalamander:1.1.3" level="project" />
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\meteo\interpolation">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\mesh"/>
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\micaps">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\isosurface"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\particles"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamslice"/>
|
||||
@ -11,22 +10,27 @@
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d_earth"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\calc"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\interpolation"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\micaps"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\calc\potential_vorticity_baroclinic.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\calc\isentropic_analysis.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\interpolation\log_interpolate_1d_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\micaps\micaps_4_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\micaps\test_read_bom.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\calc\potential_vorticity_baroclinic.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\calc\isentropic_analysis.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\interpolation\log_interpolate_1d_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\micaps\micaps_4_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\micaps\test_read_bom.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="config.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Temp\traj\Sample"/>
|
||||
<Path OpenPath="D:\Temp\micaps\test"/>
|
||||
<Font>
|
||||
<TextFont FontName="YaHei Consolas Hybrid" FontSize="14"/>
|
||||
<LegendFont FontName="宋体" FontSize="12"/>
|
||||
|
||||
@ -74,6 +74,7 @@
|
||||
<orderEntry type="module" module-name="meteoinfo-dataframe" />
|
||||
<orderEntry type="library" name="Maven: edu.ucar:netcdfAll:5.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.albfernandez:juniversalchardet:2.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.formdev:flatlaf:2.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.formdev:flatlaf-extras:2.0.1" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.formdev:svgSalamander:1.1.3" level="project" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user