[fdo-users] Problems with FDO: HasElevation is always false

hanko hana.jaborova at spatialtechnology.se
Mon May 31 08:53:18 EDT 2010


I'm using OSGeo.KingOracle.3.4 provider.  I'm reading a  FeatureSchema from
Oracle db and      for every FeatureClass I want to create a shape file.

Problem is that  HasElevation property of  GeometricPropertyDefinition seems
always false.

private bool CheckElevation(IConnection conn, PropertyDefinition property,
string featureClassName)
{
	GeometricPropertyDefinition dp = (GeometricPropertyDefinition)property;
	using (ISelect select =
conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Select) as
ISelect)
	{
		select.SetFeatureClassName(featureClassName);
		string wktGeo = "";
		using (IFeatureReader reader = select.Execute())
		{
			if (reader.ReadNext())
			{
				byte[] geom = reader.GetGeometry(property.Name);
				using (FgfGeometryFactory gFac = new FgfGeometryFactory())
				{
					using (IGeometry geo = gFac.CreateGeometryFromFgf(geom))
					{                                
						wktGeo = geo.Text;
					}
				}
			}
			reader.Close();
		}
		// Check elevation
		int xyz = wktGeo.IndexOf("XYZ", StringComparison.OrdinalIgnoreCase);
		int xymz = wktGeo.IndexOf("XYMZ", StringComparison.OrdinalIgnoreCase);
		return (dp.HasElevation || xyz >= 0 || xymz >= 0);
	}
}
1.
Value of   wktGeo in the debugger is:
"LINESTRING (155278.193274153 6414488.75171899, 155276.3381056
6414487.64186301, ...
HasElevation = false

2.
Value of   wktGeo in the debugger is:
"LINESTRING XYZ (161703.634666022 6410352.31957678 56.868, 161705.440817796
6410353.98074014 56.868, ...
also HasElevation = false
Second case causes exception when executing an IApplySchema command for
creating shape files.

Thanks for your time. 

Best regards, 
Hanko
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Problems-with-FDO-HasElevation-is-always-false-tp5121682p5121682.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list