Provides access to members that Import/Export ArcObjects geometries to Esri shapefile format.
Members
Name | Description | |
---|---|---|
AttachToESRIShape | Takes ownership of the input Esri shapefile format buffer. The geometry must be deleted, set to empty, edited, or imported from/attached to a different buffer before the buffer can be re-used. | |
ESRIShapeSize | The size of the buffer, in bytes, that will be required to hold the Esri shapefile formatted version of the geometry. The value may exceed the minimum required size. | |
ESRIShapeSizeEx | The size of the buffer (in bytes) that will be required to hold the Esri shapefile version of the geometry. Only attributes specified by modifiers to allow will be exported. The value may exceed the minimum required size. ModifiersToAllow is a combination of e | |
ExportToESRIShape | Writes an Esri shapefile formatted version of this geometry to the specified buffer. Returns the exact number of bytes written to the buffer. | |
ExportToESRIShapeEx | Writes an Esri shapefile formatted version of this geometry to the specified buffer. Only exports attributes specified by modifiersToAllow (combination of esriShapeExportFlags values.). Returns the exact number of bytes written to the buffer. | |
GetModifierOffset | Finds out the byte offsets within a shape buffer at which an exported attribute can be found. Only works if the shape hasn't changed since the last call to ExportToESRIShape or ExportToESRIShapeEx. | |
ImportFromESRIShape | Defines this geometry from the input Esri shapefile formatted buffer. Assumes the buffer describes a topologically correct geometry. Returns the exact number of bytes read from the buffer. | |
NonTrustedImportFromESRIShape | Defines this geometry from the contents of the input Esri shapefile formatted buffer. Does not assume that the buffer describes a topological correct geometry. Returns the exact number of bytes read from the buffer. | |
QueryESRIShapeType | Returns the basic type and modifiers (combination of esriShapeModifiers) that define the geometry's shape type, as it was last exported. |
IESRIShape.AttachToESRIShape Method
Takes ownership of the input Esri shapefile format buffer. The geometry must be deleted, set to empty, edited, or imported from/attached to a different buffer before the buffer can be re-used.
Public Sub AttachToESRIShape ( _
ByRef byteCountInOut As Integer, _
ByRef byteBuffer As Byte& _
)
public void AttachToESRIShape (
ref int byteCountInOut,
ref Byte& byteBuffer
);
IESRIShape.ESRIShapeSize Property
The size of the buffer, in bytes, that will be required to hold the Esri shapefile formatted version of the geometry. The value may exceed the minimum required size.
Public ReadOnly Property ESRIShapeSize As Integer
public int ESRIShapeSize {get;}
IESRIShape.ESRIShapeSizeEx Property
The size of the buffer (in bytes) that will be required to hold the Esri shapefile version of the geometry. Only attributes specified by modifiers to allow will be exported. The value may exceed the minimum required size. ModifiersToAllow is a combination of e.
Public Function get_ESRIShapeSizeEx ( _
ByVal modifiersToAllow As Integer _
) As Integer
public int get_ESRIShapeSizeEx (
int modifiersToAllow
);
IESRIShape.ExportToESRIShape Method
Writes an Esri shapefile formatted version of this geometry to the specified buffer. Returns the exact number of bytes written to the buffer.
Public Sub ExportToESRIShape ( _
ByRef byteCountInOut As Integer, _
ByRef byteBuffer As Byte& _
)
public void ExportToESRIShape (
ref int byteCountInOut,
ref Byte& byteBuffer
);
IESRIShape.ExportToESRIShapeEx Method
Writes an Esri shapefile formatted version of this geometry to the specified buffer. Only exports attributes specified by modifiersToAllow (combination of esriShapeExportFlags values.). Returns the exact number of bytes written to the buffer.
Public Sub ExportToESRIShapeEx ( _
ByVal modifiersToAllow As Integer, _
ByVal useArcViewNaNs As Boolean, _
ByRef byteCountInOut As Integer, _
ByRef byteBuffer As Byte& _
)
public void ExportToESRIShapeEx (
int modifiersToAllow,
bool useArcViewNaNs,
ref int byteCountInOut,
ref Byte& byteBuffer
);
IESRIShape.GetModifierOffset Method
Finds out the byte offsets within a shape buffer at which an exported attribute can be found. Only works if the shape hasn't changed since the last call to ExportToESRIShape or ExportToESRIShapeEx.
Public Sub GetModifierOffset ( _
ByVal modifierType As esriShapeModifiers, _
ByRef Offset As Integer _
)
public void GetModifierOffset (
esriShapeModifiers modifierType,
ref int Offset
);
IESRIShape.ImportFromESRIShape Method
Defines this geometry from the input Esri shapefile formatted buffer. Assumes the buffer describes a topologically correct geometry. Returns the exact number of bytes read from the buffer.
Public Sub ImportFromESRIShape ( _
ByRef byteCountInOut As Integer, _
ByRef byteBuffer As Byte& _
)
public void ImportFromESRIShape (
ref int byteCountInOut,
ref Byte& byteBuffer
);
IESRIShape.NonTrustedImportFromESRIShape Method
Defines this geometry from the contents of the input Esri shapefile formatted buffer. Does not assume that the buffer describes a topological correct geometry. Returns the exact number of bytes read from the buffer.
Public Sub NonTrustedImportFromESRIShape ( _
ByRef byteCountInOut As Integer, _
ByRef byteBuffer As Byte& _
)
public void NonTrustedImportFromESRIShape (
ref int byteCountInOut,
ref Byte& byteBuffer
);
IESRIShape.QueryESRIShapeType Method
Returns the basic type and modifiers (combination of esriShapeModifiers) that define the geometry's shape type, as it was last exported.
Public Sub QueryESRIShapeType ( _
ByRef basicShapeType As esriShapeType, _
ByRef shapeModifiers As Integer _
)
public void QueryESRIShapeType (
ref esriShapeType basicShapeType,
ref int shapeModifiers
);
Classes that implement IESRIShape
Classes | Description |
---|
Remarks
Shape modifiers are used in certain methods of this interface. For instance they are used to define which geometry attributes to allow when exporting or importing a geometry.
As an example, the C# method below shows how modifiers can be used to strip off the m-values of a geometry by exporting it with a bitwise combination of modifiers and then re-importing the resulting geometry.
void IESRIShape_Methods(ref IGeometry geomToChange)
{
IESRIShape shp = geomToChange as IESRIShape;
IGeometry geom = shp as IGeometry;
long size = shp.ESRIShapeSize;
esriShapeModifiers modifier = esriShapeModifiers.esriShapeHasIDs | esriShapeModifiers.esriShapeHasZs | esriShapeModifiers.esriShapeHasCurves;
size = shp.get_ESRIShapeSizeEx((int)modifier);
byte[] buffer = new byte[size];
int count = 0;
shp.ExportToESRIShapeEx((int)modifier, true, ref count, out buffer[0]);
shp.ImportFromESRIShape(ref count, ref buffer[0]);
geomToChange = geom;
}