本文整理汇总了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;
}
示例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
}
}
示例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();
}
}