Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SqlGeometryItem.FromWkt(String, Int32) Method

Creates the SqlGeometryItem object from the Well-Known Text.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public static SqlGeometryItem FromWkt(
    string wktString,
    int srid
)

#Parameters

Name Type Description
wktString String

A String object that is a vector geometry object written as a WKT string.

srid Int32

A Int32 object that is a Spatial Reference System Identifier (SRID).

#Returns

Type Description
SqlGeometryItem

A SqlGeometryItem object created from WKT.

#Example

To manually provide vector items from the Well-Known Text, do the following.

private void Form1_Load(object sender, EventArgs e) {
    SqlGeometryItemStorage storage = new SqlGeometryItemStorage();

    storage.Items.Add(SqlGeometryItem.FromWkt("POINT(-0.1275 51.507222 0 10)", 0));
    storage.Items.Add(SqlGeometryItem.FromWkt("POINT(12.5 41.9 0 10)", 1));
    storage.Items.Add(SqlGeometryItem.FromWkt("POINT(2.3508 48.8567 0 10)", 2));
    storage.Items.Add(SqlGeometryItem.FromWkt("POINT(13.38 52.52 0 10)", 3));
    storage.Items.Add(SqlGeometryItem.FromWkt("POINT(-3.68 40.4 0 10)", 4));

    VectorItemsLayer layer = new VectorItemsLayer() { Data = storage };
    layer.DataLoaded += layer_DataLoaded;
    mapControl1.Layers.Add(layer);
}
See Also