public FileStreamResult ExportNatureAreasAsGmlBySearchFilter([FromBody] SearchFilterRequest searchFilterRequest) { int epsgCode; var natureAreas = FindNatureAreasBySearchFilter(searchFilterRequest, out epsgCode); var xDocument = gmlWriter.ConvertToGml(natureAreas); return(ToZippedFileStreamResult(xDocument)); }
public void ConvertToGmlTest() { var natureArea = new NatureArea { UniqueId = new Identification { LocalId = Guid.NewGuid(), NameSpace = "NiN", VersionId = "2.0" } }; var natureAreas = new Collection <NatureArea> { natureArea }; gmlWriter.ConvertToGml(natureAreas); }
public string ExportNatureAreasAsGmlBySearchFilter([FromBody] SearchFilterRequest searchFilterRequest) { int epsgCode; var natureAreas = FindNatureAreasBySearchFilter(searchFilterRequest, out epsgCode); var xDocument = gmlWriter.ConvertToGml(natureAreas); var builder = new StringBuilder(); using (TextWriter writer = new StringWriter(builder)) { xDocument.Save(writer); } return(builder.ToString()); //Stream xmlStream = new MemoryStream(); //xDocument.Save(xmlStream); //xmlStream.Position = 0; //return new DownloadFileResult("natur.xml", xmlStream, "application/xml"); }