[fdo-users] Problems with FDO: Creating a spatial Filter

Simon Pelicon simon at sl-king.com
Tue Jun 1 03:19:51 EDT 2010


Hi!
I think that the problem described does not involve OSGeo.KingOracle and
that you would have the same problem with all other providers.
Check system decimal separator in your Regional Settings.  Maybe is that
causing the problem.

Simon

On Mon, May 31, 2010 at 2:51 PM, hanko
<hana.jaborova at spatialtechnology.se>wrote:

>
> I'm using OSGeo.KingOracle.3.4 provider.  Current Culture of my application
> is {sv-SE}
> I'm attempting to create a spatial filter. I'm hitting a problem with the
> code below:
> 1.
>  using (FgfGeometryFactory geomFactory = new FgfGeometryFactory())
> {
>        //create a geometry
>        IPolygon poly =
> (OSGeo.FDO.Geometry.IPolygon)geomFactory.CreateGeometry("POLYGON(( 1.23
> 4.56, 2.34 4.56,  2.34  5.78, 1.23 5.78,1.23 4.56))");
>
>        //create the byte array required to create the expression
>        byte[] byteArray = geomFactory.GetFgf(poly);
>        OSGeo.FDO.Expression.GeometryValue qryGeomVal = new
> OSGeo.FDO.Expression.GeometryValue(byteArray);
>
>        //create the filter
>        OSGeo.FDO.Filter.Filter fltr;
>        fltr = new OSGeo.FDO.Filter.SpatialCondition("Geom",
> OSGeo.FDO.Filter.SpatialOperations.SpatialOperations_Intersects,
> qryGeomVal);
>        string filterStr = fltr.ToString();
>        //set the filter on the query command
>        select.SetFilter(fltr.ToString());
> }
> Value of   filterStr in the debugger is:
> "Geom INTERSECTS GeomFromText('POLYGON ((1 4, 2 4, 2 5, 1 5, 1 4))')"
> (decimal part of number disappeared )
>
> 2.
> using (FgfGeometryFactory geomFactory = new FgfGeometryFactory())
> {
>        //create a geometry from a poly
>        IDirectPosition pos1 = geomFactory.CreatePositionXY(1.23, 4.56);
>        IDirectPosition pos2 = geomFactory.CreatePositionXY(2.34, 4.56);
>        IDirectPosition pos3 = geomFactory.CreatePositionXY(2.34, 5.78);
>        IDirectPosition pos4 = geomFactory.CreatePositionXY(1.23, 5.78);
>        IDirectPosition pos5 = geomFactory.CreatePositionXY(1.23, 4.56);
>        DirectPositionCollection coll = new DirectPositionCollection();
>        coll.Add(pos1);
>        coll.Add(pos2);
>        coll.Add(pos3);
>        coll.Add(pos4);
>        coll.Add(pos5);
>        ILinearRing ring = (ILinearRing)geomFactory.CreateLinearRing(coll);
>
>        IPolygon poly =
> (OSGeo.FDO.Geometry.IPolygon)geomFactory.CreatePolygon(ring, null);
>
>        //create the byte array required to create the expression
>        byte[] byteArray = geomFactory.GetFgf(poly);
>        OSGeo.FDO.Expression.GeometryValue qryGeomVal = new
> OSGeo.FDO.Expression.GeometryValue(byteArray);
>
>        //create the filter
>        OSGeo.FDO.Filter.Filter fltr;
>        fltr = new OSGeo.FDO.Filter.SpatialCondition("Geom",
> OSGeo.FDO.Filter.SpatialOperations.SpatialOperations_Intersects,
> qryGeomVal);
>        string filterStr = fltr.ToString();
>        //set the filter on the query command
>        select.SetFilter(fltr.ToString());
> }
> Value of   filterStr in the debugger is:
> "Geom INTERSECTS GeomFromText('POLYGON ((1,23 4,56, 2,34 4,56, 2,34 5,78,
> 1,23 5,78, 1,23 4,56))')"  (dot was replaced by comma)
>
> Any ideas?
>
> Cheers
>
> Hanko
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/Problems-with-FDO-Creating-a-spatial-Filter-tp5121675p5121675.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20100601/e38243d5/attachment.html


More information about the fdo-users mailing list