Selections on Joined tables

Kenneth, GEOGRAF A/S ks at geograf.dk
Tue Aug 15 03:06:20 EDT 2006


I have some SDF's that were imported from MapGuide 6.5, using the 
migration tool.
Some of these SDF files are linked to secondary tables in a database.

When I issue a select statement on that layer, I get the following error:
OSGeo.MapGuide.MgFdoException: An exception occurred in FDO component. 
no string resource for id <1019> - 
MgFeatureServiceHandler.ProcessOperation line 83 file 
c:\build_tux_area\mgdev\server\src\services\feature\FeatureServiceHandler.cpp 
- MgOpSelectFeatures.Execute line 115 file 
c:\build_tux_area\mgdev\server\src\services\feature\OpSelectFeatures.cpp 
- MgServerSelectFeatures.SelectFeatures line 217 file 
c:\build_tux_area\mgdev\server\src\services\feature\ServerSelectFeatures.cpp 
- MgServerSelectFeatures.JoinFeatures line 1008 file 
c:\build_tux_area\mgdev\server\src\services\feature\ServerSelectFeatures.cpp

The select statement is a spatial select.

Here is some code that illustrates what I'm trying to do:

        ...
        MgGeometryFactory fac = new MgGeometryFactory();
        MgCoordinateCollection col = new MgCoordinateCollection();

        //Make a square polygon around the point,
        const int r = 1;
        col.Add(fac.CreateCoordinateXY(x-r, y+r));
        col.Add(fac.CreateCoordinateXY(x-r, y-r));
        col.Add(fac.CreateCoordinateXY(x+r, y-r));
        col.Add(fac.CreateCoordinateXY(x+r, y+r));
        col.Add(fac.CreateCoordinateXY(x-r, y+r));
        MgPolygon poly = fac.CreatePolygon(fac.CreateLinearRing(col), 
new MgLinearRingCollection());

        ...

        qry.SetSpatialFilter(layer.GetFeatureGeometryName(), poly, 
MgFeatureSpatialOperations.Intersects);
        MgFeatureReader rd = ftr.SelectFeatures(new 
MgResourceIdentifier(layer.GetFeatureSourceId()), 
layer.GetFeatureClassName(), qry);

        ...

The mentioned error occurs in the last line of code above.
The layer.GetFeatureClassName() call, gives the value:

       SDF_2_Schema:Extension

Substituting this with the name of the unjoined feature source, removes 
the error, and gives the expected result.
It works fine on all feature sources that have no joins.

This error occurs in MapGuide Enterprise, and I have yet to try it in 
MapGuide OS.


Does anyone have a workaround, explanation or fix?


-- 
Mvh. Kenneth, GEOGRAF A/S





More information about the Mapguide-internals mailing list