Skip to content

ShapeFileFeatureLayer

Namespace: ThinkGeo.Core

This class represents a Layer backed by a Shape File.

public class ShapeFileFeatureLayer : FeatureLayer

Inheritance Object → Layer → FeatureLayer → ShapeFileFeatureLayer

Remarks:

None

Properties

HasBoundingBox

This property checks to see if a Layer has a BoundingBox or not. If it has no BoundingBox, it will throw an exception when you call the GetBoundingBox() and GetFullExtent() APIs. In ShapeFileFeatureLayer, we override this API and mark it as true.

public bool HasBoundingBox { get; }

Property Value

Boolean

Remarks:

The default implementation in the base class returns false.

UsingSpatialIndex

This property gets whether the Shape File FeatureSource has an index or not.

public bool UsingSpatialIndex { get; }

Property Value

Boolean

Encoding

This property gets and sets the encoding information for the DBF.

public Encoding Encoding { get; set; }

Property Value

Encoding

ShapePathFilename

This property returns the path and filename of the Shape File you want to represent.

public string ShapePathFilename { get; set; }

Property Value

String

        This property returns the path and filename of the Shape File you want to
        represent.

Exceptions

ArgumentException
Setting an invalid PathFilename structure will throw an ArgumentException.

Remarks:

None

IndexPathFilename

This property returns the path and filename of the index file you want to represent.

public string IndexPathFilename { get; set; }

Property Value

String

        This property returns the path and filename of the index file you want to
        represent.

Exceptions

ArgumentException
Setting an invalid PathFilename structure will throw an ArgumentException.

Remarks:

None

ReadWriteMode

public FileAccess ReadWriteMode { get; set; }

Property Value

FileAccess

RequireIndex

This property gets and sets whether an index is required when reading data. The default value is true.

public bool RequireIndex { get; set; }

Property Value

Boolean

ProgressiveDrawingRecordsCount

public int ProgressiveDrawingRecordsCount { get; set; }

Property Value

Int32

SimplificationAreaInPixel

public int SimplificationAreaInPixel { get; set; }

Property Value

Int32

Projection

public Projection Projection { get; }

Property Value

Projection

EditTools

This property gets the EditTools that allow you to easily edit InternalFeatures in the Feature Layer.

public EditTools EditTools { get; protected set; }

Property Value

EditTools

        This property gets the EditTools that allow you to easily edit InternalFeatures in the
        Feature Layer.

Remarks:

The EditTools are supplied as an easily accessible wrapper for the editing methods of the FeatureSource.

FeatureIdsToExclude

A collection of strings representing record id of features not to get in the Layer.

public Collection<string> FeatureIdsToExclude { get; }

Property Value

Collection<String>

Remarks:

This string collection is a handy place to specify what records not to get from the source. Suppose you have a shape file of roads and you want to hide the roads within a particular rectangle, simply execute GetFeaturesInsideBoundingBox() and add the id of the return features to the collection and forget about them. Since you can set this by Layer it makes is easy to determine what to and what not to.

QueryTools

This property gets the QueryTools that allow you to easily query Features from the Feature Layer.

public QueryTools QueryTools { get; protected set; }

Property Value

QueryTools

        This property gets the QueryTools that allow you to easily query Features from the
        Feature Layer.

Remarks:

This property gets the QueryTools that allow you to easily query Features from the Feature Layer. The QueryTools are supplied as an easily accessible wrapper for the query methods of the FeatureSource.

MaxRecordsToDraw

public int MaxRecordsToDraw { get; set; }

Property Value

Int32

FeatureSource

This property gets the FeatureSource for the FeatureLayer.

public FeatureSource FeatureSource { get; protected set; }

Property Value

FeatureSource
This property gets the FeatureSource for the FeatureLayer.

Remarks:

The FeatureSource is the provider of data to the FeatureLayer. There are different FeatureSource classes to match the various ways that feature data is stored. It is important that, when you inherit from the FeatureLayer, in the constructor you set the FeatureSource you want to use.

DrawingQuality

This property gets and sets the general drawing quality for the FeatureLayer's view.

public DrawingQuality DrawingQuality { get; set; }

Property Value

DrawingQuality

        This property gets the general drawing quality for the FeatureLayer's
        view.

