Package osgeo :: Module ogr :: Class FeatureDefn |
[hide private]
[frames] | no frames]

# Class FeatureDefn

source code

Proxy of C++ OGRFeatureDefnShadow class.

Instance Methods | [hide private]
__repr__(self) | source code
__init__(self, *args, **kwargs) __init__(OGRFeatureDefnShadow self, char const * name_null_ok=None) -> FeatureDefn | source code
GetName(self, *args) GetName(FeatureDefn self) -> char const * | source code
GetFieldCount(self, *args) GetFieldCount(FeatureDefn self) -> int | source code
GetFieldDefn(self, *args) GetFieldDefn(FeatureDefn self, int i) -> FieldDefn | source code
GetFieldIndex(self, *args) GetFieldIndex(FeatureDefn self, char const * field_name) -> int | source code
AddFieldDefn(self, *args) AddFieldDefn(FeatureDefn self, FieldDefn defn) | source code
GetGeomFieldCount(self, *args) GetGeomFieldCount(FeatureDefn self) -> int | source code
GetGeomFieldDefn(self, *args) GetGeomFieldDefn(FeatureDefn self, int i) -> GeomFieldDefn | source code
GetGeomFieldIndex(self, *args) GetGeomFieldIndex(FeatureDefn self, char const * field_name) -> int | source code
AddGeomFieldDefn(self, *args) AddGeomFieldDefn(FeatureDefn self, GeomFieldDefn defn) | source code
DeleteGeomFieldDefn(self, *args) DeleteGeomFieldDefn(FeatureDefn self, int idx) -> OGRErr | source code
GetGeomType(self, *args) GetGeomType(FeatureDefn self) -> OGRwkbGeometryType | source code
SetGeomType(self, *args) SetGeomType(FeatureDefn self, OGRwkbGeometryType geom_type) | source code
GetReferenceCount(self, *args) GetReferenceCount(FeatureDefn self) -> int | source code
IsGeometryIgnored(self, *args) IsGeometryIgnored(FeatureDefn self) -> int | source code
SetGeometryIgnored(self, *args) SetGeometryIgnored(FeatureDefn self, int bIgnored) | source code
IsStyleIgnored(self, *args) IsStyleIgnored(FeatureDefn self) -> int | source code
SetStyleIgnored(self, *args) SetStyleIgnored(FeatureDefn self, int bIgnored) | source code
IsSame(self, *args) IsSame(FeatureDefn self, FeatureDefn other_defn) -> int | source code
Destroy(self) Once called, self has effectively been destroyed. | source code

Class Variables | [hide private]
| __swig_setmethods__ = `{}`
| __setattr__ = `lambda self, name, value:`
| __swig_getmethods__ = `{}`
| __getattr__ = `lambda self, name:`
| __swig_destroy__ = `_ogr.delete_FeatureDefn`
| __del__ = `lambda self:`

Method Details | [hide private]

### GetName(self, *args) | source code
    GetName(FeatureDefn self) -> char const *

    const char*
    OGR_FD_GetName(OGRFeatureDefnH hDefn)

    Get name of the OGRFeatureDefn passed as an argument.

    This function is the same as the C++ method OGRFeatureDefn::GetName().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get the name from.

    the name. This name is internal and should not be modified, or freed.

### GetFieldCount(self, *args) | source code
    GetFieldCount(FeatureDefn self) -> int

    int
    OGR_FD_GetFieldCount(OGRFeatureDefnH hDefn)

    Fetch number of fields on the passed feature definition.

    This function is the same as the C++ OGRFeatureDefn::GetFieldCount().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get the fields count from.

    count of fields.

### GetFieldDefn(self, *args) | source code
    GetFieldDefn(FeatureDefn self, int i) -> FieldDefn

    OGRFieldDefnH
    OGR_FD_GetFieldDefn(OGRFeatureDefnH hDefn, int iField)

    Fetch field definition of the passed feature definition.

    This function is the same as the C++ method
    OGRFeatureDefn::GetFieldDefn().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get the field definition
    from.

    iField:  the field to fetch, between 0 and GetFieldCount()-1.

    a handle to an internal field definition object or NULL if invalid
    index. This object should not be modified or freed by the application.

### GetFieldIndex(self, *args) | source code
    GetFieldIndex(FeatureDefn self, char const * field_name) -> int

    int
    OGR_FD_GetFieldIndex(OGRFeatureDefnH hDefn, const char *pszFieldName)

    Find field by name.

    The field index of the first field matching the passed field name
    (case insensitively) is returned.

    This function is the same as the C++ method
    OGRFeatureDefn::GetFieldIndex.

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get field index from.

    pszFieldName:  the field name to search for.

    the field index, or -1 if no match found.

