ClosestFacilityTask.withGeodatabase constructor

ClosestFacilityTask.withGeodatabase(
  1. {required Uri databaseFileUri,
  2. required String networkName}
)

Creates a closest facility task with path to geodatabase.

Parameters:

  • databaseFileUri — A path to geodatabase.
  • networkName — A network name.

Implementation

factory ClosestFacilityTask.withGeodatabase(
    {required Uri databaseFileUri, required String networkName}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreDatabaseFileUri = _CString(databaseFileUri.toFilePath());
  final coreNetworkName = _CString(networkName);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ClosestFacilityTask_createWithGeodatabase(
        coreDatabaseFileUri.bytes, coreNetworkName.bytes, errorHandler);
  });
  return ClosestFacilityTask._withHandle(handle);
}