当前位置: 首页>>代码示例>>Java>>正文


Java FeatureType类代码示例

本文整理汇总了Java中ucar.nc2.constants.FeatureType的典型用法代码示例。如果您正苦于以下问题:Java FeatureType类的具体用法?Java FeatureType怎么用?Java FeatureType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FeatureType类属于ucar.nc2.constants包,在下文中一共展示了FeatureType类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loopthroughtraj

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
/**
 * This doesn't really do anything, but it shows how to access trajectories via the Java netCDF library.  Looping through the whole thing is pretty slow.
 * @param netcdfFilename
 * @param temp_file1
 * @param temp_file2
 * @throws IOException
 */
public void loopthroughtraj(String netcdfFilename, File temp_file1, File temp_file2) throws IOException {
    Formatter errlog = new Formatter();
    FeatureDatasetPoint trajset1 = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.TRAJECTORY, temp_file1.getAbsolutePath(), null, errlog);
    List<DataRow> rows1 = getFeatures(trajset1);
    FeatureDatasetPoint trajset2 = (FeatureDatasetPoint) FeatureDatasetFactoryManager.open(FeatureType.TRAJECTORY, temp_file2.getAbsolutePath(), null, errlog);       
    List<DataRow> rows2 = getFeatures(trajset2);
    trajset1.close();
    trajset2.close();
    List<DataRow> datarows = new ArrayList<DataRow>();
    datarows.addAll(rows1);
    datarows.addAll(rows2);
    Collections.sort(datarows, new DataRowComparator());
    for (Iterator dataIT = datarows.iterator(); dataIT.hasNext();) {
        DataRow dataRow = (DataRow) dataIT.next();
        System.out.println(dataRow.getId() + "   " + dataRow.getData().get(time));
    }
    
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:26,代码来源:TabledapTool.java

示例2: testTimeSeries

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
@Test
public void testTimeSeries() throws OwsExceptionReport, UnitCreationException, IOException{
    for (File netcdf : makeNetcdfRequest(Phenomena.instance().AIR_TEMPERATURE)) {
        FeatureDataset featureDataset = verifyNetcdfFile(netcdf, FeatureType.STATION);
        NetcdfFile netcdfFile = featureDataset.getNetcdfFile();
        assertEquals(2, netcdfFile.getDimensions().size());
    }
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:9,代码来源:AbstractIoosNetcdfEncoderTest.java

示例3: testTimeSeriesProfile

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
@Test
public void testTimeSeriesProfile() throws OwsExceptionReport, UnitCreationException, IOException{
    for (File netcdf : makeNetcdfRequest(Phenomena.instance().SEA_WATER_TEMPERATURE)) {
        FeatureDataset featureDataset = verifyNetcdfFile(netcdf, FeatureType.STATION_PROFILE);
        NetcdfFile netcdfFile = featureDataset.getNetcdfFile();
        assertEquals(3, netcdfFile.getDimensions().size());
        verifyHeightAxis(netcdfFile, 20, -95.0, 0.0);            
    }
}
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:10,代码来源:AbstractIoosNetcdfEncoderTest.java

示例4: verifyNetcdfFile

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
private FeatureDataset verifyNetcdfFile(File netcdfFile, FeatureType featureType) throws IOException {        
        FeatureDataset featureDataset = null;
        Formatter errlog = new Formatter();
        try {
            featureDataset = FeatureDatasetFactoryManager.open(featureType, netcdfFile.getAbsolutePath(), null, errlog);
        } catch (IOException e) {
            LOGGER.error(errlog.toString());
            throw e;
        }
        if (!errlog.toString().trim().isEmpty()) {
            fail(errlog.toString());
        }
        assertTrue(featureDataset.getFeatureType().equals(featureType));
        assertThat(featureDataset, instanceOf(FeatureDatasetPoint.class));

        NetcdfDataset netcdfDataset = NetcdfDataset.wrap(featureDataset.getNetcdfFile(), Sets.newHashSet(Enhance.CoordSystems));

        //make sure that the feature type found by FDFM (via cdm_feature_type) is the same as the expected feature type
        assertEquals(featureType, FeatureDatasetFactoryManager.findFeatureType(netcdfDataset));
        
        //verify that axes is increasing
        List<CoordinateSystem> coordinateSystems = netcdfDataset.getCoordinateSystems();
//        assertEquals(1, coordinateSystems.size());
        for (CoordinateSystem coordinateSystem : coordinateSystems) {
            for (CoordinateAxis axis : coordinateSystem.getCoordinateAxes()) {
                verifyAxisIsMonotonic(axis);
            }
        }
        
        return featureDataset;
    }
 
开发者ID:ioos,项目名称:i52n-sos,代码行数:32,代码来源:AbstractIoosNetcdfEncoderTest.java

示例5: createDataset

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
private InvDatasetImpl createDataset(InvCatalogImpl catalog, String datasetName, final String serviceName) {
    final InvDatasetImpl dapDataset =
            new InvDatasetImpl(null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc");
    dapDataset.setCatalog(catalog);
    final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant");
    dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService));
    dapDataset.finish();
    return dapDataset;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:10,代码来源:CatalogTree_setNewRootDatasetsTest.java

示例6: createDataset

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
private InvDatasetImpl createDataset(InvCatalogImpl catalog, String datasetName, final String serviceName) {
    final InvDatasetImpl dapDataset = new InvDatasetImpl(null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc");
    dapDataset.setCatalog(catalog);
    final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant");
    dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService));
    dapDataset.finish();
    return dapDataset;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:9,代码来源:CatalogTree_appendToNodeTest.java

示例7: createDataset

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
private InvDatasetImpl createDataset(String[] serviceTypeNames) throws URISyntaxException {
    final InvDatasetImpl dapDataset = new InvDatasetImpl(null, "datasetName", FeatureType.NONE, serviceTypeNames[0], "http://wherever.you.want.bc");

    final InvCatalogImpl catalog = new InvCatalogImpl("catalogName", "1.0", new URI("http://x.y"));
    dapDataset.setCatalog(catalog);

    for (String serviceName : serviceTypeNames) {
        final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant");
        final InvAccessImpl invAccess = new InvAccessImpl(dapDataset, "http://y.z", dapService);
        dapDataset.addAccess(invAccess);
    }

    dapDataset.finish();
    return dapDataset;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:16,代码来源:CatalogTree_appendNodeUnitTest.java

示例8: createDataset

import ucar.nc2.constants.FeatureType; //导入依赖的package包/类
private InvDataset createDataset(InvCatalog catalog, String datasetName, final String serviceName) {
    final InvDatasetImpl dapDataset =
            new InvDatasetImpl(null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc");
    dapDataset.setCatalog(catalog);
    final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant",
                                                 "irrelevant");
    dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService));
    dapDataset.finish();
    return dapDataset;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:11,代码来源:CatalogTree_simpleDifferentTests.java


注:本文中的ucar.nc2.constants.FeatureType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。