## @class Geo::OGR
# @brief OGR utility functions.
# @details A wrapper for many OGR utility functions and a root class for all
# OGR classes.

## @ignore TermProgress
## @ignore TermProgress_nocb

## @ignore BuildPolygonFromEdges

## @ignore ApproximateArcAngles

## @ignore OLMD_FID64

## @ignore ForceTo
## @ignore ForceToLineString
## @ignore ForceToMultiLineString
## @ignore ForceToMultiPoint
## @ignore ForceToMultiPolygon
## @ignore ForceToPolygon

## @ignore GeometryTypeToName
## @ignore GetFieldTypeName

## @ignore GeometryType
## @ignore GetFieldSubTypeName

## @sub @GeometryTypes()
# @return a list of all geometry types, currently:
# +list Geo::OGR wkb 25DBit,25Bit,NDR,XDR

## @sub list ByteOrders
# @return a list of byte order types, XDR and NDR. XDR denotes
# big-endian and NDR denotes little-endian.

## @method $GeometryTypeModify($type, $modifier)
# @param type a geometry type (one of Geo::OGR::GeometryTypes).
# @param modifier one of 'flatten', 'set_Z', 'make_collection', 'make_curve', or 'make_linear'.
# @return modified geometry type.

## @method $GeometryTypeTest($type, $test, $type2)
# @param type a geometry type (one of Geo::OGR::GeometryTypes).
# @param test one of 'has_z', 'is_subclass_of', 'is_curve', 'is_surface', or 'is_non_linear'.
# @param type2 a geometry type (one of Geo::OGR::GeometryTypes). Required for 'is_subclass_of' test.
# @return result of the test.

## @ignore CreateGeometryFromWkb
## @ignore CreateGeometryFromWkt
## @ignore CreateGeometryFromGML
## @ignore CreateGeometryFromJson

## @method SetGenerate_DB2_V72_BYTE_ORDER($Generate_DB2_V72_BYTE_ORDER)
# Needed only on IBM DB2.

## @ignore NullFID

## @ignore GetDriver
## @ignore GetDriverCount
## @ignore GetDriverNames

## @sub @Drivers()
# @note Use Geo::GDAL::Drivers for raster drivers.
# @return a list of all available GDAL vector drivers.

## @sub @DriverNames()
# A.k.a GetDriverNames
# @note Use Geo::GDAL::DriverNames for raster drivers.
# @return a list of the short names of all available GDAL vector drivers.

## @sub Geo::GDAL::Driver Driver($name)
# A.k.a GetDriver.
# @param name the short name of the driver.
# @note No check is made that the driver is actually a vector driver.
# @return a Geo::GDAL::Driver object.


## @method Geo::GDAL::Dataset Open($name, $update = 0)
# Open a vector data source.
# @param name The data source string (directory, filename, etc.).
# @param update Whether to open the data source in update mode (default is not).
# @return a new Geo::GDAL::Dataset object.

## @method Geo::GDAL::Dataset OpenShared($name, $update = 0)
# Open a vector data source in shared mode.
# @param name The data source string (directory, filename, etc.).
# @param update Whether to open the data source in update mode.
# @return a new Geo::GDAL::Dataset object.



## @class Geo::OGR::Driver
# @brief A vector format driver.
# @details This is a legacy class which
# should not be used in new code. Use Geo::GDAL::Driver.

## @method Open
# The same as Geo::OGR::Open except that only this driver is allowed.

## @method Geo::GDAL::Dataset Create($name, hashref options = undef )
# Create a new vector data source using this driver.
# @param name The data source name.
# @param options Driver specific dataset creation options.

## @method Geo::GDAL::Dataset Copy(Geo::GDAL::Dataset source, $name, arrayref options = undef)
# Copy a vector data source into a new data source with this driver.
# @param source The Geo::GDAL::Dataset object to be copied.
# @param name The name for the new data source.
# @param options Driver specific options. In addition to options
# specified in GDAL documentation the option STRICT can be set to 'NO'
# for a more relaxed copy. Otherwise the STRICT is 'YES'.
# @note The order of the first two parameters is different from that in Geo::GDAL::Driver::Copy.
# @return a new Geo::GDAL::Dataset object.



## @class Geo::OGR::DataSource
# @brief A vector dataset.
# @details This is a legacy class which should not be
# used in new code. Use Geo::GDAL::Dataset.

## @sub Geo::GDAL::Dataset Open
# The same as Geo::OGR::Open

## @sub Geo::GDAL::Dataset OpenShared
# The same as Geo::OGR::OpenShared




## @class Geo::OGR::Layer
# @brief A collection of similar features.
# @details A layer object is typically obtained with a data source object. A
# layer has a data model (a schema), which is maintained in a
# definition object, and a set of features, which contain data
# according to the data model. The schema is typically set when the
# layer is created or opened, but it may be altered somewhat with
# methods Geo::OGR::Layer::CreateField,
# Geo::OGR::Layer::AlterFieldDefn, and
# Geo::OGR::Layer::DeleteField. Features and/or their data can be
# read, inserted and deleted. Reading can be filtered. Layers can be
# compared to each other with methods Clip, Erase, Identity,
# Intersection, SymDifference, Union, and Update.
# A layer may have metadata OLMD_FID64 => 'YES' if it holds features
# with 64 bit FIDs. The metadata of a layer can be obtained with
# GetMetadata method.
# @isa (Geo::OGR)

## @method @Capabilities()
# Both a package subroutine and an object method.
# @return a list of capabilities. The object method returns a list of
# the capabilities the layer has. The package subroutine returns a list of
# all potential capabilities a layer may have. These are currently:
# +list Geo::OGR OLC
#
# Examples:
# \code
# @cap = Geo::OGR::Layer::Capabilities(); # the package subroutine
# @cap = $layer->Capabilities(); # the object method
# \endcode

