SqlGeometryItem.FromWkt(String, Int32) Method
In This Article
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 |
---|---|---|
wkt |
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 |
---|---|
Sql |
A Sql |
#Example
To manually provide vector items from the Well-Known Text, do the following.
- Create a SqlGeometryItemStorage object and assign it to the VectorItemsLayer.Data property.
- Add SqlGeometryItem objects created using the
SqlGeometryItem.FromWkt
method to the SqlGeometryItemStorage.Items collection.
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