OAFLDNMEXP

Export names of attribute fields from Focus Object Analyst to a text file


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Examples

Back to top

Description


OAFLDNMEXP exports the names of attribute fields from Object Analyst to a text file.
Back to top

Parameters


oafldnmexp(filv, dbvs, fldnmflt, tfile)

Name Type Caption Length Value range
FILV* str Input vector file name 1 -    
DBVS List[int] Input polygon layer 0 -    
FLDNMFLT str Field-name filter 0 -   Default: ALL_OA
TFILE* str Output file name 1 -    

* Required parameter
Back to top

Parameter descriptions

FILV

The name of the file that contains the vector layer of attribute-field names to export.

DBVS

The segment number of the vector layer that contains the attribute-field names to export.

If you do not specify a value, the vector segment with the highest number is used.

FLDNMFLT

A string by which to filter the attribute-field names to export.

You can specify the value as one of the following:

Alternatively, you can specify the value as a custom string to export only a subset of the names. For example, you can filter the attribute-field names to include only those that have, for example, "mean" in the name.

To use a custom string, you must precede and follow the contents of the character set by which you want to filter with an asterisk (*). The case must also match the case of characters in the field name.

For example, to filter the attribute-field names to export only those that include tm4 or tm5 in the name, enter *tm4*, *tm5*.

The default is ALL_OA.

TFILE

The name of the text file to which to write the exported field names.

Back to top

Details

The primary purpose of OAFLDNMEXP is to export the names of attribute fields from Object Analyst to a text file. Alternatively, you can run OAFLDNMEXP to extract the attribute-field names from a file created with OACALCATT or OACALCATTSAR. Each calculate attributes for each object of a segmentation layer, such as statistical, geometrical, textural attributes, and more. You can then view information about the calculated attributes in Focus Attribute Manager.

Figure 1. Attribute Manager window in Focus

Attribute Manager window in Focus

You can use the exported file as input with the respective training and classification algorithms OASVMTRAIN and OASVMCLASS, thereby saving you from having to manually enter the information.

The fields names exported are based on the field-name filter. That is, you can opt to export only the field names generated by attribute calculation, by running Object Analyst, OACALCATT, or OACALCATTSAR.

You can also, if necessary, export all of the attribute-field names in the input file, which consist of those with the system-generated oaattribute description and other attribute-field names, such as Area, Perimeter, and others.

The attributes calculated are identifiable by the value oaattribute that appears in the Description column of the Table Definition window in Focus.

Figure 2. Table Definition window in Focus

Table Definition window in Focus

The following is an example of the format of the text file created by OAFLDNMEXP:
# Source file:l7_ms_seg25_0.5_0.5.pix
# DBVS=2
Min_BLU
Min_GRN
Min_RED
Back to top

Examples

In the following example, all attribute-field names that have oaattributes as a description are exported to the file l7_ms_seg25_0.5_0.5_all_atributes.txt.

# Export all oaattributes

from pci.oafldnmexp import oafldnmexp
filv="l7_ms_seg25_0.5_0.5.pix"
dbvs=[2]
fldnmflt="ALL_OA"
tfile="l7_ms_seg25_0.5_0.5_all_attributes.txt "

oafldnmexp (filv, dbvs, fldnmflt, tfile)

In the following example, only attribute-field names in which Mean_* occurs in the name are exported to the file l7_ms_seg25_0.5_0.5_mean.txt.

# Export only names with "Mean_"

from pci.oafldnmexp import oafldnmexp

filv="l7_ms_seg25_0.5_0.5.pix"
dbvs=[2]
fldnmflt="Mean*"
tfile="l7_ms_seg25_0.5_0.5_mean.txt"

oafldnmexp (filv, dbvs, fldnmflt, tfile)

In the following example, only attribute-field names in which tm4 or tm5 occurs in the name are exported to the file l7_ms_seg25_0.5_0.5_mean.txt.

# Export all names in which *tm4* or *tm5* occurs in the name

from pci.oafldnmexp import oafldnmexp

filv="l7_ms_seg25_0.5_0.5.pix"
dbvs=[2]
fldnmflt="*tm4* , *tm5*"                     # Export all names in which tm4 or tm5 occurs
tfile="l7_ms_seg25_0.5_0.5_mean.txt "

oafldnmexp (filv, dbvs, fldnmflt, tfile)

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.