## @method Clip(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# Clip off areas that are not covered by the method layer. The schema
# of the result layer can be set before calling this method, or is
# initialized to to contain all fields from
# this and method layer.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method Intersection(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# The result layer contains features whose geometries represent areas
# that are common between features in the input layer and in the
# method layer. The schema of the result layer can be set before
# calling this method, or is initialized to contain all fields from
# this and method layer.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method Union(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# The result layer contains features whose geometries represent areas
# that are in either in the input layer or in the method layer. The
# schema of the result layer can be set before calling this method, or
# is initialized to contain all fields from this and method layer.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method SymDifference(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# The result layer contains features whose geometries represent areas
# that are in either in the input layer or in the method layer but not
# in both. The features in the result layer have attributes from both
# input and method layers. For features which represent areas that are
# only in the input or in the method layer the respective attributes
# have undefined values. The schema of the result layer can be set by
# the user or, if it is empty, is initialized to contain all fields in
# the input and method layers.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method Identity(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# The result layer contains features whose geometries represent areas
# that are in the input layer. The features in the result layer have
# attributes from both input and method layers. The schema of the
# result layer can be set by the user or, if it is empty, is
# initialized to contain all fields in input and method layers.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method Update(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# The result layer contains features whose geometries represent areas
# that are either in the input layer or in the method layer. The
# features in the result layer have areas of the features of the
# method layer or those ares of the features of the input layer that
# are not covered by the method layer. The features of the result
# layer get their attributes from the input layer. The schema of the
# result layer can be set by the user or, if it is empty, is
# initialized to contain all fields in the input layer.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method Erase(Geo::OGR::Layer method, Geo::OGR::Layer result, hashref options, coderef callback, $callback_data)
# The result layer contains features whose geometries represent areas
# that are in the input layer but not in the method layer. The
# features in the result layer have attributes from the input
# layer. The schema of the result layer can be set by the user or, if
# it is empty, is initialized to contain all fields in the input
# layer.
# @param method method layer.
# @param result result layer.
# @param options a reference to an options hash.
# @param callback [optional] a reference to a subroutine, which will
# be called with parameters (number progress, string msg, callback_data)
# @param callback_data [optional]

## @method $TestCapability($cap)
# @param cap A capability string.
# @return a boolean value indicating whether the layer has the
# specified capability.

## @method Geo::OSR::SpatialReference SpatialReference($name, Geo::OSR::SpatialReference sr)
# @note A.k.a GetSpatialRef.
# Get or set the projection of a spatial field of this layer. Gets or
# sets the projection of the first field if no field name is given.
# @param name [optional] a name of a spatial field in this layer.
# @param sr [optional] a Geo::OSR::SpatialReference object,
# which replaces the existing projection.
# @return a Geo::OSR::SpatialReference object, which represents the
# projection in the given spatial field.

## @method Geo::OGR::DataSource GetDataSource()
# @return the data source object to which this layer object belongs to.

## @ignore FindFieldIndex

## @method $GetFieldDefn($name)
# Get the definition of a field.
# @param name the name of the field.
# @return a Geo::OGR::FieldDefn object.

## @method $GetGeomFieldDefn($name)
# Get the definition of a spatial field.
# @param name the name of the spatial field.
# @return a Geo::OGR::GeomFieldDefn object.

## @ignore CreateGeomField

## @method CreateField(%params)
# Create a field.
# @param params as in Geo::OGR::FieldDefn::new or
# Geo::OGR::GeomFieldDefn::new, plus ApproxOK (whose default is true).

## @method AlterFieldDefn($name, %params)
# @param field the name of the field to be altered.
# @param params as in Geo::OGR::FieldDefn::new. Width and
# Precision should be both or neither.
# @note Only non-spatial fields can be altered.
# @note Also the deprecated form AlterFieldDefn($field,
# Geo::OGR::FieldDefn $Defn, $Flags) works.

## @method DeleteField($field)
# Delete an existing field from a layer.
# @param field name (or index) of the field which is deleted
# @note Only non-spatial fields can be deleted.

## @ignore Schema

## @method \%GetSchema()
# @brief Get the schema of this layer.
# @note The schema of a layer cannot be set with this method.  If you
# have a Geo::OGR::FeatureDefn object before creating the layer, use
# its schema in the Geo::OGR::CreateLayer method.
# @return the schema of this layer, as in Geo::OGR::FeatureDefn::Schema.

## @method \%Row(%row)
# Get and/or set the data of a feature that has the supplied feature
# id (the next feature obtained with GetNextFeature is used if feature
# id is not given). Calls Geo::OGR::Feature::Row.
# @param row [optional] feature data
# @return a reference to feature data in a hash

## @method @Tuple(@tuple)
# Get and/set the data of a feature that has the supplied feature id
# (the next feature obtained with GetNextFeature is used if feature id
# is not given). The expected data in the tuple is: ([feature id,]
# non-spatial fields, spatial fields). Calls Geo::OGR::Feature::Tuple.
# @param tuple [optional] feature data
# @note The schema of the tuple needs to be the same as that of the
# layer.
# @return a reference to feature data in an array

## @method Geo::OGR::Geometry SpatialFilter($filter)
# @param filter [optional] a Geo::OGR::Geometry object or a string. An
# undefined value removes the filter if there is one.
# @return a new Geo::OGR::Geometry object

## @method Geo::OGR::Geometry SpatialFilter(@filter)
# @param filter [optional] a rectangle ($minx, $miny, $maxx, $maxy).
# @return a new Geo::OGR::Geometry object

## @method SetSpatialFilter($filter)
# @param filter [optional] a Geo::OGR::Geometry object. If not given,
# removes the filter if there is one.

## @method SetSpatialFilterRect($minx, $miny, $maxx, $maxy)
# @param minx
# @param miny
# @param maxx
# @param maxy

## @method Geo::OGR::Geometry GetSpatialFilter()
# @return a new Geo::OGR::Geometry object

## @method SetAttributeFilter($filter_string)
# Set or clear the attribute filter.
# @param filter_string a SQL WHERE clause or undef to clear the
# filter.

## @method ResetReading()
# Initialize the layer object for iterative reading.

