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

Brent Robinson brent.robinson at autodesk.com
Thu Jan 13 11:48:02 EST 2011


Hi Crispin,

For the issue where the srsName changes from EPSG:4326 to Default in FDO 3.6, which provider are the features being read from? The srsName that is output is affected by the class definition passed to the XmlFeatureWriter. This class definition is retrieved from the FdoIFeatureReader passed to the xmlSerializer.

Brent. 

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Brent Robinson
Sent: Wednesday, January 12, 2011 10:17 AM
To: FDO Users Mail List
Subject: RE: [fdo-users] RE: Which GML version is supported by FDO 3.5.0

I can confirm that. When the xmlSerializer has xmlFlags, but the xmlFeatureWriter does not, then xmlSerializer.Serialize should temporarily pass the flags down to the xmlFeatureWriter. This would mean that that application would only need to set the flags on the topmost object rather than on both of them.


-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Crispin_at_1Spatial
Sent: Wednesday, January 12, 2011 9:26 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] RE: Which GML version is supported by FDO 3.5.0


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.
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users


More information about the fdo-users mailing list