Remarks:

The DrawingQuality enumeration allows you to control, in a macro sense, the drawing quality that will be used in the GeoCanvas. Each GeoCanvas, which is responsible for drawing of the features, may have its own specialized drawing quality properties. What the DrawingQuality enumeration does is define some general guidelines for each GeoCanvas. For example, if you set the DrawingQuality to HighSpeed, then inside of the PlatformGeoCanvas there is a profile for HighSpeed. This profile sets specific properties, such as the smoothing mode and composing drawing mode of the PlatformGeoCanvas. As each GeoCanvas may have different drawing quality properties, this offers a general way to control drawing quality and speed.

If you need complete control over how a specific GeoCanvas will draw, then you can set the DrawingQuality to Custom. This will tell the specific GeoCanvas to use the properties on its own object instead of one of the pre-defined profiles. If one of the profiles -- such as HighSpeed or HighQuality -- is set, then the specific GeoCanvas ignores its own properties for drawing quality.

ZoomLevelSet

This property gets and sets the ZoomLevelSet, which contains the specific zoom levels for the FeatureLayer.

public ZoomLevelSet ZoomLevelSet { get; set; }

Property Value

ZoomLevelSet

        This property gets the ZoomLevelSet, which contains the specific zoom levels for
        the FeatureLayer.

Remarks:

The ZoomLevelSet is a class that contains all of the ZoomLevels for the FeatureLayer. Each ZoomLevel contains the styles that are used to determine how to draw the InternalFeatures.

DrawingMarginInPixel

public float DrawingMarginInPixel { get; set; }

Property Value

Single

IsOpen

This property returns true if the Layer is open and false if it is not.

public bool IsOpen { get; }

Property Value

Boolean

Remarks:

This method is the concrete wrapper for the abstract method IsOpenCore. Various methods on the Layer require that it be in an open state. If one of those methods is called when the state is not open, then the method will throw an exception. To enter the open state, you must call the Layer Open method. The method will raise an exception if the current Layer is already open.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

DrawingTime

This property gets the last drawing time for the layer.

public TimeSpan DrawingTime { get; protected set; }

Property Value

TimeSpan

Remarks:

We track the drawing time for the layer and report it back in this method. This is useful for determining the speed of various layers.

Name

This property gets and sets the name for the layer.

public string Name { get; set; }

Property Value

String

Remarks:

The name is user defined. It is useful to set, as it may be used for higher level components such as legends, etc.

Attribution

public string Attribution { get; set; }

Property Value

String

IsVisible

This property gets and set the visible state of the layer.

public bool IsVisible { get; set; }

Property Value

Boolean

Remarks:

If this property is set to false, the layer will not draw. We ensure this in the Draw method. This is useful for legends and other controls that control the visibility of layers.

Transparency

This property gets and sets the amount of transparency to apply to the image.

public float Transparency { get; set; }

Property Value

Single
This property gets the amount of transparency to apply to the image.

Remarks:

None

BlueTranslation

This property gets and sets the amount of blue to apply to the image.

public float BlueTranslation { get; set; }

Property Value

Single
This property gets the amount of blue to apply to the image.

Remarks:

None

RedTranslation

This property gets and sets the amount of red to apply to the image.

public float RedTranslation { get; set; }

Property Value

Single
This property gets the amount of red to apply to the image.

Remarks:

None

GreenTranslation

This property gets and sets the amount of green to apply to the image.

public float GreenTranslation { get; set; }

Property Value

Single
This property gets the amount of green to apply to the image.

Remarks:

None

KeyColors

Gets a value represents a collection of key colors. If SupportKeyColor property is false, it will throw exception when you use KeyColors.

public Collection<GeoColor> KeyColors { get; }

Property Value

Collection<GeoColor>

Remarks:

It will make these colors transparent when draw image.

IsNegative

This property gets and sets whether the image should be converted to negative (inverse colors).

public bool IsNegative { get; set; }

Property Value

Boolean
This property gets and sets whether the image should be converted to negative (inverse colors).

Remarks:

None

IsGrayscale

This property gets and sets if the image should be converted to grayscale.

public bool IsGrayscale { get; set; }

Property Value