### AddFieldDefn(self, *args) | source code
    AddFieldDefn(FeatureDefn self, FieldDefn defn)

    void
    OGR_FD_AddFieldDefn(OGRFeatureDefnH hDefn, OGRFieldDefnH hNewField)

    Add a new field definition to the passed feature definition.

    To add a new field definition to a layer definition, do not use this
    function directly, but use OGR_L_CreateField() instead.

    This function should only be called while there are no OGRFeature
    objects in existence based on this OGRFeatureDefn. The OGRFieldDefn
    passed in is copied, and remains the responsibility of the caller.

    This function is the same as the C++ method
    OGRFeatureDefn::AddFieldDefn().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to add the field definition
    to.

    hNewField:  handle to the new field definition.

### GetGeomFieldCount(self, *args) | source code
    GetGeomFieldCount(FeatureDefn self) -> int

    int
    OGR_FD_GetGeomFieldCount(OGRFeatureDefnH hDefn)

    Fetch number of geometry fields on the passed feature definition.

    This function is the same as the C++
    OGRFeatureDefn::GetGeomFieldCount().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get the fields count from.

    count of geometry fields.

    GDAL 1.11

### GetGeomFieldDefn(self, *args) | source code
    GetGeomFieldDefn(FeatureDefn self, int i) -> GeomFieldDefn

    OGRGeomFieldDefnH
    OGR_FD_GetGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField)

    Fetch geometry field definition of the passed feature definition.

    This function is the same as the C++ method
    OGRFeatureDefn::GetGeomFieldDefn().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get the field definition
    from.

    iGeomField:  the geometry field to fetch, between 0 and
    GetGeomFieldCount() - 1.

    a handle to an internal field definition object or NULL if invalid
    index. This object should not be modified or freed by the application.

    GDAL 1.11

### GetGeomFieldIndex(self, *args) | source code
    GetGeomFieldIndex(FeatureDefn self, char const * field_name) -> int

    int
    OGR_FD_GetGeomFieldIndex(OGRFeatureDefnH hDefn, const char
    *pszGeomFieldName)

    Find geometry field by name.

    The geometry field index of the first geometry field matching the
    passed field name (case insensitively) is returned.

    This function is the same as the C++ method
    OGRFeatureDefn::GetGeomFieldIndex.

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get field index from.

    pszGeomFieldName:  the geometry field name to search for.

    the geometry field index, or -1 if no match found.

### AddGeomFieldDefn(self, *args) | source code
    AddGeomFieldDefn(FeatureDefn self, GeomFieldDefn defn)

    void
    OGR_FD_AddGeomFieldDefn(OGRFeatureDefnH hDefn, OGRGeomFieldDefnH
    hNewGeomField)

    Add a new field definition to the passed feature definition.

    To add a new field definition to a layer definition, do not use this
    function directly, but use OGR_L_CreateGeomField() instead.

    This function should only be called while there are no OGRFeature
    objects in existence based on this OGRFeatureDefn. The
    OGRGeomFieldDefn passed in is copied, and remains the responsibility
    of the caller.

    This function is the same as the C++ method
    OGRFeatureDefn::AddGeomFieldDefn().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to add the geometry field
    definition to.

    hNewGeomField:  handle to the new field definition.

    GDAL 1.11

### DeleteGeomFieldDefn(self, *args) | source code
    DeleteGeomFieldDefn(FeatureDefn self, int idx) -> OGRErr

    OGRErr
    OGR_FD_DeleteGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField)

    Delete an existing geometry field definition.

    To delete an existing geometry field definition from a layer
    definition, do not use this function directly, but use
    OGR_L_DeleteGeomField() instead ( not implemented yet).

    This method should only be called while there are no OGRFeature
    objects in existence based on this OGRFeatureDefn.

    This method is the same as the C++ method
    OGRFeatureDefn::DeleteGeomFieldDefn().

    Parameters:
    -----------

    hDefn:  handle to the feature definition.

    iGeomField:  the index of the geometry field definition.

    OGRERR_NONE in case of success.

    GDAL 1.11

