Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GeoAttribCollection Interface Reference

GeoShape's attribute set. More...

Inheritance diagram for GeoAttribCollection:
[legend]

Public Member Functions

proto external int Count ()
 Total number of attributes in the collection.
 
proto external string GetName (int index)
 Gets attribute's name.
 
proto external GeoAttribType GetType (int index)
 Gets attribute's data type.
 
proto external bool IsAttribSet (int index)
 True iff the attribute has a value (is not null).
 
proto external int GetInt (int index)
 Gets an attribute's value as int.
 
proto external float GetFloat (int index)
 Gets an attribute's value as float.
 
proto external string GetString (int index)
 Gets an attribute's value as string.
 
proto external int GetIndexByName (string name)
 Gets an attribute's index by its name.
 
proto external bool HasAttrib (string name)
 
proto external bool IsAttribSetByName (string name)
 True iff the attribute exists and has a value (is not null).
 
proto external int GetIntByName (string name)
 Gets an attribute's value as int.
 
proto external float GetFloatByName (string name)
 Gets an attribute's value as float.
 
proto external string GetStringByName (string name)
 Gets an attribute's value as string.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Detailed Description

GeoShape's attribute set.

Note: For ESRI Shapefiles, all shapes in a Shapefile will have the same attributes, i.e. Count(), GetName(), GetType(), GetIndexByName() and HasAttrib() will always return the same value for all shapes in the file for a given arguments. THIS MAY NOT BE TRUE FOR OTHER FORMATS (e.g. GeoJSON).

Member Function Documentation

◆ Count()

proto external int GeoAttribCollection.Count ( )

Total number of attributes in the collection.

◆ GetFloat()

proto external float GeoAttribCollection.GetFloat ( int  index)

Gets an attribute's value as float.

Parameters
indexattribute index [0 .. count-1]
Returns
Original value if attrib's type is FLT, type-casted value if attrib's type is INT, 0 otherwise.

◆ GetFloatByName()

proto external float GeoAttribCollection.GetFloatByName ( string  name)

Gets an attribute's value as float.

Note: All *ByName(string) method versions are slower than their counterparts using attribute's index.

Parameters
nameattribute's name
Returns
Original value if attrib's type is FLT, type-casted value if attrib's type is INT, 0 if the attribute does not exist or is of another type.

◆ GetIndexByName()

proto external int GeoAttribCollection.GetIndexByName ( string  name)

Gets an attribute's index by its name.

Parameters
nameattribute's name
Returns
Attribute's index or -1 if there is no such attribute.

◆ GetInt()

proto external int GeoAttribCollection.GetInt ( int  index)

Gets an attribute's value as int.

Parameters
indexattribute index [0 .. count-1]
Returns
Original value if attrib's type is INT, floored value if attrib's type is FLT, 0 otherwise.

◆ GetIntByName()

proto external int GeoAttribCollection.GetIntByName ( string  name)

Gets an attribute's value as int.

Note: All *ByName(string) method versions are slower than their counterparts using attribute's index.

Parameters
nameattribute's name
Returns
Original value if attrib's type is INT, floored value if attrib's type is FLT, 0 if the attribute does not exist or is of another type.

◆ GetName()

proto external string GeoAttribCollection.GetName ( int  index)

Gets attribute's name.

Parameters
indexattribute index [0 .. count-1]

◆ GetString()

proto external string GeoAttribCollection.GetString ( int  index)

Gets an attribute's value as string.

Parameters
indexattribute index [0 .. count-1]
Returns
Original value if attrib's type is STR, otherwise it yields in undefined behavior.

◆ GetStringByName()

proto external string GeoAttribCollection.GetStringByName ( string  name)

Gets an attribute's value as string.

Note: All *ByName(string) method versions are slower than their counterparts using attribute's index.

Parameters
nameattribute's name
Returns
Original value if attrib's type is STR, undefined behavior if the attribute does not exist or is of another type.

◆ GetType()

proto external GeoAttribType GeoAttribCollection.GetType ( int  index)

Gets attribute's data type.

Determines which Get*(int index) method should be use to read the value.

Parameters
indexattribute index [0 .. count-1]

◆ HasAttrib()

proto external bool GeoAttribCollection.HasAttrib ( string  name)
Returns
True iff a given attribute exists in a collection. (Still, it may not be set: may have no value, be null).
Parameters
nameattribute's name

◆ IsAttribSet()

proto external bool GeoAttribCollection.IsAttribSet ( int  index)

True iff the attribute has a value (is not null).

Note: This may not be reliable with ESRI shapefiles as they don't officially support null values.

Parameters
indexattribute index [0 .. count-1]

◆ IsAttribSetByName()

proto external bool GeoAttribCollection.IsAttribSetByName ( string  name)

True iff the attribute exists and has a value (is not null).

Note: All *ByName(string) method versions are slower than their counterparts using attribute's index.

Parameters
nameattribute's name
See also
IsAttribSet(int index)

The documentation for this interface was generated from the following file: