pytuflow.CrossSections.ids#
- CrossSections.ids(filter_by=None)#
Returns the IDs within the filter from the cross-section layer.
Available filters are:
None
- returns all available IDs.[type]
- returns all IDs of the given type (e.g.xz
).[source]
- returns all IDs present in the given source file.
- Parameters:
filter_by (str, optional) – The string to filter the IDs by.
- Returns:
List of IDs.
- Return type:
list[str]
Examples
Return all the cross-section IDs in the layer:
>>> xs = CrossSections('/path/to/1d_xs.shp') >>> xs.ids() ['1d_xs_M14_C99', '1d_xs_M14_C100', '1d_xs_M14_C101', ..., '1d_xs_M14_ds_weir', '1d_xs_M14_rd_weir']
If multiple cross-section tables are present in a given CSV file, the cross-section IDs from a given file can be obtained:
>>> xs.ids('/path/to/1d_CrossSection.csv') ['1d_xs_M14_C99', '1d_xs_M14_C100']
Return all the cross-section IDs of a given type:
>>> xs.ids('xz') ['1d_xs_M14_C99', '1d_xs_M14_C100', '1d_xs_M14_C101', ..., '1d_xs_M14_ds_weir', '1d_xs_M14_rd_weir']