### GetGeomType(self, *args) | source code
    GetGeomType(FeatureDefn self) -> OGRwkbGeometryType

    OGRwkbGeometryType
    OGR_FD_GetGeomType(OGRFeatureDefnH hDefn)

    Fetch the geometry base type of the passed feature definition.

    This function is the same as the C++ method
    OGRFeatureDefn::GetGeomType().

    Starting with GDAL 1.11, this method returns
    GetGeomFieldDefn(0)->GetType().

    Parameters:
    -----------

    hDefn:  handle to the feature definition to get the geometry type
    from.

    the base type for all geometry related to this definition.

### SetGeomType(self, *args) | source code
    SetGeomType(FeatureDefn self, OGRwkbGeometryType geom_type)

    void
    OGR_FD_SetGeomType(OGRFeatureDefnH hDefn, OGRwkbGeometryType eType)

    Assign the base geometry type for the passed layer (the same as the
    feature definition).

    All geometry objects using this type must be of the defined type or a
    derived type. The default upon creation is wkbUnknown which allows for
    any geometry type. The geometry type should generally not be changed
    after any OGRFeatures have been created against this definition.

    This function is the same as the C++ method
    OGRFeatureDefn::SetGeomType().

    Starting with GDAL 1.11, this method calls
    GetGeomFieldDefn(0)->SetType().

    Parameters:
    -----------

    hDefn:  handle to the layer or feature definition to set the geometry
    type to.

    eType:  the new type to assign.

### GetReferenceCount(self, *args) | source code
    GetReferenceCount(FeatureDefn self) -> int

    int
    OGR_FD_GetReferenceCount(OGRFeatureDefnH hDefn)

    Fetch current reference count.

    This function is the same as the C++ method
    OGRFeatureDefn::GetReferenceCount().

    Parameters:
    -----------

    hDefn:  handle to the feature definition on witch OGRFeature are based
    on.

    the current reference count.

### IsGeometryIgnored(self, *args) | source code
    IsGeometryIgnored(FeatureDefn self) -> int

    int
    OGR_FD_IsGeometryIgnored(OGRFeatureDefnH hDefn)

    Determine whether the geometry can be omitted when fetching features.

    This function is the same as the C++ method
    OGRFeatureDefn::IsGeometryIgnored().

    Starting with GDAL 1.11, this method returns
    GetGeomFieldDefn(0)->IsIgnored().

    Parameters:
    -----------

    hDefn:  handle to the feature definition on witch OGRFeature are based
    on.

    ignore state

### SetGeometryIgnored(self, *args) | source code
    SetGeometryIgnored(FeatureDefn self, int bIgnored)

    void
    OGR_FD_SetGeometryIgnored(OGRFeatureDefnH hDefn, int bIgnore)

    Set whether the geometry can be omitted when fetching features.

    This function is the same as the C++ method
    OGRFeatureDefn::SetGeometryIgnored().

    Starting with GDAL 1.11, this method calls
    GetGeomFieldDefn(0)->SetIgnored().

    Parameters:
    -----------

    hDefn:  handle to the feature definition on witch OGRFeature are based
    on.

    bIgnore:  ignore state

### IsStyleIgnored(self, *args) | source code
    IsStyleIgnored(FeatureDefn self) -> int

    int
    OGR_FD_IsStyleIgnored(OGRFeatureDefnH hDefn)

    Determine whether the style can be omitted when fetching features.

    This function is the same as the C++ method
    OGRFeatureDefn::IsStyleIgnored().

    Parameters:
    -----------

    hDefn:  handle to the feature definition on which OGRFeature are based
    on.

    ignore state

### SetStyleIgnored(self, *args) | source code
    SetStyleIgnored(FeatureDefn self, int bIgnored)

    void
    OGR_FD_SetStyleIgnored(OGRFeatureDefnH hDefn, int bIgnore)

    Set whether the style can be omitted when fetching features.

    This function is the same as the C++ method
    OGRFeatureDefn::SetStyleIgnored().

    Parameters:
    -----------

    hDefn:  handle to the feature definition on witch OGRFeature are based
    on.

    bIgnore:  ignore state

### IsSame(self, *args) | source code
    IsSame(FeatureDefn self, FeatureDefn other_defn) -> int

    int OGR_FD_IsSame(OGRFeatureDefnH
    hFDefn, OGRFeatureDefnH hOtherFDefn)

    Test if the feature definition is identical to the other one.

    Parameters:
    -----------

    hFDefn:  handle to the feature definition on witch OGRFeature are
    based on.

    hOtherFDefn:  handle to the other feature definition to compare to.

    TRUE if the feature definition is identical to the other one.

    OGR 1.11

### Destroy(self) | source code
Once called, self has effectively been destroyed. Do not access. For backwards compatibility only