@Override public String GetLastErrorMsg() { return gdal.GetLastErrorMsg(); }
public GdalException() { super(gdal.GetLastErrorMsg().trim()); gdal.ErrorReset(); }
@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); }
/** * Opens a dataset for the given file in read-only mode. * * @param file the file to open. * @throws IOException if the given file can not be opened. */ public DataSet(final Path file) throws IOException { ds = gdal.Open(file.toString()); if (ds == null) { String msg = gdal.GetLastErrorMsg(); if (msg == null) { msg = "Can not open \"" + file + "\"."; } throw new GDALException(msg); } }
@Override protected boolean canOpen(File file, Map<?, Object> opts, Messages msgs) { Driver drv = gdalDrv != null ? gdalDrv : gdal.IdentifyDriver(file.getAbsolutePath()); if (drv == null) { String msg = "Unable to locate driver"; String lastErrMsg = gdal.GetLastErrorMsg(); if (lastErrMsg != null) { msg += ": " + lastErrMsg; } Messages.of(msgs).report(msg); return false; } return super.canOpen(file, opts, msgs); }
gdal.GetLastErrorMsg()).toString()); LOGGER.info(new StringBuilder("Last error number: ").append( gdal.GetLastErrorNo()).toString()); LOGGER.info(new StringBuilder("Last error type: ").append( gdal.GetLastErrorType()).toString()); throw new RuntimeException(gdal.GetLastErrorMsg());
gdal.GetLastErrorMsg()).toString()); LOGGER.info(new StringBuilder("Last error number: ").append( gdal.GetLastErrorNo()).toString()); LOGGER.info(new StringBuilder("Last error type: ").append( gdal.GetLastErrorType()).toString()); throw new RuntimeException(gdal.GetLastErrorMsg());