Уважаемые знатоки. не подскажите ,как добавить собственно данные в шейп и прежде всего каким образом можно определить количество существующих записей в шейпе(для получения стартового значения IFeatureCursor)
Текс процедуры для создания шейпа в котором отсутствуют записи следующий:
Public Sub CreateShapefile()
Const strFolder As String = "D:\Data"
Const strName As String = "MyShapeFile" ' Dont include .shp extension
Const strShapeFieldName As String = "Shape"
' Open the folder to contain the shapefile as a workspace
Dim pFWS As IFeatureWorkspace
Dim pWorkspaceFactory As IWorkspaceFactory
Set pWorkspaceFactory = New ShapefileWorkspaceFactory
Set pFWS = pWorkspaceFactory.OpenFromFile(strFolder, 0)
' Set up a simple fields collection
Dim pFields As IFields
Dim pFieldsEdit As IFieldsEdit
Set pFields = New esriCore.Fields
Set pFieldsEdit = pFields
Dim pField As IField
Dim pFieldEdit As IFieldEdit
' Make the shape field
' it will need a geometry definition, with a spatial reference
Set pField = New esriCore.Field
Set pFieldEdit = pField
pFieldEdit.Name = strShapeFieldName
pFieldEdit.Type = esriFieldTypeGeometry
Dim pGeomDef As IGeometryDef
Dim pGeomDefEdit As IGeometryDefEdit
Set pGeomDef = New GeometryDef
Set pGeomDefEdit = pGeomDef
With pGeomDefEdit
.GeometryType = esriGeometryPolygon
Set .SpatialReference = New UnknownCoordinateSystem
End With
Set pFieldEdit.GeometryDef = pGeomDef
pFieldsEdit.AddField pField
' Add another miscellaneous text field
Set pField = New esriCore.Field
Set pFieldEdit = pField
With pFieldEdit
.Length = 30
.Name = "MiscText"
.Type = esriFieldTypeString
End With
pFieldsEdit.AddField pField
' Create the shapefile
' (some parameters apply to geodatabase options and can be defaulted as Nothing)
Dim pFeatClass As IFeatureClass
Set pFeatClass = pFWS.CreateFeatureClass(strName, pFields, Nothing, _
Nothing, esriFTSimple, strShapeFieldName, "")
End Sub
Заранее благодарен.