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

Haris Kurtagic haris at sl-king.com
Tue Jun 1 06:24:33 EDT 2010


Simon checked it and it is true that King.Oracle always set it to
false ( M as well).
I will fix it .

BTW, Apply schema in King.Oracle  would correctly set SDO metadata in
case of elevation or measure.

Haris

On Mon, May 31, 2010 at 2:53 PM, hanko
<hana.jaborova at spatialtechnology.se> wrote:
>
> 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.
> _______________________________________________
> 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