The IDLffShape::GetProperty procedure method returns the values of properties associated with a Shapefile object. These properties are:
- Number of entities
- The type of the entities
- The number of attributes associated with each entity
- The names of the attributes
- The name, type, width, and precision of the attributes
- The status of a Shapefile
- The filename of the Shapefile object
Syntax
Obj->[IDLffShape::]GetProperty [, PROPERTY=variable]
Arguments
None
Keywords
Any property listed under IDLffShape Properties that contains the word “Yes” in the “Get” column of the properties table can be retrieved using this method. To retrieve the value of a property, specify the property name as a keyword set equal to a named variable that will contain the value of the property.
Examples
In the following example, the number of entities and the entity type is returned:
PRO entity_info
myshape=OBJ_NEW('IDLffShape', FILEPATH('states.shp', $
SUBDIR=['examples', 'data']))
myshape->GetProperty, N_ENTITIES=num_ent, $
ENTITY_TYPE=ent_type
PRINT, 'Number of Entities: ', num_ent
PRINT, 'Entity Type: ', ent_type
OBJ_DESTROY, myshape
END
This results in the following:
Number of Entities: 51
Entity Type: 5
In the next example, the definitions for attribute 1 are returned:
PRO attribute_info
myshape=OBJ_NEW('IDLffShape', FILEPATH('states.shp', $
SUBDIR=['examples', 'data']))
myshape->GetProperty, ATTRIBUTE_INFO=attr_info
PRINT, 'Attribute Number: ', '1'
PRINT, 'Attribute Name: ', attr_info[1].name
PRINT, 'Attribute Type: ', attr_info[1].type
PRINT, 'Attribute Width: ', attr_info[1].width
PRINT, 'Attribute Precision: ', attr_info[1].precision
OBJ_DESTROY, myshape
END
This results in the following:
Attribute Number: 1
Attribute Name: STATE_NAME
Attribute Type: 7
Attribute Width: 25
Attribute Precision: 0
Version History