Boolean

        This property gets and sets if the image should be converted to grayscale.

Remarks:

None

ColorMappings

ColorMapping

public Dictionary<GeoColor, GeoColor> ColorMappings { get; }

Property Value

Dictionary<GeoColor, GeoColor>

DrawingExceptionMode

Gets or sets the DrawExceptionMode when exception happens.

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode

ThreadSafe

public ThreadSafetyLevel ThreadSafe { get; set; }

Property Value

ThreadSafetyLevel

Background

Gets and sets the background of the layer.

public GeoColor Background { get; set; }

Property Value

GeoColor

WrappingMode

public WrappingMode WrappingMode { get; set; }

Property Value

WrappingMode

WrappingExtent

public RectangleShape WrappingExtent { get; set; }

Property Value

RectangleShape

RequestDrawingInterval

public TimeSpan RequestDrawingInterval { get; set; }

Property Value

TimeSpan

Constructors

ShapeFileFeatureLayer()

This is a constructor for the class.

public ShapeFileFeatureLayer()

Remarks:

This is the default constructor. If you use this constructor, then you should set the required methods manually.

ShapeFileFeatureLayer(String)

This is a constructor for the class.

public ShapeFileFeatureLayer(string shapePathFilename)

Parameters

shapePathFilename String
This parameter is the Shape File path and filename.

Remarks:

None

ShapeFileFeatureLayer(String, FileAccess)

This is a constructor for the class.

public ShapeFileFeatureLayer(string shapePathFilename, FileAccess readWriteMode)

Parameters

shapePathFilename String
This parameter is the Shape File path and filename.

readWriteMode FileAccess
This parameter specifies whether the file will be opened in read-only or read/write mode.

Remarks:

None

ShapeFileFeatureLayer(String, String)

This is a constructor for the class.

public ShapeFileFeatureLayer(string shapePathFilename, string indexPathFilename)

Parameters

shapePathFilename String
This parameter is the Shape File path and filename.

indexPathFilename String
This parameter is the index file path and filename.

Remarks:

None

ShapeFileFeatureLayer(String, String, FileAccess)

This is a constructor for the class.

public ShapeFileFeatureLayer(string shapePathFilename, string indexPathFilename, FileAccess readWriteMode)

Parameters

shapePathFilename String
This parameter is the Shape File path and filename.

indexPathFilename String
This parameter is the index file path and filename.

readWriteMode FileAccess
This parameter specifies whether the file will be opened in read-only or read/write mode.

Remarks:

None

ShapeFileFeatureLayer(String, String, FileAccess, Encoding)

This is a constructor for the class.

public ShapeFileFeatureLayer(string shapePathFilename, string indexPathFilename, FileAccess readWriteMode, Encoding encoding)

Parameters

shapePathFilename String
This parameter is the Shape File path and filename.

indexPathFilename String
This parameter is the index file path and filename.

readWriteMode FileAccess
This parameter specifies whether the file will be opened in read-only or read/write mode.

encoding Encoding
This parameter specifies the encoding of the data.

Remarks:

None

Methods

CloneDeepCore()

protected Layer CloneDeepCore()

Returns

Layer

Rebuild(String)

This method rebuilds the SHP, SHX, DBF, IDX and IDS files for the given shape file.

public static void Rebuild(string shapePathFilename)

Parameters

shapePathFilename String
This parameter is the shape file you want to rebuild.

Remarks:

This method rebuilds the SHP, SHX, DBF, IDX and IDS files for the given shape file. When we do editing we have optimized the updates so that we do not need to rebuild the entire shape file. This leads to the shape file being out of order which may cause it not to open in other tools. One optimization is if you update a record instead of rebuilding a new shape file we mark the old record as null and add the edited record at the end of the shape file. This greatly increases the speed of committing shape file changes but will over time unorder the shape file. In addition we do a delete the DBF file will simply mark the record deleted and not compact the space. Rebuilding the shape file will correctly order the SPX and SHX along with compacting the DBF file and rebuild any index with the same any of the shape file if it exists.

Note that if you have build custom index files where the name of the index differs from that of the shape file you will need to rebuild those manually using the BuildIndex methods.

Rebuild(String, ShapeFileSortingMode, Int32)

