I have a function where the user uploads a KML file, I use XSLT to convert it to GML and then save it to another file. My question is how can I import this GML data to the geometry column using GeomFromGML() in MVC?
Totally stumped and can't find any good examples. Below is my code for the upload and transformation:
var fileName = Path.GetFileName(Polygon.FileName);
var path = Path.Combine(Server.MapPath("~/App_Data/uploads"),fileName);
Polygon.SaveAs(path);
XPathDocument myXPathDoc = new XPathDocument(path);
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(Server.MapPath("~/App_Data/XSL/kml2gml2.xsl"));
var gml = Path.Combine(Server.MapPath("~/App_Data/GML/gml.xml"));
XmlTextWriter myWriter = new XmlTextWriter(gml, null);
myXslTrans.Transform(myXPathDoc, null, myWriter);