## @method Geo::OGR::Feature GetNextFeature()
# @return iteratively Geo::OGR::Feature objects from the layer. The
# iteration obeys the spatial and the attribute filter.

## @method SetNextByIndex($new_index)
# @param new_index the index to which set the read cursor in the
# current iteration

## @method $GetFeaturesRead()
# @return integer

## @method ForFeatures($code, $in_place)
# @note experimental, the syntax may change
#
# Call code for all features. This is a simple wrapper for
# ResetReading and while(GetNextFeature).
#
# Example usage:
# \code
# $layer->ForFeatures(sub {my $f = shift; $self->DeleteFeature($f->FID)}); # empties the layer
# \endcode
#
# @param code a reference to a subroutine, which is called with each
# feature as an argument
# @param in_place if set to true, the feature is stored back to the
# layer

## @method ForGeometries($code, $in_place)
# @note experimental, the syntax may change
#
# Call code for all geometries. This is a simple wrapper for
# ResetReading and while(GetNextFeature).
#
# Example usage:
# \code
# my $area = 0;
# $layer->ForGeometries(sub {my $g = shift; $area += $g->Area}); # computes the total area
# \endcode
#
# @param code a reference to a subroutine, which is called with each
# geometry as an argument
# @param in_place if set to true, the geometry is stored back to the
# layer

## @method $GetName()
# @return the name of the layer.

## @method Geo::OGR::Feature GetFeature($fid)
# @param fid feature id
# @return a new Geo::OGR::Feature object that represents the feature in the layer.

## @method SetFeature($feature)
# @note The feature should have the same schema as the layer.
#
# Replaces a feature in the layer based on the given feature's
# id. Requires RandomWrite capability.
# @param feature a Geo::OGR::Feature object

## @method CreateFeature($feature)
# @deprecated use Geo::OGR::Layer::InsertFeature which accepts Perl
# data and checks for geometry type and attribute data
#
# @note The feature should have the same schema as the layer.
#
# Inserts a feature into the layer. The given feature's id may change.
# @param feature a Geo::OGR::Feature object

## @method InsertFeature($feature)
# Creates a new feature which has the schema of the layer and
# initializes it with data from the argument. Then inserts the feature
# into the layer (using CreateFeature). Uses Geo::OGR::Feature::Row or
# Geo::OGR::Feature::Tuple.
# @param feature a Geo::OGR::Feature object or reference to feature
# data in a hash (as in Geo::OGR::Feature::Row) or in an array (as in
# Geo::OGR::Feature::Tuple)
# @return the new feature.

## @method DeleteFeature($fid)
# @param fid feature id

## @method SyncToDisk()

## @ignore GetLayerDefn

## @method Geo::OGR::FeatureDefn GetDefn()
# A.k.a GetLayerDefn.
# @return a Geo::OGR::FeatureDefn object.

## @method $GetFeatureCount($force = 1)
# @param force
# @return integer

## @method @GetExtent($force = 1)
# @param force compute the extent even if it is expensive
# @note In scalar context returns a reference to an anonymous array
# containing the extent.
# @return the extent ($minx, $maxx, $miny, $maxy)

# @param force
# @return the extent = ($minx, $maxx, $miny, $maxy) as a listref

## @method StartTransaction()

## @method CommitTransaction()

## @method RollbackTransaction()

## @ignore GetSpatialRef

## @ignore GetRefCount

## @method $GetFIDColumn()
# @return the name of the underlying database column being used as the
# FID column, or "" if not supported.

## @ignore GetGeometryColumn
## @ignore GetGeomType

## @method $GeometryType($field)
# @param field the name or index of the spatial field.
# @return the geometry type of the spatial field.

## @method @GetFieldNames()
# @return a list of the names of the fields in this layer. The
# non-geometry field names are first in the list and then the geometry
# fields.

## @method SetIgnoredFields(@fields)
# @param fields a list of field names




## @class Geo::OGR::Feature
# @brief A collection of non-spatial and spatial attributes.
# @details A feature is a collection of non-spatial and spatial attributes and
# an id, which is a special attribute, and data records according to
# this data model. Attributes are called fields and some fields are
# spatial, i.e., their value is a geometry. Fields have at least a
# name and a type. Features may exist within a layer or
# separetely. The data model of a feature is a definition object.
# @isa (Geo::OGR)

## @cmethod Geo::OGR::Feature new(%schema)
# @brief Create a new feature.
# @param A Geo::OGR::FeatureDefn object or named parameters to create one:
# - \a Name
# - \a Fields a list of Geo::OGR::FieldDefn or Geo::OGR::GeomFieldDefn
# objects or anonymous hashes from which such can be created.
# - \a GeometryType the geometry type if the feature has only one spatial field.
# - \a StyleIgnored whether the style can be omitted when fetching features. (default is false)
#
# @note Do not mix GeometryType and geometry fields in Fields list.
#
# @return a new Geo::OGR::Feature object.

## @method Geo::OGR::Layer Layer()
# @return the layer to which this feature belongs to or undef.

## @method $DumpReadable()
# Write the contents of this feature to stdout.

## @method $Validate(list flags)
# @param flags one of more of null, geom_type, width,
# allow_null_when_default, or all.
# @exception croaks with an error message if the feature is not valid.
# @return integer denoting the validity of the feature object.

## @ignore Schema

## @method \%GetSchema()
# @brief Get the schema of this feature.
#
# @return the schema as a hash whose keywords are Name, StyleIgnored
# and Fields. Fields is an anonymous array of first non-spatial and
# then spatial field schemas as in Geo::OGR::FieldDefn::Schema() and
# Geo::OGR::GeomFieldDefn::Schema().

## @method \%Row(%row)
# @note This method discards the data the destination feature (or
# layer) does not support. Changes in data due to differences between
# field types may also occur.
#
# Get and/or set the data of the feature. The key of the (key,value)
# pairs of the row is the field name. Special field names FID and
# Geometry are used for feature id and (single) geometry
# respectively. The geometry/ies is/are set and get using the
# Geo::OGR::Feature::Geometry method. Field values are set using the
# Geo::OGR::Feature::Field method.
# @param row [optional] feature data in a hash.
# @return a reference to feature data in a hash. Spatial fields are
# returned as Geo::OGR::Geometry objects.

