Documentation for MapLib/Catalog.swift

class Object

Catalog object class. This is base class for all catalog objects.

func getMetadata(for domain:String) → [String: String]

Get catalog object metadata.

Параметры:
  • domain – Domain to search metadata. May be empty srting.
Результат:

Dictionary of key-value.

func setMetadata(item name:String, value: String, domain: String) → Bool

Set catalog object metadata.

Параметры:
  • name – Key name.
  • value – Key value.
  • domain – Domain name.
Результат:

True on success.

func isSame(_ object:Object) → Bool

Compare current catalog object with other.

Параметры:
  • object – Catalog object to compare.
Результат:

True if equal.

func children() → [Object]

Get catalog object children.

Результат:Array of catalog object class instances.
func child(name: String) → Object?

Get child by name.

Параметры:
  • name – Catalog object child name.
Результат:

Catalog object child instance or nil.

func refresh()

Refresh catalog object. Rerad children.

func create(name: String, options: [String:String] = [:]) → Object?

Create new catalog object.

Параметры:
  • name – New object name.
  • options – Dictionary describing new catalog objec. The keys are created object dependent. The mandatory key is:
  • TYPE - this is string value of type ObjectType
Результат:Created catalog object instance or nil.
func createTMS()

Create TMS datasource

Параметры:
  • name – TMS connection name
  • url – TMS url. {x}, {y} and {z} must be present in url string
  • epsg – EPSG code of TMS
  • z_min – Minimum zoom. Default is 0
  • z_max – Maximum zoom. Default is 18
  • fullExtent – Full extent of TMS datasource. Depends on tile schema and projection
  • limitExtent – Data extent. Maybe equal or less of fullExtent
  • cacheExpires – Time in seconds to remove cahced tiles
  • options – Addtional options as key: value array
Результат:

Catalog object or nil

func createDirectory(name: String) → Object?

Create new directory.

Параметры:
  • name – Directory name.
Результат:

Created directory or nil.

func delete() → Bool

Delete catalog object.

Результат:True on success.
func delete(name: String) → Bool

Delete catalog object with name.

Параметры:
  • name – Object name to delete.
Результат:

True on success.

func copy()

Copy current catalog object to destination object.

Параметры:
  • type – Output catalog object type.
  • destination – Destination catalog object.
  • move – Move object. This object will be deleted.
  • options – Key-value dictionary. This will affect how the copy will be performed.
Результат:

True on success.

static func isTable(_ type:Int) → Bool

Check if type is non spatial table.

Параметры:
  • type – Type to check.
Результат:

True if this type belongs to table types.

static func isRaster(_ type:Int) → Bool

Check if type is raster.

Параметры:
  • type – Type to check.
Результат:

True if this type belongs to raster types.

static func isFeatureClass(_ type:Int) → Bool

Check if type is featureclass.

Параметры:
  • type – Type to check.
Результат:

True if this type belongs to featureclass types.

static func isContainer(_ type:Int) → Bool

Check if type is container (catalog object which can hold other objects).

Параметры:
  • type – Type to check.
Результат:

True if this type belongs to container types.

static func forceChildTo(table: Object) → Table?

Force catalog object instance to table.

Параметры:
  • table – Catalog object instance.
Результат:

Table class instance or nil.

static func forceChildTo(featureClass: Object) → FeatureClass?

Force catalog object instance to featureclass.

Параметры:
  • featureClass – Catalog object instance.
Результат:

FeatureClass class instance or nil.

static func forceChildTo(raster: Object) → Raster?

Force catalog object instance to raster.

Параметры:
  • raster – Catalog object instance.
Результат:

Raster class instance or nil.

static func forceChildTo(memoryStore: Object) → MemoryStore?

Force catalog object instance to memory store.

Параметры:
  • memoryStore – Catalog object instance.
Результат:

MemoryStore class instance or nil.

enum ObjectType : UInt32

Catalog object type

class Catalog : Object

The catalog root object class.

func getCurrentDirectory() → String

Get current directory

Результат:Get current directory. This is file system path
func childByPath(path: String) → Object?

Get catalog child by file system path.

Параметры:
  • path – File system path.
Результат:

Catalog object class instance or nil.