Your code is calling MgSelection::GenerateFilters() which has limitation in that it only generates a filter for the first 20 items. This limitation was introduced by http://trac.osgeo.org/mapguide/changeset/3053.
A follow up submission to address this added a temporary, undocumented API, GenerateFilters to resolve the limitation. See http://trac.osgeo.org/mapguide/ticket/501. To workaround the issue until a fix for GenerateFilter is available, you can use the undocumented GenerateFilters to create the filters, and then perform your selection based on each of the filters. Iterate through the features in each feature reader to get all your features. Please be aware this is offered only as a workaround until GenerateFilter is fixed. Have a look at http://svn.osgeo.org/mapguide/branches/2.0.x/MgDev/Web/src/mapviewerphp/buffer.php for a sample of how to use the GenerateFilters method to setup the query for selection. Ronnie -----Original Message----- From: nclayton [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 9:25 AM To: [email protected] Subject: [mapguide-users] Selection Issue (FeatureReader only grabbing 20 items) Hi all, This has just recently become a problem. I am passing the selection xml to a page to display parcel owner data. For an example, I select 256 parcels on the map. The selection xml comes over fine, with all 256 parcels listed. When I use a featureReader to get the parcel numbers from the features, It only get the first 20. Is this a setting I may have altered unintentionally, or could there be more to it? Here is the code that I am using to pull the information out from the selection xml: ======================================================================== function GetObjKeys($sessId,$mapName,$sel){ $obj_keys = ''; if($sel != ''){ InitializeWebTier(); $userInfo = new MgUserInformation($sessId); $siteConnection = new MgSiteConnection(); $siteConnection->Open($userInfo); $resourceService = $siteConnection->CreateService(MgServiceType::ResourceService); $featureService = $siteConnection->CreateService(MgServiceType::FeatureService); $map = new MgMap($siteConnection); $map->Open($resourceService,$mapName); $selection = new MgSelection($map,$sel); if($selection != ''){ $layers = $selection->GetLayers(); if(!$layers){ $layers = $map->GetLayers(); } }else{ $layers = 0; } $layer = null; if($layers){ for($i = 0; $i < $layers->GetCount(); $i++){ if($layers->GetItem($i)->GetName() == "parcels"){ $layer = $layers->GetItem($i); } } $queryOptions = new MgFeatureQueryOptions(); if($layer){ $layerClassName = $layer->GetFeatureClassName(); if($sel != ''){ $selString = $selection->GenerateFilter($layer,$layerClassName); } $layerFeatureId = $layer->GetFeatureSourceId(); $layerFeatureResource = new MgResourceIdentifier($layerFeatureId); $layerId = $layer->GetObjectId(); $queryOptions->SetFilter($selString); $featureReader = $featureService->SelectFeatures($layerFeatureResource,$layerClassName,$queryOptions); $selTmp = ''; for($pdx=0; $pdx<$featureReader->GetPropertyCount(); $pdx++){ $pnm = $featureReader->GetPropertyName($pdx); if($pnm == 'PARCEL_ID_'){ break; } if($pnm == 'PARCELID'){ break; } if($pnm == 'Key'){ break; } $pnm = ""; } if($pnm != ""){ while($featureReader->ReadNext()){ $stg = $featureReader->GetString($pnm); if($stg != ""){ $obj_keys .= "'" . $stg . "'"; } } } $obj_keys = str_replace("''","','",$obj_keys); } } return $obj_keys; }else{ return ''; } } -- View this message in context: http://www.nabble.com/Selection-Issue-%28FeatureReader-only-grabbing-20-items%29-tp18570994p18570994.html Sent from the MapGuide Users mailing list archive at Nabble.com. _______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users
