[mapguide-users] Problem with SelectFeature with CurvePolygon

Luiz Marcio Viana lmarcio at pars.com.br
Fri Dec 28 12:39:14 EST 2007


Hi,

I'm trying to make a spatial filter using a curve polygon formed by two
semi-arcs (circular region).

But when I execute the SelectFeature method I get the following exception

- MgFeatureServiceHandler.ProcessOperation line 83 file 
c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\feature\FeatureServiceHandler.cpp
- MgOpSelectFeatures.Execute line 112 file 
c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\feature\OpSelectFeatures.cpp
- MgServerSelectFeatures.SelectFeatures line 243 file 
c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\feature\ServerSelectFeatures.cpp

and I don't know if the problem is with the polygon, spatial operation or 
comand execution.

The query is executing over an Oracle feature source using the Autodesk 
Oracle Provider (3.2.2).
I'm send the piece of code wich is generating the exception, the exception 
are occouring at SelectFeature function.

If anyone has any idea about what's wrong here I'm accepting sugestions.

MgGeometryFactory geomFactory = new MgGeometryFactory();
MgCurveSegmentCollection segments = new MgCurveSegmentCollection();

MgCoordinate start =
  geomFactory.CreateCoordinateXY(xcenter - radius, ycenter);
MgCoordinate control =
  geomFactory.CreateCoordinateXY(xcenter, ycenter + radius);
MgCoordinate end =
  geomFactory.CreateCoordinateXY(xcenter + radius, ycenter);
segments.Add(geomFactory.CreateArcSegment(start, end, control));

start = geomFactory.CreateCoordinateXY(xcenter + radius, ycenter);
control = geomFactory.CreateCoordinateXY(xcenter, ycenter - radius);
end = geomFactory.CreateCoordinateXY(xcenter - radius, ycenter);
segments.Add(geomFactory.CreateArcSegment(start, end, control));

MgCurveRing exteriorCurveRing = geomFactory.CreateCurveRing(segments);
MgCurveRingCollection curveRingCollection = new MgCurveRingCollection();
MgGeometry geom =
  geomFactory.CreateCurvePolygon(exteriorCurveRing, curveRingCollection);

MgFeatureQueryOptions query = new MgFeatureQueryOptions();
query.SetSpatialFilter("Geometry", geom, MgFeatureSpatialOperations.Within);

MgResourceIdentifier resId = new
MgResourceIdentifier("Library://Samples/ORACLEDB.FeatureSource");
MgFeatureReader featureReader =
    featureService.SelectFeatures(resId, "My_Schema:My_ClassName", query);

Thanks,
Luiz Marcio




More information about the mapguide-users mailing list