[mapguide-users] FeatureReader

Bruce Dechant bruce.dechant at autodesk.com
Wed Dec 12 15:57:24 EST 2007

The reason you might be only getting a smaller subset of the data could be the type of join you setup.
If the primary only has 100 records and the secondary has 300 records and you are doing a 1 to 1 join - you will only end up with 100 records in your result set.

Try creating a Left Outer join with a one-to-many relationship to see if all your data is returned.


From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of ary sucaya
Sent: Tuesday, December 11, 2007 10:19 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] FeatureReader

Thank for replying,

There is no exception. Here is my code:

MgInitializeWebTier ($configFilePath);
$userInfo = new MgUserInformation($sessionId);
$siteConnection = new MgSiteConnection();

$resourceService = $siteConnection->CreateService(MgServiceType::ResourceService);
$map = new MgMap($siteConnection);

$featureService = $siteConnection->CreateService(MgServiceType::FeatureService);

$queryOptions = new MgFeatureQueryOptions();
$queryOptions->SetFilter("FeatId > 0");
$layer = $map->GetLayers()->GetItem("District");
$featureResId = new MgResourceIdentifier($layer->GetFeatureSourceId());

$featureReader = $featureService->SelectFeatures($featureResId, $layer->GetFeatureClassName(), $queryOptions);

while ($featureReader->ReadNext())
    echo $featureReader->GetInt32('DistrictID') . "<br />";

catch (MgException $e)
  echo $e->GetMessage();
  echo $e->GetDetails();

I have more than 300 record in layer District, but I can only see 100 record out of 300. I don't know what wrong..


Ary Sucaya
----- Original Message ----
From: Bruce Dechant <bruce.dechant at autodesk.com>
To: MapGuide Users Mail List <mapguide-users at lists.osgeo.org>
Sent: Tuesday, December 11, 2007 8:30:29 PM
Subject: RE: [mapguide-users] FeatureReader
There is no limit. Is an exception being thrown? If so that would give you a clue as to why it is not working as expected.


From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of ary sucaya
Sent: Monday, December 10, 2007 9:20 AM
To: Mapguide User
Subject: [mapguide-users] FeatureReader

Hii group,

I have a problem with feature reader. I have a sdf layer joined with external table and i can't make a looping for all of this records. It's always jump out the loop after 100 records. I tried the same code with different sdf layer without join to external layer, it's work well.
Is there any limitation of joined layer in MapGuide 1.2?  Anyone can help me?


Ary Sucaya

Looking for last minute shopping deals? Find them fast with Yahoo! Search.<http://us.rd.yahoo.com/evt=51734/*http:/tools.search.yahoo.com/newsearch/category.php?category=shopping>

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.<http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20071212/540879eb/attachment.html

More information about the mapguide-users mailing list