public static void Rebuild(string shapePathFilename, ShapeFileSortingMode sortingMode, int sridForSorting)

Parameters

shapePathFilename String

sortingMode ShapeFileSortingMode

sridForSorting Int32

CreateShapeFile(ShapeFileType, String, IEnumerable<DbfColumn>)

Static API to create a new Shape File.

public static void CreateShapeFile(ShapeFileType shapeType, string pathFilename, IEnumerable<DbfColumn> databaseColumns)

Parameters

shapeType ShapeFileType
This parameter specifies the the Shape File type for the target Shape File.

pathFilename String
This parameter specifies the Shape filename for the target Shape File.

databaseColumns IEnumerable<DbfColumn>
This parameter specifies the DBF column information for the target Shape File.

CreateShapeFile(ShapeFileType, String, IEnumerable<DbfColumn>, Encoding)

Static API to create a new Shape File.

public static void CreateShapeFile(ShapeFileType shapeType, string pathFilename, IEnumerable<DbfColumn> databaseColumns, Encoding encoding)

Parameters

shapeType ShapeFileType
This parameter specifies the the Shape File type for the target Shape File.

pathFilename String
This parameter specifies the Shape filename for the target Shape File.

databaseColumns IEnumerable<DbfColumn>
This parameter specifies the DBF column information for the target Shape File.

encoding Encoding
This parameter specifies the DBF encoding infromation for the target Shape File.

CreateShapeFile(ShapeFileType, String, IEnumerable<DbfColumn>, Encoding, OverwriteMode)

Static API to create a new Shape File.

public static void CreateShapeFile(ShapeFileType shapeType, string pathFilename, IEnumerable<DbfColumn> databaseColumns, Encoding encoding, OverwriteMode overwriteMode)

Parameters

shapeType ShapeFileType
This parameter specifies the the Shape File type for the target Shape File.

pathFilename String
This parameter specifies the Shape filename for the target Shape File.

databaseColumns IEnumerable<DbfColumn>
This parameter specifies the DBF column information for the target Shape File.

encoding Encoding
This parameter specifies the DBF encoding infromation for the target Shape File.

overwriteMode OverwriteMode
This parameter specifies the override mode when the target Shape File exists.

Remarks:

An exception will be thown when the target Shape File does not exist while the overwrite mode is set to DoNotOverwrite.

BuildIndexFile(String)

This method builds a spatial index for the layer.

public static void BuildIndexFile(string pathFilename)

Parameters

pathFilename String
The path and filename to the Shape File.

Remarks:

This overload allows you to pass in the Shape File.

BuildIndexFile(String, String, BuildIndexMode)

This method build a spatial index for the shape file which increases accessspeed.

public static void BuildIndexFile(string shapePathFilename, string indexPathFilename, BuildIndexMode buildIndexMode)

Parameters

shapePathFilename String

        This parameter is the shape file name and path that you want to build an index
        for.

indexPathFilename String

        This parameter specifies the index file name.

buildIndexMode BuildIndexMode

        This parameter determines what will happen if there is an existing index
        file.

Remarks:

This overload builds an index file with the same name as the shape file with only the extension being different. You can also specify if you want to rebuild an existing index file.

BuildIndexFile(String, BuildIndexMode)

This method builds a spatial index for the layer.

public static void BuildIndexFile(string pathFilename, BuildIndexMode rebuildExistingIndexMode)

Parameters

pathFilename String
This parameter is the matching pattern that defines which Shape Files to include.

rebuildExistingIndexMode BuildIndexMode
This parameter determines whether an index file will be rebuilt if it already exists.

Remarks:

This overload allows you to pass in the Shape File and determines if we rebuild an index file that already exists.

BuildIndexFile(IEnumerable<Feature>, String)

This method builds a spatial index for the specified group of features.

public static void BuildIndexFile(IEnumerable<Feature> features, string indexPathFilename)

Parameters

features IEnumerable<Feature>
This parameter specifies the features for which to build the index.

indexPathFilename String
This parameter specifies the target index path and filename.

Remarks:

This overload allows you to pass in a group of features and specify the index filename to use.

BuildIndexFile(IEnumerable<Feature>, String, ProjectionConverter)

This method builds a spatial index for the specified group of features and target projection.

