def row2feature(row, id_field, geometry_field): feature = {'type': 'Feature', 'properties': _copy(row)} geometry = feature['properties'].pop(geometry_field) feature['geometry'] = _loadshape(_unhexlify(geometry)) feature['id'] = feature['properties'].pop(id_field) return feature
def row2feature(row, id_field, geometry_field): """ Convert a database row dict to a feature dict. """ feature = {'type': 'Feature', 'properties': _copy(row)} geometry = feature['properties'].pop(geometry_field) feature['geometry'] = _loadshape(_unhexlify(geometry)) feature['id'] = feature['properties'].pop(id_field) return feature