## @method @Tuple(@tuple)
# @note This method discards the data the destination feature (or
# layer) does not support. Changes in data due to differences between
# field types may also occur.
#
# @note The schema of the tuple needs to be the same as that of the
# feature.
#
# Get and/set the data of the feature. The expected data in the tuple
# is ([feature_id,] non-spatial fields, spatial fields). The fields in
# the tuple are in the order they are in the schema. Field values are
# set using the Geo::OGR::Feature::Field method. Geometries are set
# and get using the Geo::OGR::Feature::Geometry method.
# @param tuple [optional] feature data in an array
# @return feature data in an array

## @ignore GetDefnRef

## @method Geo::OGR::FeatureDefn GetDefn()
# @note A.k.a GetDefnRef.
# @return a Geo::OGR::FeatureDefn object, which represents the definition of this feature.

## @ignore GetFieldDefnRef
## @ignore GetFieldType
## @ignore GetGeomFieldDefnRef

## @method $GetFieldDefn($name)
# Get the definition of a field.
# @param name the name of the field.
# @return a Geo::OGR::FieldDefn object.

## @method $GetGeomFieldDefn($name)
# Get the definition of a spatial field.
# @param name the name of the spatial field.
# @return a Geo::OGR::GeomFieldDefn object.

## @method Geo::OGR::Feature Clone()
# @return a new Geo::OGR::Feature object

## @method $Equal($feature)
# @param feature a Geo::OGR::Feature object for comparison
# @return boolean

## @ignore GetFieldIndex
## @ignore GetGeomFieldIndex
## @ignore GetFieldCount
## @ignore GetGeomFieldCount

## @method @GetFieldNames()
# Get the names of the fields in this feature.

## @ignore GetFieldAsString
## @ignore GetFieldAsInteger
## @ignore GetFieldAsDouble
## @ignore GetFieldAsBinary
## @ignore GetFieldAsDateTime
## @ignore GetFieldAsInteger64
## @ignore GetFieldAsDoubleList
## @ignore GetFieldAsIntegerList
## @ignore GetFieldAsInteger64List
## @ignore GetFieldAsStringList

## @ignore SetFieldBinary
## @ignore SetFieldBinaryFromHexString
## @ignore SetFieldInteger64
## @ignore SetFieldDoubleList
## @ignore SetFieldIntegerList
## @ignore SetFieldInteger64List
## @ignore SetFieldStringList

## @ignore IsFieldSet
## @ignore UnsetField

## @method SetField($name, @Value)
# See Field().

## @method @GetField($name)
# See Field().

## @method Field($name, $value, ...)
# @brief Get, set, or unset the field value.
# @param name the name (or the index) of the field.
# @param value a scalar, a list of scalars or a reference to a
# list. If undef, the field is unset. If a scalar or a list of
# scalars, the field is set from them.
# @note Non-scalar fields (for example Date) can be set either from a
# scalar, which is then assumed to be a string and parsed, or from a
# list of values (for example year, month, day for Date).
# @note Setting and getting Integer64 fields requires 'use bigint' if
# \$Config{ivsize} is smaller than 8, i.e., in a 32 bit machine.
# @return in non-void context the value of the field, which may be a
# scalar or a list, depending on the field type. For unset fields the
# undef value is returned.

## @ignore SetGeometry
## @ignore SetGeometryDirectly
## @ignore GetGeometry
## @ignore GetGeometryRef
## @ignore GetGeomFieldRef
## @ignore SetGeomField
## @ignore SetGeomFieldDirectly

## @method Geometry($name, $geometry)
# @brief Get or set the value of a geometry field.
# @note This method delivers the functionality of undocumented methods
# SetGeometry($geometry), SetGeometryDirectly, SetGeomField,
# SetGeomFieldDirectly, GetGeometry, GetGeometryRef.
#
# Set or get the geometry in the feature. When setting, does a check
# against the schema (GeometryType) of the feature. If the parameter
# is a geometry object, it is cloned.
# @param name [optional] the name of the spatial field,
# whose geometry is to be set. If not given, sets or gets the geometry
# of the first (or the single) spatial field.
# @param geometry [optional] a Geo::OGR::Geometry object or a
# reference to a hash from which such can be created (using
# Geo::OGR::Geometry::new).
# @return in a non-void context the indicated geometry in the feature
# as a Geo::OGR::Geometry object. The returned object contains a
# reference to the actual geometry data in the feature (the geometry
# is not cloned) and to the feature object, thus keeping the feature
# object from being destroyed while the geometry object exists.

## @ignore SetFromWithMap

## @method SetFrom($other, $forgiving = 1, hashref map)
# @param other a Geo::OGR::Feature object
# @param forgiving [optional] set to false if the operation should not
# continue if output fields do not match some of the source fields
# @param map [optional] a mapping from output field indexes to source
# fields, include into the hash all field indexes of this feature
# which should be set

## @method $IsFieldSet($field)
# @param field the name (or index) of the field
# @return boolean

## @method UnsetField($field)
# See Field().

## @method $FID($id)
# @brief Get or set the id of this feature.
# @param id [optional] the id to set for this feature.
# @return integer the id of this feature.

## @method $GetFID()
# @return the feature id (an integer).

## @method SetFID($id)
# @param id the feature id.

## @method DumpReadable()

## @ignore StyleString

## @method $GetStyleString()
# @return a string

## @method SetStyleString($string)
# @param string




## @class Geo::OGR::FeatureDefn
# @brief The schema of a feature or a layer.
# @details A FeatureDefn object is a collection of field definition objects. A
# read-only FeatureDefn object can be obtained from a layer
# (Geo::OGR::Layer::GetDefn()) or a feature
# (Geo::OGR::Feature::GetDefn()).
# @isa (Geo::OGR)