public static void BuildIndexFile(IEnumerable<Feature> features, string indexPathFilename, ProjectionConverter projectionConverter)

Parameters

features IEnumerable<Feature>
This parameter specifies the features for which to build the index.

indexPathFilename String
This parameter specifies the target index path and filename.

projectionConverter ProjectionConverter
This parameter specifies the projection to build index against those features.

Remarks:

This overload allows you to pass in a group of features and specify a target projection and the index filename to use.

BuildIndexFile(IEnumerable<Feature>, String, BuildIndexMode)

This method builds a spatial index for the specified group of features.

public static void BuildIndexFile(IEnumerable<Feature> features, string indexPathFilename, BuildIndexMode buildIndexMode)

Parameters

features IEnumerable<Feature>
This parameter specifies the features for which to build the index.

indexPathFilename String
This parameter determines the target index path filename.

buildIndexMode BuildIndexMode
This parameter determines whether an index file will be rebuilt if it already exists.

Remarks:

This overload allows you to pass in a group of features and specify the index filename to use.

BuildIndexFile(IEnumerable<Feature>, String, ProjectionConverter, BuildIndexMode)

This method builds a spatial index for the specified group of features.

public static void BuildIndexFile(IEnumerable<Feature> features, string indexPathFilename, ProjectionConverter projectionConverter, BuildIndexMode buildIndexMode)

Parameters

features IEnumerable<Feature>
This parameter specifies the features for which to build the index.

indexPathFilename String
This parameter determines the target index path filename.

projectionConverter ProjectionConverter
This parameter determines the Projection to build index against those features.

buildIndexMode BuildIndexMode
This parameter determines whether an index file will be rebuilt if it already exists.

Remarks:

This overload allows you to pass in a group of features and specify a target projection and the index filename to use.

BuildIndexFile(String, String, String, String, BuildIndexMode)

This method builds a spatial index only for those features that satisfy a regular expression.

public static void BuildIndexFile(string shapePathFilename, string indexPathFilename, string columnName, string regularExpression, BuildIndexMode buildIndexMode)

Parameters

shapePathFilename String
This parameter specifies the Shape File for which to build the index.

indexPathFilename String
This parameter determines the target index path filename.

columnName String
This parameter determines the column name whose values will be tested against the regular expression.

regularExpression String
This parameter represents the regular expression to test against each feature for inclusion in the index.

buildIndexMode BuildIndexMode
This parameter determines whether an index file will be rebuilt if it already exists.

Remarks:

This overload allows you to pass in a Shape File and specify the index filename to use.

BuildIndexFile(String, String, ProjectionConverter, String, String, BuildIndexMode)

This method builds a spatial index only for those features that satisfy a regular expression, based on a passed-in projection.

public static void BuildIndexFile(string shapePathFilename, string indexPathFilename, ProjectionConverter projectionConverter, string columnName, string regularExpression, BuildIndexMode buildIndexMode)

Parameters

shapePathFilename String
This parameter specifies the Shape File for which to build the index.

indexPathFilename String
This parameter determines the target index path filename.

projectionConverter ProjectionConverter
This parameter determines the projection that will be used to build the index against those features that satisfy the regular expression.

columnName String
This parameter determines the column name whose values will be tested against the regular expression.

regularExpression String
This parameter represents the regular expression to test against each feature for inclusion in the index.

buildIndexMode BuildIndexMode
This parameter determines whether an index file will be rebuilt if it already exists.

Remarks:

This overload allows you to pass in a Shape File and specify the index filename to use.

BuildIndexFile(String, String, ProjectionConverter, String, String, BuildIndexMode, Encoding)

This method builds a spatial index only for those features that satisfy a regular expression, based on a passed-in projection.

public static void BuildIndexFile(string shapePathFilename, string indexPathFilename, ProjectionConverter projectionConverter, string columnName, string regularExpression, BuildIndexMode buildIndexMode, Encoding encoding)

Parameters

shapePathFilename String
This parameter specifies the Shape File for which to build the index.

indexPathFilename String
This parameter determines the target index path filename.

projectionConverter ProjectionConverter
This parameter determines the projection that will be used to build the index against those features that satisfy the regular expression.

