[mapguide-users] [MapguideOS] Create layer filter
Jérémie Formica
jeremie.formica at gmail.com
Fri May 23 03:39:30 EDT 2008
Hello,
I would like to select data from one layer by applying a filter.I have tried
the following code:
$mgSessionId = ($_SERVER['REQUEST_METHOD'] == "POST")? $_POST['SESSION']:
$_GET['SESSION'];
MgInitializeWebTier ($configFilePath);
$userInfo = new MgUserInformation($mgSessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
$resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);
$featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
$map = new MgMap();
$map->Open($resourceService, 'Sheboygan');
$layer = GetLayerByName($map, 'Parcels');
$queryOptions = new MgFeatureQueryOptions();
$queryOptions->SetFilter("RTYPE = 'RES'");
$featureReader = $layer->SelectFeatures($queryOptions);
When I execute this code, the map post all Parcels but not the parcels with
"RTYPE = 'RES'").I want to get the same result that I get when applying a
filter in mapstudio.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080523/dfb2ef88/attachment.html
More information about the mapguide-users
mailing list