## @cmethod Geo::OGR::FeatureDefn new(%schema)
# Creates a new layer or feature definition. The new definition is
# either initialized to the given schema or it will contain no
# non-spatial fields and one spatial field, whose Name is '' and
# GeometryType is 'Unknown' or the value of the named parameter
# GeometryType.
# @param schema [optional] The schema for the new feature definition,
# as in Geo::OGR::FeatureDefn::Schema().
# @return a Geo::OGR::FeatureDefn object
#
# Example usage:
# \code
# $fd = Geo::OGR::FeatureDefn->new(
#     Name => "name",
#     Fields => [{ Name => 'field1', Type => 'String' },
#                { Name => 'geom', GeometryType => 'Point' }] );
# \endcode

## @ignore Schema

## @method \%GetSchema()
# @brief Get the schema of this feature or layer definition.
#
# @return the schema as a hash whose keywords are Name, StyleIgnored
# and Fields. Fields is an anonymous array of first non-spatial and
# then spatial field schemas as in Geo::OGR::FieldDefn::Schema() and
# Geo::OGR::GeomFieldDefn::Schema().

## @ignore Name

## @method $GetName()
# @return the name of this layer or feature definition.

## @ignore GetFieldIndex
## @ignore GetFieldCount
## @ignore GetGeomFieldCount
## @ignore GetGeomFieldIndex

## @method @GetFieldNames()
# The names of the fields in this layer or feature definition.
# @return the list of field names.

## @ignore GeometryIgnored
## @ignore GeometryType

## @method $GetFieldDefn($name)
# Get the definition of a field.
# @param name the name of the field.
# @return a Geo::OGR::FieldDefn object.

## @method $GetGeomFieldDefn($name)
# Get the definition of a spatial field.
# @param name the name of the spatial field.
# @return a Geo::OGR::GeomFieldDefn object.

## @ignore AddFieldDefn
## @ignore AddGeomFieldDefn

## @method AddField(%params)
# @param params Named parameters to create a new Geo::OGR::FieldDefn
# or Geo::OGR::GeomFieldDefn object.

## @ignore DeleteGeomFieldDefn

## @method DeleteField($name)
# @note Currently only geometry fields can be deleted.
# @param index the index of the geometry field to be deleted.

## @ignore GeomType
## @ignore GetGeomType
## @ignore SetGeomType

## @method $GeometryType($geometry_type)
# Get or set the geometry type of this feature definition.
# @deprecated returns the type of the first spatial field. Use
# Geo::OGR::Layer::GeometryType($index),
# Geo::OGR::Feature::GeometryType($index),
# Geo::OGR::GeomFieldDefn::GeometryType, or the schema.
#
# @note a.k.a. GeomType, GetGeomType (deprecated, returns an integer),
# SetGeomType (deprecated, requires an integer)
# @param geometry_type [optional] one of \@Geo::OGR::GeometryTypes
# @return the geometry type, one of \@Geo::OGR::GeometryTypes

## @ignore GetReferenceCount

## @ignore IsGeometryIgnored
## @ignore SetGeometryIgnored

## @method $GeometryIgnored($IgnoreState)
# @deprecated gets or sets the ignore status of the first spatial
# field. Use Geo::OGR::GeomFieldDefn::Ignored or set the keyword in
# schema in creation.
#
# @note a.k.a. GetGeometryIgnored (only get), SetGeometryIgnored (only set)
#
# Get or set the ignore status of geometry when fetching features.
# @return the ignore status of geometry
# @since 1.9.0

## @ignore StyleIgnored

## @method $IsStyleIgnored()
# Get the ignore status of style information when fetching features.
# @return the ignore status of style information
# @since 1.9.0

## @method SetStyleIgnored($IgnoreState)
# Set the ignore status of style information when fetching features.
# @since 1.9.0

## @method IsSame(Geo::OGR::FeatureDefn defn)
# @return true if this definition is similar to the other definition,
# false otherwise.




## @class Geo::OGR::FieldDefn
# @brief A definition of a non-spatial attribute.
# @details
# @isa (Geo::OGR)

## @sub list Types
# Field types supported by GDAL. Current list is
# +list Geo::OGR OFT
# (However, WideString is not supported.)

## @sub list JustifyValues
# Justify values supported by GDAL. Current list is
# +list Geo::OGR OJ

## @cmethod Geo::OGR::FieldDefn new(%params)
# @brief Create a new field definition.
#
# @param Named parameters:
# - \a Name Field name (default is 'unnamed').
# - \a Type Field type, one of Geo::OGR::FieldDefn::Types (default is 'String').
# - \a SubType Field sub type, one of Geo::OGR::FieldDefn::SubTypes.
# - \a Justify Justify value, one of Geo::OGR::FieldDefn::JustifyValues
# - \a Width
# - \a Precision
# - \a Nullable (default is true)
# - \a Default
# - \a Ignored (default is false)
# @return a new Geo::OGR::FieldDefn object

## @method \%Schema(%params)
# Get the schema or set parts of the schema
# @param params [optional] as those in Geo::OGR::FieldDefn::new.
# @return a reference to a hash whose keys are as those in Geo::OGR::FieldDefn::new.

## @ignore GetName
## @ignore GetNameRef
## @ignore SetName

## @method $Name($name)
# Get and/or set the name of the field.
# @note a.k.a. GetName, GetNameRef, SetName
# @param name [optional]
# @return the name in non-void context

## @ignore GetFieldTypeName
## @ignore GetTypeName
## @ignore GetType
## @ignore SetType

## @method $Type($type)
# Get and/or set the type of the field.
# @note a.k.a. GetFieldTypeName, GetTypeName, GetType, SetType
# @param type [optional] One of field types (Geo::OGR::FieldDefn::Types).
# @return one of field types in non-void context.

## @ignore GetSubType
## @ignore SetSubType

## @method $SubType($SubType)
# @note a.k.a. GetSubType, SetSubType
# @param SubType [optional] One of field sub types (Geo::OGR::FieldDefn::SubTypes).
# @return the sub type of this field in non-void context.

## @ignore GetJustify
## @ignore SetJustify

