Beispiel #1
0
 def _get_desc(fc_path):
     # Checks if the input dataset is valid and returns its Describe object
     desc = _meta.Describe(fc_path)
     if not desc.shapeType:
         raise ValueError('Input dataset {} is not a feature class'.format(_tu.to_repr(fc_path)))
     if desc.is_multipatchclass:
         raise ValueError('Geometry type of {} is not supported'.format(_tu.to_repr(fc_path)))
     return desc
Beispiel #2
0
    def _get_fields(table_path):
        """
        Gets all field names in the table.

        :raises RuntimeError:   When the table metadata could not be retrieved.
        :rtype:                 list
        """
        desc = _meta.Describe(table_path)
        _vld.pass_if(desc, RuntimeError, 'Failed to create lookup for {}'.format(_tu.to_repr(table_path)))
        return desc.get_fields(True, True)
Beispiel #3
0
    def _get_fields(table_path: str) -> _tp.List[str]:
        """
        Gets all field names in the table.

        :raises RuntimeError:   When the table metadata could not be retrieved.
        """
        desc = _meta.Describe(table_path)
        _vld.pass_if(desc, RuntimeError,
                     f'Failed to create lookup for {_tu.to_repr(table_path)}')
        return desc.get_fields(True, True)