columnName String
This parameter determines the column name whose values will be tested against the regular expression.

regularExpression String
This parameter represents the regular expression to test against each feature for inclusion in the index.

buildIndexMode BuildIndexMode
This parameter determines whether an index file will be rebuilt if it already exists.

encoding Encoding
This parameter specifies the encoding information used in the source DBF file.

Remarks:

This overload allows you to pass in a Shape File and specify the index filename to use.

CloneShapeFileStructure(String, String)

Clone the structure from the source ShapeFile to the target ShapeFile. After cloning the structure, the target ShapeFile will have the same type and the same DBF columns as the source ShapeFile, but without any records in it.

public static void CloneShapeFileStructure(string sourceShapePathFilename, string targetShapePathFilename)

Parameters

sourceShapePathFilename String
The source Shape File to be cloned.

targetShapePathFilename String
The target Shape File, which will have the same structure as the source Shape File after cloning operation is complete.

CloneShapeFileStructure(String, String, OverwriteMode)

Clone the structure from the source ShapeFile to the target ShapeFile. After cloning the structure, the target ShapeFile will have the same type and the same DBF columns as the source ShapeFile, but without any records in it.

public static void CloneShapeFileStructure(string sourceShapePathFilename, string targetShapePathFilename, OverwriteMode overwriteMode)

Parameters

sourceShapePathFilename String
The source Shape File to be cloned.

targetShapePathFilename String
The target Shape File, which will have the same structure as the source Shape File after cloning operation is complete.

overwriteMode OverwriteMode
This parameter specifies the overwrite mode when the target ShapeFile already exists.

Remarks:

An exception will be thown when the target ShapeFile does not exist and the overwrite mode is set to DoNotOverwrite.

CloneShapeFileStructure(String, String, OverwriteMode, Encoding)

Clone the structure from the source ShapeFile to the target ShapeFile. After cloning the structure, the target ShapeFile will have the same type and the same DBF columns as the source ShapeFile, but without any records in it.

public static void CloneShapeFileStructure(string sourceShapePathFilename, string targetShapePathFilename, OverwriteMode overwriteMode, Encoding encoding)

Parameters

sourceShapePathFilename String
The source Shape File to be cloned.

targetShapePathFilename String
The target Shape File, which will have the same structure as the source Shape File after cloning operation is complete.

overwriteMode OverwriteMode
This parameter specifies the overwrite mode when the target ShapeFile already exists.

encoding Encoding
This parameter specifies the encoding information in the source Shape File.

Remarks:

An exception will be thown when the target ShapeFile does not exist and the overwrite mode is set to DoNotOverwrite.

BuildRecordIdColumn(String, String, BuildRecordIdMode)

Static API used to build RecordId. The Id will start from 0.

public static void BuildRecordIdColumn(string shapeFilename, string fieldname, BuildRecordIdMode rebuildNeeded)

Parameters

shapeFilename String
The name of the target ShapeFile on which to base the newly built RecordId.

fieldname String
The field name for the RecordId.

rebuildNeeded BuildRecordIdMode
The RecordId build mode.

BuildRecordIdColumn(String, String, BuildRecordIdMode, Int32)

Static API used to build RecordId from the specified starting Id number.

public static void BuildRecordIdColumn(string shapeFilename, string fieldname, BuildRecordIdMode rebuildNeeded, int startNumber)

Parameters

shapeFilename String
The name of the target ShapeFile on which to base the newly built RecordId.

fieldname String
The field name for the RecordId.

rebuildNeeded BuildRecordIdMode
The RecordId build mode.

startNumber Int32
The starting Id number of the RecordId.

BuildRecordIdColumn(String, String, BuildRecordIdMode, Int32, Encoding)

Static API used to build RecordId from the specified starting Id number.

public static void BuildRecordIdColumn(string shapeFilename, string fieldname, BuildRecordIdMode rebuildNeeded, int startNumber, Encoding encoding)

Parameters

shapeFilename String
The name of the target ShapeFile on which to base the newly built RecordId.

fieldname String
The field name for the RecordId.

rebuildNeeded BuildRecordIdMode
The RecordId build mode.

startNumber Int32
The starting Id number of the RecordId.

encoding Encoding
This parameter specifies the encoding information in the DBF.

