GeoPackage.withFileUri constructor

GeoPackage.withFileUri(
  1. Uri fileUri
)

Creates a GeoPackage from the GeoPackage file (.gpkg) at the given path.

Parameters:

  • fileUri — Path to a GeoPackage file (.gpkg).

Implementation

factory GeoPackage.withFileUri(Uri fileUri) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreFileUri = _CString(fileUri.toFilePath());
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeoPackage_createWithPath(
        coreFileUri.bytes, errorHandler);
  });
  final GeoPackage object = GeoPackage._instanceCache.instanceWith(handle);
  object._fileUri.cache(fileUri);
  return object;
}