public class OGRConverter extends Object
Constructor and Description |
---|
OGRConverter() |
Modifier and Type | Method and Description |
---|---|
org.gdal.ogr.Feature |
convert(FeatureDefn layerDefn,
org.gdal.ogr.Feature feature)
Convert OGR Feature to another OGR Feature.
|
FeatureType |
convert(FeatureDefn featureDefn,
String defaultGeometryField)
|
Feature |
convert(FeatureProvider featureProvider)
Converts
FeatureProvider to Feature . |
FeatureProvider |
convert(FeatureProvider featureProvider,
FeatureType featureType,
Feature ogrFeature)
Converts
Feature to FeatureProvider . |
FieldDefn |
convertField(FeatureAttributeDescriptor attDescriptor)
Converts
FeatureAttributeDescriptor to FieldDefn |
List<FieldDefn> |
convertFields(FeatureType featureType)
|
List<GeomFieldDefn> |
convertGeometryFields(FeatureType featureType,
boolean convertDefaultGeometryColumn)
|
GeomFieldDefn |
convertGeomField(FeatureAttributeDescriptor attDescriptor)
Converts
FeatureAttributeDescriptor to GeomFieldDefn |
int |
convertToDataType(int type)
Convert OGR type to gvSIG type.
|
int |
convertToGeomType(int type)
Convert OGR geometry type to gvSIG geometry type.
|
int |
convertToOGRGeomType(int type)
Convert gvSIG geometry type to OGR geometry type.
|
int |
convertToOGRType(int type)
Convert gvSIG type to OGR type.
|
public FeatureType convert(FeatureDefn featureDefn, String defaultGeometryField) throws GeometryTypeNotSupportedException, GeometryTypeNotValidException
featureDefn
- OGR definition to be converteddefaultGeometryField
- Default geometry field. If it is not founded, this method will
take the first geometry field.GeometryTypeNotSupportedException
- If there are problems parsing OGR geometryGeometryTypeNotValidException
- If type of OGR Geometry is not supportedpublic List<FieldDefn> convertFields(FeatureType featureType)
featureType
- Fields to be convertedpublic FieldDefn convertField(FeatureAttributeDescriptor attDescriptor)
FeatureAttributeDescriptor
to FieldDefn
attDescriptor
- public List<GeomFieldDefn> convertGeometryFields(FeatureType featureType, boolean convertDefaultGeometryColumn)
featureType
- Geometry fields to be convertedconvertDefaultGeometryColumn
- True if default geometry will be converted, otherwise default
geometry field won't be converted.public GeomFieldDefn convertGeomField(FeatureAttributeDescriptor attDescriptor)
FeatureAttributeDescriptor
to GeomFieldDefn
attDescriptor
- Attribute to be convertedpublic FeatureProvider convert(FeatureProvider featureProvider, FeatureType featureType, Feature ogrFeature)
Feature
to FeatureProvider
. If
FeatureProvider
is null, it will be instantiated. This method
only takes into account the fields of received FeatureType
.featureProvider
- featureType
- Type of feature providerogrFeature
- OGR Feature to be convertedpublic Feature convert(FeatureProvider featureProvider) throws GeometryOperationNotSupportedException, GeometryOperationException
FeatureProvider
to Feature
.featureProvider
- Feature provider to be convertedGeometryOperationNotSupportedException
- If operation used to convert geometries is not supportedGeometryOperationException
- If there are some problems converting geometriespublic int convertToOGRGeomType(int type)
ogrConstants
.type
- A type of Geometry.TYPES
ogrConstants
public int convertToGeomType(int type)
Geometry.TYPES
.type
- A type of ogrConstants
Geometry.TYPES
public int convertToOGRType(int type)
ogrConstants
.type
- A type of DataTypes
ogrConstants
public int convertToDataType(int type)
DataTypes
.type
- A type of ogrConstants
DataTypes
public org.gdal.ogr.Feature convert(FeatureDefn layerDefn, org.gdal.ogr.Feature feature)
FeatureDefn
fields to create new feature. This method is
useful when OGR Layer
is copied to new DataSource
.layerDefn
- Definition of new featurefeature
- OGR feature to be converted