Problem GeometryFactory + ApplySchema

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem GeometryFactory + ApplySchema

Bohne
Hi,

I'm having a strange problem with creating a geometry from text. Following Method turns expected results..

 public static string Test()
        {
           
            FgfGeometryFactory geomFactory = new FgfGeometryFactory();
            IGeometry geomTest = geomFactory.CreateGeometry("POINT XYZ(1.94 2.432 3.43)");
            return geomTest.Text;
        }

After Executing an ApplySchema Command the same function creates Geometries, but now the decimal Places of the Coordinates are missing?

 applySchema.FeatureSchema = schema;
             
                try
                {
                    FeatureClassHelper.Test();//Returns POINT XYZ (1.94 2.432 3.43)
                    applySchema.Execute();
                    FeatureClassHelper.Test();//Return POINT XYZ (1 2 3)
                }

I'm using FDO 3.5 libs, in VS2008, C#.

Any hints are welcome!


Reply | Threaded
Open this post in threaded view
|

Re: Problem GeometryFactory + ApplySchema

Bohne
This post was updated on .
Me again,

I know, that it's very difficult to answer without knowing all code.
But is there any relation between applying a schema (creating a ShapeFile), and using the GeometryFactory?

I recognized, that everything is allright when I'm creating a sdf3 File instead of an ShapeFile..

Bohne
Reply | Threaded
Open this post in threaded view
|

Re: Problem GeometryFactory + ApplySchema

Jackie Ng
Just as a test, does it happen if you re-use the same FgfGeometryFactory for both methods?

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Problem GeometryFactory + ApplySchema

Bohne
Thanks for your reply, Jackie!

I modified the method like this:

private static FgfGeometryFactory geomFactory;
        public static string Test()
        {
           

            if(geomFactory==null)
                geomFactory = new FgfGeometryFactory();

            IGeometry geomTest = geomFactory.CreateGeometry("POINT XYZ(1.94 2.432 3.43)");
         
            return geomTest.Text;



        }


Still the same problem! Before calling "Schema.Execute" it returns the Text with Decimalplaces, after it doesn't..
Reply | Threaded
Open this post in threaded view
|

Re: Problem GeometryFactory + ApplySchema

Bohne
Hi,

now I realized that this is a problem with the regional settings /Culture.
When I changed my default settings from German to English everything works as expected.

But how can I handle it within my application?

Setting the CurrentCulture doesn't work in this case!