## @method $Justify($justify)
# Get and/or set the justification of this field.
# @note a.k.a. GetJustify, SetJustify
# @param justify [optional] One of field justify types (Geo::OGR::FieldDefn::JustifyValues).
# @return the justify value of this field in non-void context.

## @ignore GetWidth
## @ignore SetWidth

## @method $Width($width)
# Get and/or set the field width.
# @note a.k.a. GetWidth, SetWidth
# @param width [optional]
# @return the width of this field in non-void context.

## @ignore GetPrecision
## @ignore SetPrecision

## @method $Precision($precision)
# Get and/or set the precision of this field.
# @note a.k.a. GetPrecision, SetPrecision
# @param precision [optional]
# @return the precision of this field in non-void context.

## @ignore IsNullable
## @ignore SetNullable

## @method $Nullable($nullable)
# Get or set the nullable constraint for this field.
# @note a.k.a. IsNullable and SetNullable
# @param nullable [optional]
# @return the nullable value of this field in non-void context.

## @ignore GetDefault
## @ignore SetDefault

## @method $Default($value)
# Get or set the default value for this field.
# @note a.k.a. GetDefault and SetDefault
# @param value [optional]
# @return the default value of this field in non-void context.

## @ignore IsIgnored
## @ignore SetIgnored

## @method $Ignored($ignore)
# Get and/or set the ignore status (whether this field should be
# omitted when fetching features) of this field.
# @note a.k.a. IsIgnored, SetIgnored
# @param ignore [optional]
# @return the ignore status of this field in non-void context.
# @since 1.9.0




## @class Geo::OGR::GeomFieldDefn
# @brief A definition of a spatial attribute.
# @details
# @isa (Geo::OGR)

## @cmethod Geo::OGR::GeomFieldDefn new(%params)
# @brief Create a new spatial field definition.
#
# @param params one or more of:
# - \a Name name for the field (default is 'geom').
# - \a GeometryType type for the field type, one of Geo::OGR::GeomFieldDefn::Types (default is 'Unknown').
# - \a SpatialReference a Geo::OSR::SpatialReference object.
# - \a Nullable (default is true)
# - \a Ignored (default is false)
# @return a new Geo::OGR::GeomFieldDefn object

## @method \%Schema(%params)
# Get the schema or set parts of the schema.
# @param params [optional] as those in Geo::OGR::GeomFieldDefn::new.
# @return a reference to a hash whose keys are as those in Geo::OGR::GeomFieldDefn::new.

## @method Type
# @return the type of this geometry field. One of Geo::OGR::GeomFieldDefn::Types

## @sub Types
# @return a list of all geometry types, currently:
# +list Geo::OGR wkb 25DBit,25Bit,NDR,XDR

## @ignore GetName
## @ignore GetNameRef
## @ignore SetName

## @method $Name($name)
# @note a.k.a. GetName, GetNameRef, SetName
# @return the name of the field.

## @ignore GetType
## @ignore SetType

## @method $GeometryType($type)
# @note a.k.a. GetType, SetType
# @return the geometry type of the field.

## @ignore GetSpatialRef
## @ignore SetSpatialRef

## @method $SpatialReference($sr)
# @note a.k.a. GetSpatialRef, SetSpatialRef
# @return the spatial reference of the field as a Geo::OSR::SpatialReference object.

## @ignore IsNullable
## @ignore SetNullable

## @method $Nullable($nullable)
# @note a.k.a. IsNullable, SetNullable
# @return the nullable status of the field.

## @ignore IsIgnored
## @ignore SetIgnored

## @method $Ignored($ignore)
# @note a.k.a. IsIgnored, SetIgnored
# @return the ignore status of the field.




## @class Geo::OGR::Geometry
# @brief Spatial data.
# @details A geometry is spatial data (coordinate values, and a reference to a
# spatial reference system) organized into one of the geometry
# types. Geometries can be created from several type of data including
# a Perl data structure. There are several methods, which modify,
# compare, test, or compute values from geometries.
# @note Most spatial analysis methods require <a
# href="http://geos.osgeo.org/doxygen/">GEOS</a> to work rigorously.
# @isa (Geo::OGR)

## @sub @GeometryTypes()
# Same as Geo::OGR::GeometryTypes

## @sub list ByteOrders
# Same as Geo::OGR::ByteOrders

## @cmethod Geo::OGR::Geometry new(%params)
# @param %params A named parameter, one of:
# - \a GeometryType one the supported geometry types, see Geo::OGR::GeometryTypes.
# - \a WKT a well known text string, which defines a geometry.
# - \a WKB a well known binary string, which defines a geometry.
# - \a HEXWKB WKB in hexadecimal.
# - \a HEXEWKB PostGIS extended WKB.
# - \a GML geometry written in Geographic Markup Language.
# - \a GeoJSON geometry written in GeoJSON (JavaScript Object Notation for Geographic data).
# - \a arc a reference to a list of values defining an arc: [CenterX,
#    CenterY, CenterZ, PrimaryRadius, SecondaryRadius, Rotation,
#    StartAngle, EndAngle, MaxAngleStepSizeDegrees] (see also Geo::OGR::Geometry::ApproximateArcAngles)
# - \a Points An anonymous array as in method
#      Geo::OGR::Geometry::Points; Note: requires also GeometryType
#      parameter
#
# @return a new Geo::OGR::Geometry object.

## @sub Geo::OGR::Geometry ApproximateArcAngles(%params)
# Create a line string, which approximates an arc.
# @note All angles are in degrees.
#
# @param %params Named parameters:
# - \a Center center point (default is [0, 0, 0])
# - \a PrimaryRadius default is 1.
# - \a SecondaryAxis default is 1.
# - \a Rotation default is 0.
# - \a StartAngle default is 0.
# - \a EndAngle default is 360.
# - \a MaxAngleStepSizeDegrees default is 4.
# @return a new Geo::OGR::Geometry object.

## @method FlattenTo2D()

## @method $CoordinateDimension($dimension)
# @param dimension [optional]
# @return 2 or 3

