Interface IESRIShape
Provides access to members that Import/Export ArcObjects geometries to Esri shapefile format.
[Guid("7B91FF70-53A9-11D0-A8F3-00608C85EDE5")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IESRIShape
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;
}
Properties
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.
int ESRIShapeSize { get; }
Property Value
ESRIShapeSizeEx[int]
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
int ESRIShapeSizeEx[int modifiersToAllow] { get; }
Parameters
modifiersToAllowint
Property Value
Methods
AttachToESRIShape(ref int, ref byte)
Attaches geometry to the external 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, otherwise the buffer must be kept alive until geometry is dest
void AttachToESRIShape(ref int byteCountInOut, ref byte byteBuffer)
Parameters
ExportToESRIShape(ref int, out byte)
Writes an Esri shapefile formatted version of this geometry to the specified buffer. Returns the exact number of bytes written to the buffer.
void ExportToESRIShape(ref int byteCountInOut, out byte byteBuffer)
Parameters
ExportToESRIShapeEx(int, bool, ref int, out byte)
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.
void ExportToESRIShapeEx(int modifiersToAllow, bool useArcViewNaNs, ref int byteCountInOut, out byte byteBuffer)
Parameters
GetModifierOffset(esriShapeModifiers, out int)
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.
void GetModifierOffset(esriShapeModifiers modifierType, out int Offset)
Parameters
modifierTypeesriShapeModifiersOffsetint
ImportFromESRIShape(ref int, ref byte)
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.
void ImportFromESRIShape(ref int byteCountInOut, ref byte byteBuffer)
Parameters
NonTrustedImportFromESRIShape(ref int, ref byte)
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.
void NonTrustedImportFromESRIShape(ref int byteCountInOut, ref byte byteBuffer)
Parameters
QueryESRIShapeType(ref esriShapeType, ref int)
Returns the basic type and modifiers (combination of esriShapeModifiers) that define the geometry's shape type, as it was last exported.
void QueryESRIShapeType(ref esriShapeType basicShapeType, ref int shapeModifiers)
Parameters
basicShapeTypeesriShapeTypeshapeModifiersint