Functions | |
Shapefile | Shapefile.Clone () |
Creates a copy of the shapefile. More... | |
bool | Shapefile.Close () |
Closes shapefile and releases all the resources. More... | |
bool | Shapefile.CreateNew (string shapefileName, ShpfileType shapefileType) |
Initializes in-memory shapefile of the specified type. More... | |
bool | Shapefile.CreateNewWithShapeID (string shapefileName, ShpfileType shapefileType) |
Initializes in-memory shapefile of the specified type with unique index field. More... | |
bool | Shapefile.Dump (string shapefileName, ICallback cBack=null) |
Writes the contents of the shapefile to specified file. More... | |
bool | Shapefile.LoadDataFrom (string shapefileName, ICallback cBack=null) |
Loads data into in-memory shapefile from the specified shapefile on the disk. More... | |
bool | Shapefile.Open (string shapefileName, ICallback cBack) |
Opens shapefile from the disk. More... | |
bool | Shapefile.Resource (string newShpPath) |
Changes file associated with the current instance of the shapefile class. More... | |
bool | Shapefile.Save (ICallback cBack) |
Saves edits of the in-memory shapefile to the disk without closing editing mode. More... | |
bool | Shapefile.SaveAs (string shapefileName, ICallback cBack) |
Saves in-memory shapefile to the disk. More... | |
bool | Shapefile.SaveAsEx (string newFilename, bool stopEditing, bool unboundFile) |
Saves shapefile to the disk. More... | |
Here is a list of methods which affect the state of the shapefile. This module is a part of the documentation of Shapefile class.
Shapefile Shapefile.Clone | ( | ) |
Creates a copy of the shapefile.
Output shapefile will have the same type, projection and fields of the attribute table, while shapes and the records of the attribute table aren't copied. For complete copy of the shapefile use Shapefile.SelectAll() and Shapefile.ExportSelection().
bool Shapefile.Close | ( | ) |
Closes shapefile and releases all the resources.
In case shapefile is in editing mode (Shapefile.EditingShapes = true) all the edits will be discarded.
bool Shapefile.CreateNew | ( | string | shapefileName, |
ShpfileType | shapefileType | ||
) |
Initializes in-memory shapefile of the specified type.
Shapefile.EditingShapes property for the new shapefile will be set to true. Any shapefile opened in this instance of class before this call, will be closed without saving the changes.
shapefileName | The name of the new shapefile. An empty string should be passed here. |
shapefileType | Type of the shapefile to create. |
Use Shapefile.ErrorMsg(Shapefile.LastErrorCode) to find out the reason of failure.
bool Shapefile.CreateNewWithShapeID | ( | string | shapefileName, |
ShpfileType | shapefileType | ||
) |
Initializes in-memory shapefile of the specified type with unique index field.
MWShapeID field will be added to the attribute table. An increasing unique positive integer value will be set in this field for each shape added to the shapefile. The field with MWShapeID name created manually will be treated in the same way.
shapefileName | The name of the new shapefile. An empty string should be passed here. |
shapefileType | Type of the shapefile to create. |
bool Shapefile.Dump | ( | string | shapefileName, |
ICallback | cBack = null |
||
) |
Writes the contents of the shapefile to specified file.
shapefileName | Filename to write shapefile data to. |
cBack | Callback interface. |
The state of shapefile won't be affected, i.e. in-memory shapefile will remain in-memory one.
bool Shapefile.LoadDataFrom | ( | string | shapefileName, |
ICallback | cBack = null |
||
) |
Loads data into in-memory shapefile from the specified shapefile on the disk.
shapefileName | Filename of the shapefile to load from. |
cBack | Callback interface. |
The shapefile object with remain in in-memory state.
bool Shapefile.Open | ( | string | shapefileName, |
ICallback | cBack | ||
) |
Opens shapefile from the disk.
Any other shapefile currently opened will be closed without saving the changes. Shapefile.SourceType property will be set to sstDiskBased.
shapefileName | The name of the file to open (.shp extension). |
cBack | A callback object to report errors and progress information. |
bool Shapefile.Resource | ( | string | newShpPath | ) |
Changes file associated with the current instance of the shapefile class.
It is equivalent to consequent calling of Shapefile.Close and Shapefile.Open.
newShpPath | The filename of the new shapefile to be opened. |
bool Shapefile.Save | ( | ICallback | cBack | ) |
Saves edits of the in-memory shapefile to the disk without closing editing mode.
Applicable only when Shapefile.EditingShapes = true.
cBack | A callback object to report errors and progress information. |
bool Shapefile.SaveAs | ( | string | shapefileName, |
ICallback | cBack | ||
) |
Saves in-memory shapefile to the disk.
shapefileName | The name of the file to save data in. |
cBack | A callback object to report errors and progress information. |
bool Shapefile.SaveAsEx | ( | string | newFilename, |
bool | stopEditing, | ||
bool | unboundFile | ||
) |
Saves shapefile to the disk.
newFilename | The new filename. |
stopEditing | If set to true the editing for shapefile will be stopped. |
unboundFile | If set to true the file will not be assigned as a source of this instance. |