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.

Параметры
  • index – Field index.

Результат

True if field set.

func getField(asInteger index:Int32) Int32

Get field value.

Параметры
  • index – Field index.

Результат

Field value.

func getField(asDouble index:Int32) Double

Get field value.

Параметры
  • index – Field index.

Результат

Field value.

func getField(asString index:Int32) String

Get field value.

Параметры
  • index – Field index.

Результат

Field value.

func getField(asDateTime index:Int32) Date

Get field value.

Параметры
  • index – Field index.

Результат

Field value.

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

Set field value.

Параметры
  • index – Fieldd index.

  • value – Value to set.

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

Set field value.

Параметры
  • index – Fieldd index.

  • value – Value to set.

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

Set field value.

Параметры
  • index – Fieldd index.

  • value – Value to set.

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

Set field value.

Параметры
  • index – Fieldd index.

  • value – Value to set.

func createGeometry() Geometry?

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

Результат

Geometry class instance or nil.

func getAttachment(aid: Int64) Attachment?

Get attachment.

Параметры
  • aid – Attachment identificator.

Результат

Attachment class instance or nil.

func getAttachments() [Attachment]

Get all attachments.

Результат

Attachment array.

func addAttachment()

Add new attachment.

Параметры
  • 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.

Результат

New attachment identificator.

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

Delete attachment.

Параметры
  • aid – Attachment identificator.

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

Результат

True on success.

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

Delete attachment.

Параметры
  • attachment – Attachment class instance.

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

Результат

True on success.

func delete() Bool

Delete feature.

Результат

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.

Результат

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.

Параметры
  • name – New attachment name.

  • description – New attachment description.

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

Результат

True on success.