ogt.ogt_group.*

class ogt.ogt_group.OGTGroup(group_code)[source]

Represents a Document's GROUP and headings

Parameters:group_code (str) -- The four character group code to initialize with
csv_end_index = None

The line no this groups start at

csv_rows()[source]

Returns the csv rows used in this group

csv_start_index = None

The line no this groups start at

data = None

A list of dict`s with `head_code:value

data_column(head_code)[source]
data_dict()[source]

Returns the data dictionary for this group, if it exists

Returns:An instance of AGS4GroupDataDict if it exists, else None
docParent = None

Pointer to parent OGTDocument instance

group_code = None

The four character group code

headings = None

A dict of headings

headings_sort()[source]
headings_source_sort = None

The list of head_code with the sort order in original file

to_dict(edit_mode=False)[source]

Return a dictionary of the group data in two formats

Parameters:edit_mode (bool) -- see edit_mode
Return type:dict
Returns:A dictionary with the data
types = None

A dict of head_code:type

types_list()[source]
units = None

A dict of head_code:unit

units_list()[source]
ogt.ogt_group.groups_sort(unsorted_groups)[source]

Returns a prefered order for the groups.

Note

This is a bit hacky as the ags spec does not define any groups order, however PROJ does sensibly tend to come first etc.

So this return a list with

  • at start PROJ, TRAN, LOCA, HDPH, GEOL, SAMP
  • at end ABBR. DICT, FILE, TYPE, UNIT
  • and everything else in the middle sorted alphabetically
Returns:An list of group codes