Documentation for MapLib/Feature.swift

class Feature

Feature or row from featureclass or table.

let table : Table?

FeatureClass or Table class instance.

var id : Int64

Feature/row identificator.

var geometry : Geometry?

Feature/row geometry.

var remoteId : Int64

Feature/row remote identificator or -1.

func isFieldSet(index: Int32) Bool

Check if field set.

Parameters
  • index – Field index.

Returns

True if field set.

func getField(asInteger index:Int32) Int32

Get field value.

Parameters
  • index – Field index.

Returns

Field value.

func getField(asDouble index:Int32) Double

Get field value.

Parameters
  • index – Field index.

Returns

Field value.

func getField(asString index:Int32) String

Get field value.

Parameters
  • index – Field index.

Returns

Field value.

func getField(asDateTime index:Int32) Date

Get field value.

Parameters
  • index – Field index.

Returns

Field value.

func setField(for index:Int32, string value:String)

Set field value.

Parameters
  • index – Fieldd index.

  • value – Value to set.

func setField(for index:Int32, double value:Double)

Set field value.

Parameters
  • index – Fieldd index.

  • value – Value to set.

func setField(for index:Int32, int value:Int32)

Set field value.

Parameters
  • index – Fieldd index.

  • value – Value to set.

func setField(for index:Int32, date value:Date)

Set field value.

Parameters
  • index – Fieldd index.

  • value – Value to set.

func createGeometry() Geometry?

Create new geometry. The type of geometry will be coresspondent feature class.

Returns

Geometry class instance or nil.

func getAttachment(aid: Int64) Attachment?

Get attachment.

Parameters
  • aid – Attachment identificator.

Returns

Attachment class instance or nil.

func getAttachments() [Attachment]

Get all attachments.

Returns

Attachment array.

func addAttachment()

Add new attachment.

Parameters
  • name – Name.

  • description – Description text.

  • path – File system path.

  • move – If true the attachment file will be

  • remoteId – Remote identificator.

  • logEdits – Log edits in history table. This log can be received using editOperations function.

Returns

New attachment identificator.

func deleteAttachment(aid: Int64, logEdits: Bool = true) Bool

Delete attachment.

Parameters
  • aid – Attachment identificator.

  • logEdits – Log edits in history table. This log can be received using editOperations function.

Returns

True on success.

func deleteAttachment(attachment: Attachment, logEdits: Bool = true) Bool

Delete attachment.

Parameters
  • attachment – Attachment class instance.

  • logEdits – Log edits in history table. This log can be received using editOperations function.

Returns

True on success.

func delete() Bool

Delete feature.

Returns

True on success.

class Attachment

Attachment class. File adde to the feature/row

let name : String

Attachment name.

let description : String

Attachment description.

let path : String

File system path to attachmetn if exists.

let size : Int64

Attachment file size in bytes.

var remoteId : Int64

Remote identificator read/write property.

func isFileAvailable() Bool

Is attachment file available on disk.

Returns

True of file exists.

func update(name: String, description: String, logEdits: Bool = true) Bool

Update attachment. Only name and description can be updated. To change attchment file, just delete attachment and create new one.

Parameters
  • name – New attachment name.

  • description – New attachment description.

  • logEdits – Log edits in history table. This log can be received using editOperations function.

Returns

True on success.