[fdo-users] RE: Which GML version is supported by FDO 3.5.0

Crispin_at_1Spatial crispin.hoult at 1spatial.com
Wed Jan 12 09:25:33 EST 2011


Thank you Brent!

It is indeed about passing the xmlFlags to the XmlFeatureWriter and not to
the XmlFeatureSerialiser - even though the latter takes flags as an optional
parameter.
I can get the code to work now - if you confirm it would be your
understanding that the serialiser should also handle the flags then I'll
create a ticket.

WORKING EXAMPLE


WORK wrote:
> 
> // set flags first so that can be included in writer
> OSGeo_FDO.Xml.XmlFeatureFlags xmlFlags = new
> OSGeo.FDO.Xml.XmlFeatureFlags();
> xmlFlags.DefaultNamespace = "1Spatial";
> 
> // set options for GML format
> #if FDO36
> try
> {
> 	if (radioGML311.Checked)
> 		xmlFlags.GmlVersion = OSGeo.FDO.Xml.GmlVersion.GmlVersion_311;
> }
> catch
> {
> 	MessageBox.Show("Failed to Set GML Version to 3.1.1 - Reverting to GML
> 2.1.2");
> 	xmlFlags.GmlVersion = OSGeo.FDO.Xml.GmlVersion.GmlVersion_212;
> }
> #endif
> 
> // create writer with flags, then serialize
> String szTemp = System.IO.Path.GetTempFileName();
> OSGeo_FDO.Common.Xml.XmlWriter xmlWriter = new
> OSGeo.FDO.Common.Xml.XmlWriter(szTemp, true,
> OSGeo.FDO.Common.Xml.XmlWriter.LineFormat.LineFormat_Indent);
> OSGeo_FDO.Xml.XmlFeatureWriter xmlFtWriter = new
> OSGeo.FDO.Xml.XmlFeatureWriter(xmlWriter, xmlFlags);
> 
> OSGeo_FDO.Xml.XmlFeatureSerializer.XmlSerialize(readFeature, xmlFtWriter);
> 


FAILING (DOES NOT SET GML311) EXAMPLE


FAIL wrote:
> 
> String szTemp = System.IO.Path.GetTempFileName();
> OSGeo_FDO.Common.Xml.XmlWriter xmlWriter = new
> OSGeo.FDO.Common.Xml.XmlWriter(szTemp, true,
> OSGeo.FDO.Common.Xml.XmlWriter.LineFormat.LineFormat_Indent);
> OSGeo_FDO.Xml.XmlFeatureWriter xmlFtWriter = new
> OSGeo.FDO.Xml.XmlFeatureWriter(xmlWriter);
> 
> OSGeo_FDO.Xml.XmlFeatureFlags xmlFlags = new
> OSGeo.FDO.Xml.XmlFeatureFlags();
> xmlFlags.DefaultNamespace = "1Spatial";
> 
> // set options for GML format
> #if FDO36
> try
> {
> 	if (radioGML311.Checked)
> 		xmlFlags.GmlVersion = OSGeo.FDO.Xml.GmlVersion.GmlVersion_311;
> }
> catch
> {
> 	MessageBox.Show("Failed to Set GML Version to 3.1.1 - Reverting to GML
> 2.1.2");
> 	xmlFlags.GmlVersion = OSGeo.FDO.Xml.GmlVersion.GmlVersion_212;
> }
> #endif
> OSGeo_FDO.Xml.XmlFeatureSerializer.XmlSerialize(readFeature, xmlFtWriter,
> xmlFlags);
> 


-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Which-GML-version-is-supported-by-FDO-3-5-0-tp5906711p5914700.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list