## @method $GetCoordinateDimension()
# @return an integer

## @method SetCoordinateDimension($dimension)
# @param dimension

## @method $GetDimension()
# @return 0, 1, or 2

## @ignore AsText
## @ignore ExportToWkt
## @ignore ExportToIsoWkt
## @ignore AsBinary
## @ignore AsHEXWKB
## @ignore AsHEXEWKB
## @ignore ExportToWkb
## @ignore ExportToIsoWkb
## @ignore AsGML
## @ignore ExportToGML
## @ignore AsKML
## @ignore ExportToKML
## @ignore AsJSON
## @ignore ExportToJson

## @method $As(%params)
# Export the geometry into a known format.
#
# @param params Named parameters:
# - \a Format One of
#     - \a WKT Well Known Text.
#     - <em>ISO WKT</em>
#     - \a Text Same as WKT.
#     - \a WKB Well Known Binary.
#     - <em>ISO WKB</em>
#     - \a Binary Same as WKB.
#     - \a HEXWKB
#     - \a HEXEWKB
#     - \a GML
#     - \a GeoJSON
# - \a ByteOrder Byte order for binary formats. Default is 'XDR'.
# - \a SRID Spatial reference id for HEXEWKB.
# - \a Options GML generation options.
# - \a AltitudeMode For KML.
#
# @return the geometry in a given format.

## @method AddPoint($x, $y, $z)
# Set the data of a point or add a point to a line string. Consider
# using Geo::OGR::Geometry::Points.  Note that the coordinate
# dimension is automatically upgraded to 25D (3) if z is given.
# @param x
# @param y
# @param z [optional]
# Calls internally the 2D or 3D version depending on the number of parameters.

## @method AddPoint_2D($x, $y)
# Set the data of a point or add a point to a line string. Consider
# using Geo::OGR::Geometry::Points.
# @param x
# @param y

## @method AddPoint_3D($x, $y, $z)
# Set the data of a point or add a point to a line string. Note that
# the coordinate dimension is automatically upgraded to 25D (3). Consider
# using Geo::OGR::Geometry::Points.
# @param x
# @param y
# @param z

## @method SetPoint($index, $x, $y, $z)
# Set the data of a point or a line string. Note that the coordinate
# dimension is automatically upgraded to 25D (3) if z is given.
# @param index
# @param x
# @param y
# @param z [optional]

## @method SetPoint_2D($index, $x, $y)
# @param index
# @param x
# @param y

## @method SetPoint_3D($index, $x, $y, $z)
# Set the data of a point or a line string. Note that the coordinate
# dimension is automatically upgraded to 25D (3).
# @param index
# @param x
# @param y
# @param z

## @method $GetPointCount()
# @return an integer

## @method @GetPoint($index = 0)
# @param index
# @return (x,y) or a list with more coordinates

## @method $GetPoint_2D($index = 0)
# @param index
# @return (x,y) or a list with more coordinates

## @method $GetPoint_3D($index = 0)
# @param index
# @return (x,y) or a list with more coordinates

## @method $GetX($index = 0)
# @param index
# @return a number

## @method $GetY($index = 0)
# @param index
# @return a number

## @method $GetZ($index = 0)
# @param index
# @return a number

## @method @Point($index, $x, $y, $z)
# Get or set the point
# @param index The index of the point. Optional (ignored if given) for
# Point and Point25D geometries.
# @param x [optional]
# @param y [optional]
# @param z [optional]
# @return

## @method \@Points(arrayref points)
# Get or set the points of the geometry. The points (vertices) are
# stored in obvious lists of lists. When setting, the geometry is
# first emptied. The method uses internally either AddPoint_2D or
# AddPoint_3D depending on the coordinate dimension of the input data.
#
# @note The same structure may represent different geometries
# depending on the actual geometry type of the object.
#
# @param points [optional] A reference to an array. A point is a reference to an
# array of numbers, a linestring or a ring is a reference to an array of points,
# a polygon is a reference to an array of rings, etc.
#
# @return A reference to an array.

## @method Empty()
# Clear geometry data, i.e., remove all points, or, for a point, set
# the coordinate dimension as zero.

## @method $IsEmpty()
# Test whether the geometry is empty (has no points, or, for a point,
# has coordinate dimension of zero).
# @return boolean

## @method $IsRing()
# Test if the geometry is a ring. Requires GEOS in GDAL.
# @return boolean

## @method $IsSimple()
# Test the simplicity of the geometry (OGC sense). Requires GEOS in GDAL.
# @return boolean

## @method $IsValid()
# Test the validity of the geometry (OGC sense). Requires GEOS in GDAL.
# @return boolean

## @method Move($dx, $dy, $dz)
# Move every point of the object as defined by the parameters.
# @param dx
# @param dy
# @param dz [optional]

## @method AddGeometryDirectly($other)
# @param other a Geo::OGR::Geometry object

## @method AddGeometry($other)
# Add a copy of another geometry to a geometry collection
# @param other a Geo::OGR::Geometry object

## @method Geo::OGR::Geometry Clone()
# @return a new Geo::OGR::Geometry object

## @method $GeometryType()
# @return the geometry type of this geometry (one of Geo::OGR::GeometryTypes).

## @method $Length()
# @return the length of the linestring

## @ignore GetArea

## @method $Area()
# @note a.k.a. GetArea
# @return the area of the polygon or multipolygon

## @method $GetGeometryCount()
# @return an integer

## @method $GetGeometryRef($index)
# @param index index to the geometry, which is a part of this geometry
# @return a new Geo::OGR::Geometry object whose data is a part of the
# parent geometry

## @method Geo::OGR::Geometry ConvexHull()
# @return a new Geo::OGR::Geometry object

## @method Geo::OGR::Geometry BuildPolygonFromEdges($BestEffort = 0, $AutoClose = 0, $Tolerance = 0)
# Attempt to create a polygon from a collection of lines or from a multilinestring.
# @param BestEffort For future
# @param AutoClose Assure the first and last points of rings are same.
# @param Tolerance Snap distance.
# @exception Several possibilities, some are reported, some are general errors.
# @return a new Geo::OGR::Geometry object (Polygon)