GetShapeFileType()

Get the Shape File type for the Shape File FeatureSource.

public ShapeFileType GetShapeFileType()

Returns

ShapeFileType
The ShapeFileType for the ShapeFile FeatureSource.

Reproject(String, String, ProjectionConverter, OverwriteMode)

This API provide a easy way to project features in a shape file into another projection and save it to shape file.

public static void Reproject(string sourceShapeFile, string targetShapeFile, ProjectionConverter projectionConverter, OverwriteMode overwriteMode)

Parameters

sourceShapeFile String
This parameter specifies the source shape file to be projected.

targetShapeFile String
This parameter specifies the target shape file to be saved for the projected features.

projectionConverter ProjectionConverter
This parameter is the projection to project the source shape file to target shape file. The source Shape file should be in the FromProjection of the Projection prameter, and the targetShapeFile will be in the ToProjection of the Projection.

overwriteMode OverwriteMode
This parameter specifies the override mode when the target shape file exists.

Validate()

This method checks all features in a shapefile is supported by Mapsuite or not.

public Dictionary<string, string> Validate()

Returns

Dictionary<String, String>
A dictionary which contains all the unsupported features. The key is the Indexs which failed to pass the check, the value contains the reason for its failure.

GetValidColumns(IEnumerable<DbfColumn>)

public static Collection<DbfColumn> GetValidColumns(IEnumerable<DbfColumn> columns)

Parameters

columns IEnumerable<DbfColumn>

Returns

Collection<DbfColumn>

GetValidColumns(IEnumerable<DbfColumn>, Encoding)

public static Collection<DbfColumn> GetValidColumns(IEnumerable<DbfColumn> columns, Encoding encoding)

Parameters

columns IEnumerable<DbfColumn>

encoding Encoding

Returns

Collection<DbfColumn>

GetValidColumnNames(IEnumerable<String>)

public static Collection<string> GetValidColumnNames(IEnumerable<string> columnNames)

Parameters

columnNames IEnumerable<String>

Returns

Collection<String>

GetValidColumnNames(IEnumerable<String>, Encoding)

public static Collection<string> GetValidColumnNames(IEnumerable<string> columnNames, Encoding encoding)

Parameters

columnNames IEnumerable<String>

encoding Encoding

Returns

Collection<String>

DrawCore(GeoCanvas, Collection<SimpleCandidate>)

protected void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)

Parameters

canvas GeoCanvas

labelsInAllLayers Collection<SimpleCandidate>

Events

StreamLoading

This event allows you to pass in your own stream to represent the files.

public event EventHandler<StreamLoadingEventArgs> StreamLoading;

Remarks:

If you choose you can pass in your own stream to represent the file. The stream can come from a variety of places such as isolated storage, a compressed file, and encrypted stream. When the Image is finished with the stream it will dispose of it so be sure to keep this in mind when passing the stream in. If you do not pass in a alternate stream the class will attempt to load the file from the file system using the PathFilename property.

DrawingFeatures

This event is raised when features are about to be drawn in the layer.

public event EventHandler<DrawingFeaturesEventArgs> DrawingFeatures;

Remarks:

This event is raised when features are about to be drawn in the layer. In the event arguments, there is a collection of features to be drawn. You can easily add or remove items from this collection so that extra items will draw or not draw.

DrawingWrappingFeatures

public event EventHandler<DrawingWrappingFeaturesFeatureLayerEventArgs> DrawingWrappingFeatures;

DrawingProgressChanged

public event EventHandler<DrawingProgressChangedEventArgs> DrawingProgressChanged;

DrawingException

public event EventHandler<DrawingExceptionLayerEventArgs> DrawingException;

DrawnException

public event EventHandler<DrawnExceptionLayerEventArgs> DrawnException;

DrawingAttribution

public event EventHandler<DrawingAttributionLayerEventArgs> DrawingAttribution;

DrawnAttribution

public event EventHandler<DrawnAttributionLayerEventArgs> DrawnAttribution;

RequestedDrawing

public event EventHandler<RequestedDrawingLayerEventArgs> RequestedDrawing;

RequestingDrawing

public event EventHandler<RequestingDrawingLayerEventArgs> RequestingDrawing;