This project has moved and is read-only. For the latest updates, please go here.

How to work with XML

Topics: Data Access
Jan 24, 2013 at 10:34 AM
Edited Jan 24, 2013 at 10:35 AM

Hello everyone.

I'm new to sharpmap and I'd like to know if it is possible to work with xml. I've been seeing examples but they are all about oledb.

 I want to draw an image to the map thru xml at a certain coordinate.


The XML file's content is 


<?xml version="1.0" encoding="utf-8" ?>



 And the code in the event is..
DataTable DataTableW = new DataTable();
                DataTableW.TableName = "Points";
              //  DataTableW.ReadXml(
                SharpMap.Data.FeatureDataTable fdt = new SharpMap.Data.FeatureDataTable();

                SharpMap.Layers.VectorLayer layAddresses = new SharpMap.Layers.VectorLayer("Points");
                layAddresses.DataSource = new SharpMap.Data.Providers.GeometryProvider(fdt);
              //  layAddresses.DataSource = new SharpMap.Data.Providers.GeometryFeatureProvider(fdt)
                SharpMap.Styles.VectorStyle defaultStyle = new SharpMap.Styles.VectorStyle();
                defaultStyle.Symbol = new System.Drawing.Bitmap(@"C:\\Users\\user\\Desktop\\image.png");
                layAddresses.Style = defaultStyle;
                defaultStyle.SymbolScale = 0.5f;

I hope someone could enlighten me on this one. Thanks!

Jan 25, 2013 at 8:21 AM

Hth FObermaier

Oct 30, 2013 at 3:25 AM
I am trying convert sharpmap to mxd arcmap file. Arcgis can read XML(GML?) file to IFeatureClass, with ESRI XML Schema.
Can I have use XML export from Sharpmap to load in mxd file?