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


Java DataSource.delete方法代码示例

本文整理汇总了Java中org.gdal.ogr.DataSource.delete方法的典型用法代码示例。如果您正苦于以下问题:Java DataSource.delete方法的具体用法?Java DataSource.delete怎么用?Java DataSource.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gdal.ogr.DataSource的用法示例。


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

示例1: createDataSource

import org.gdal.ogr.DataSource; //导入方法依赖的package包/类
public static DataSource createDataSource(final List<Node>       nodes,
                                          final List<Edge>       edges,
                                          final SpatialReference sourceSpatialReference)
{
   final DataSource dataSource = ogr.GetDriverByName("Memory")
                                     .CreateDataSource("vector data");

    try
    {
        final Layer edgeLayer = createEdgeLayer(dataSource,
                                                nodes,
                                                edges,
                                                sourceSpatialReference);
    }
    catch(final Throwable th)
    {
        dataSource.delete();
        throw th;
    }

    return dataSource;
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:23,代码来源:Utility.java

示例2: calculateAndWriteTerrainFactors

import org.gdal.ogr.DataSource; //导入方法依赖的package包/类
public static void calculateAndWriteTerrainFactors(final File                      terrainFactors,
                                                   final File                      output,
                                                   final List<Node>                nodes,
                                                   final List<Edge>                edges,
                                                   final CoordinateReferenceSystem coordinateReferenceSystem)
{
    final SpatialReference sourceSpatialReference = GdalUtility.createSpatialReference(coordinateReferenceSystem);

    final DataSource dataSource = Utility.createDataSource(nodes,
                                                           edges,
                                                           sourceSpatialReference);
    try
    {

    }
    finally
    {
        dataSource.delete();    // Also destroys edgeLayer
    }
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:21,代码来源:RoutingNetworkTerrainFactors.java

示例3: write

import org.gdal.ogr.DataSource; //导入方法依赖的package包/类
@Override
public void write(final List<Node>                nodes,
                  final List<Edge>                edges,
                  final NodeDimensionality        nodeDimensionality,        // not used
                  final List<Pair<String, Type>>  nodeAttributeDescriptions, // not used
                  final List<Pair<String, Type>>  edgeAttributeDescriptions, // not used
                  final CoordinateReferenceSystem coordinateReferenceSystem) throws RoutingNetworkStoreException
{
    final SpatialReference sourceSpatialReference;

    try
    {
        sourceSpatialReference = GdalUtility.createSpatialReference(coordinateReferenceSystem);
    }
    catch(final RuntimeException ex)
    {
        throw new RoutingNetworkStoreException(ex);
    }

    final Dataset rasterDataset = this.createRaster(sourceSpatialReference);

    try
    {
        final DataSource dataSource = Utility.createDataSource(nodes,
                                                               edges,
                                                               sourceSpatialReference);
        try
        {
            final int rasterizeError = gdal.RasterizeLayer(rasterDataset,
                                                           new int[]{1, 2, 3, 4},
                                                           dataSource.GetLayer(0),
                                                           new double[]{ this.foreground.getRed(),
                                                                         this.foreground.getGreen(),
                                                                         this.foreground.getBlue(),
                                                                         this.foreground.getAlpha()
                                                                       },
                                                           null,                    // "options" vector. valid choices are described here: http://gdal.org/gdal__alg_8h.html#adfe5e5d287d6c184aab03acbfa567cb1
                                                           this.progressCallback);

            if(rasterizeError != gdalconstConstants.CE_None)
            {
                throw new RuntimeException(new GdalError().getMessage());
            }
        }
        finally
        {
            dataSource.delete();    // Also destroys edgeLayer
        }
    }
    finally
    {
        rasterDataset.delete();
    }
}
 
开发者ID:GitHubRGI,项目名称:swagd,代码行数:55,代码来源:ImageRoutingNetworkStoreWriter.java


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