## @method Geo::OGR::Geometry Collect(@geometries)
# Create a geometrycollection from this and possibly other geometries.
# @param geometries [optional] More geometries to add to the collection.
# @return a new Geo::OGR::Geometry object of type geometrycollection.

## @method @Dissolve()
# Dissolve a geometrycollection into separate geometries.
# @return a list of new Geo::OGR::Geometry objects cloned from the collection.

## @method Geo::OGR::Geometry ForceTo($type, ref options)
# Attempt to make a geometry of type 'type' out of this geometry.
# @param type target geometry type. One of Geo::OGR::GeometryTypes.
# @param options not used currently.
# @return a new Geo::OGR::Geometry object.

## @method Geo::OGR::Geometry ForceToLineString()
# Attempt to create a line string from this geometry.
# @return a new Geo::OGR::Geometry object.

## @method Geo::OGR::Geometry ForceToPolygon()
# Attempt to create a polygon from this geometry.
# @exception None reported. If this method fails, just a copy is returned.
# @return a new Geo::OGR::Geometry object.

## @method Geo::OGR::Geometry ForceToMultiPoint(@points)
# Attempt to create a multipoint from the geometry, which must be a point.
# @param points [optional] More points to add to the collection.
# @return a new Geo::OGR::Geometry object of type multipoint.

## @method Geo::OGR::Geometry ForceToMultiLineString(@linestrings)
# Attempt to create a multilinestring from the geometry, which must be a linestring.
# @param linestrings [optional] More linestrings to add to the collection.
# @return a new Geo::OGR::Geometry object of type multilinestring.

## @method Geo::OGR::Geometry ForceToMultiPolygon(@polygons)
# Attempt to create a multipolygon from the geometry, which must be a polygon.
# @param polygons [optional] More polygons to add to the collection.
# @return a new Geo::OGR::Geometry object of type multipolygon.

## @method Geo::OGR::Geometry ForceToCollection(@geometries)
# Create a geometrycollection from the geometry.
# @param geometries [optional] More geometries to add to the collection.
# @return a new Geo::OGR::Geometry object of type geometrycollection.

## @method Geo::OGR::Geometry Buffer($distance, $quadsecs = 30)
# @param distance
# @param quadsecs
# @return a new Geo::OGR::Geometry object

## @method Geo::OGR::Geometry Intersection($other)
# @param other a Geo::OGR::Geometry object
# @return a new Geo::OGR::Geometry object

## @method Geo::OGR::Geometry Union($other)
# @param other a Geo::OGR::Geometry object
# @return a new Geo::OGR::Geometry object

## @method Geo::OGR::Geometry UnionCascaded()
# @return a new Geo::OGR::Geometry object
# @since 1.8.0

## @method Geo::OGR::Geometry Difference($other)
# @param other a Geo::OGR::Geometry object
# @return a new Geo::OGR::Geometry object

## @ignore SymmetricDifference

## @method Geo::OGR::Geometry SymDifference($other)
# Compute symmetric difference.
# @note a.k.a. SymmetricDifference
# @param other a Geo::OGR::Geometry object
# @return a new Geo::OGR::Geometry object
# @since 1.8.0

## @ignore GetBoundary

## @method Geo::OGR::Geometry Boundary()
# @note a.k.a. GetBoundary
# @return the boundary of this geometry as a geometry
# @since 1.8.0

## @method $Distance($other)
# @param other a Geo::OGR::Geometry object
# @return the distance to the other geometry

## @ignore Intersect

## @method $Intersects($other)
# @note a.k.a. Intersect (deprecated)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry intersects with the other geometry, false otherwise

## @ignore Equal

## @method $Equals($other)
# @note a.k.a. Equal (deprecated)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry is equivalent to the other geometry, false otherwise

## @method $Disjoint($other)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry is disjoint from the other geometry, false otherwise

## @method $Touches($other)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry touches the other geometry, false otherwise

## @method $Crosses($other)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry crosses the other geometry, false otherwise

## @method $Within($other)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry is within the other geometry, false otherwise

## @method $Contains($other)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry contains the other geometry, false otherwise

## @method $Overlaps($other)
# @param other a Geo::OGR::Geometry object
# @return true if this geometry overlaps the other geometry, false otherwise

## @method Segmentize($MaxLength)
# Modify the geometry such it has no segment longer than the given length.
# @param MaxLength the given length

## @method Geo::OGR::Geometry Simplify($Tolerance)
# Simplify the geometry.
# @param Tolerance the length tolerance for the simplification
# @since 1.8.0
# @return a new Geo::OSR::Geometry object

## @method TransformTo($srs)
# @param srs a Geo::OSR::SpatialReference object

## @method Transform($trans)
# @param trans a Geo::OSR::CoordinateTransformation object

## @method Geo::OSR::SpatialReference GetSpatialReference()
# @return a new Geo::OSR::SpatialReference object

## @method AssignSpatialReference($srs)
# @param srs a Geo::OSR::SpatialReference object

## @method CloseRings()

## @method @GetEnvelope()
# @note In scalar context returns a reference to an anonymous array
# containing the envelope.
# @return the envelope ($minx, $maxx, $miny, $maxy)

## @method @GetEnvelope3D()
# @note In scalar context returns a reference to an anonymous array
# containing the envelope.
# @return the 3-D envelope ($minx, $maxx, $miny, $maxy, $minz, $maxz)
# @since 1.9.0

## @method Geo::OGR::Geometry Centroid()
# @return a new Geo::OGR::Geometry object
# @since 1.8.0

## @method $WkbSize()
# @return an integer

## @method $GetGeometryType()
# @deprecated use Geo::OGR::Geometry::GeometryType, which returns the
# type as a string.
#
# @return type as an integer

## @method $GetGeometryName()
# @deprecated use Geo::OGR::Geometry::GeometryType.
#
# @return a string
