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.

Parameters
  • domain – Domain to search metadata. May be empty srting.

Returns

Dictionary of key-value.

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

Set catalog object metadata.

Parameters
  • name – Key name.

  • value – Key value.

  • domain – Domain name.

Returns

True on success.

func isSame(_ object:Object) Bool

Compare current catalog object with other.

Parameters
  • object – Catalog object to compare.

Returns

True if equal.

func children() [Object]

Get catalog object children.

Returns

Array of catalog object class instances.

func child(name: String) Object?

Get child by name.

Parameters
  • name – Catalog object child name.

Returns

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.

Parameters
  • 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

Returns

Created catalog object instance or nil.

func createTMS()

Create TMS datasource

Parameters
  • 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

Returns

Catalog object or nil

func createDirectory(name: String) Object?

Create new directory.

Parameters
  • name – Directory name.

Returns

Created directory or nil.

func delete() Bool

Delete catalog object.

Returns

True on success.

func delete(name: String) Bool

Delete catalog object with name.

Parameters
  • name – Object name to delete.

Returns

True on success.

func copy()

Copy current catalog object to destination object.

Parameters
  • 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.

Returns

True on success.

static func isTable(_ type:Int) Bool

Check if type is non spatial table.

Parameters
  • type – Type to check.

Returns

True if this type belongs to table types.

static func isRaster(_ type:Int) Bool

Check if type is raster.

Parameters
  • type – Type to check.

Returns

True if this type belongs to raster types.

static func isFeatureClass(_ type:Int) Bool

Check if type is featureclass.

Parameters
  • type – Type to check.

Returns

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).

Parameters
  • type – Type to check.

Returns

True if this type belongs to container types.

static func forceChildTo(table: Object) Table?

Force catalog object instance to table.

Parameters
  • table – Catalog object instance.

Returns

Table class instance or nil.

static func forceChildTo(featureClass: Object) FeatureClass?

Force catalog object instance to featureclass.

Parameters
  • featureClass – Catalog object instance.

Returns

FeatureClass class instance or nil.

static func forceChildTo(raster: Object) Raster?

Force catalog object instance to raster.

Parameters
  • raster – Catalog object instance.

Returns

Raster class instance or nil.

static func forceChildTo(memoryStore: Object) MemoryStore?

Force catalog object instance to memory store.

Parameters
  • memoryStore – Catalog object instance.

Returns

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

Returns

Get current directory. This is file system path

func childByPath(path: String) Object?

Get catalog child by file system path.

Parameters
  • path – File system path.

Returns

Catalog object class instance or nil.