org.gdal.gdal.gdal.OpenShared()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.gdal.gdal.gdal.OpenShared()方法的一些代码示例,展示了gdal.OpenShared()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。gdal.OpenShared()方法的具体详情如下:
包路径:org.gdal.gdal.gdal
类名称:gdal
方法名:OpenShared

gdal.OpenShared介绍

暂无

代码示例

代码示例来源:origin: io.jeo/jeo-gdal

@Override
protected GDALDataset open(File file, Map<?, Object> opts) throws IOException {
  Dataset ds = gdal.OpenShared(file.getAbsolutePath());
  if (ds == null) {
    String lastErrMsg = gdal.GetLastErrorMsg();
    String msg = "Unable to open file: " + file;
    if (lastErrMsg != null) {
      msg += ", " + lastErrMsg;
    }
    throw new IOException(msg);
  }
  return new GDALDataset(file, ds, this);
}

代码示例来源:origin: deegree/deegree3

Map<String, TileDataSet> buildTileDataSetMap()
            throws IOException, UnknownCRSException {
  Map<String, TileDataSet> map = new HashMap<String, TileDataSet>();
  for ( GdalTileStoreJaxb.TileDataSet tds : cfg.getTileDataSet() ) {
    String id = tds.getIdentifier();
    if ( id == null ) {
      id = new File( tds.getFile() ).getName();
    }
    File file = location.resolveToFile( tds.getFile() );
    if ( !file.exists() ) {
      LOG.warn( "File {} does not exist, skipping.", file );
      continue;
    }
    Dataset gdalDataset = gdal.OpenShared( file.toString() );
    try {
      // TODO
      Envelope env = GdalUtils.getEnvelopeAndCrs( gdalDataset, "EPSG:28992" ).getEnvelope();
      if ( env == null ) {
        throw new ResourceInitException( "No envelope information could be read via GDAL." );
      }
      LOG.debug( "Envelope from GDAL was {}.", env );
      map.put( id, builder.buildTileDataSet( tds, location, env ) );
    } finally {
      gdalDataset.delete();
    }
  }
  return map;
}

代码示例来源:origin: deegree/deegree3

throw new ResourceInitException( "File " + file + " does not exist." );
Dataset gdalDataset = gdal.OpenShared( file.toString() );
try {
  SpatialMetadata envelopeAndCrs = getEnvelopeAndCrs( gdalDataset, cfg.getStorageCRS() );

相关文章