[mapguide-dev] Selections on Joined tables

Ronnie Louie ronnie.louie at autodesk.com
Tue Aug 15 11:25:17 EDT 2006


Kenneth,

I just tested your code snippet on a SDF feature souce with a join, and it works fine.  Send me your data and I'll take a look.

Ronnie

-----Original Message-----
From: Kenneth, GEOGRAF A/S [mailto:ks at geograf.dk]
Sent: Tuesday, August 15, 2006 1:06 AM
To: dev at mapguide.osgeo.org
Subject: [mapguide-dev] Selections on Joined tables


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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: dev-help at mapguide.osgeo.org





More information about the Mapguide-internals mailing list