[mapguide-users] Newbie problem with SetFilter

peter56 ibb.scigalla at arcor.de
Thu Sep 14 03:40:41 EDT 2006


Hallo Kenneth,

thanks for reply. In addition to your indication I found a mistake in the
absolute value for the $featureResId
("Library://downtown/Data/wltg_lin.FeatureSource"). After Changing to 


$featureResId = new MgResourceIdentifier($layer->GetFeatureSourceId());

the code was running.

Thank you, have a nice day - Peter





Kenneth, GEOGRAF A/S wrote:
> 
> A quick guess, you must supply the Feature Class, not the layer name:
> 
> $featureClass = map.GetLayers().GetItem('wltg_lin').GetFeatureClassName();
> 
> With that, you may know replace your select with:
> 
> $featureReader = $featureService->SelectFeatures($featureResId,
> $featureClass, $Optionen);
> 
> 
> Hope that helps.
> 
> Mvh. Kenneth, GEOGRAF A/S
> 
> 
> 
> 
> peter56 skrev:
>> Hallo,
>>
>> here a typical newbie problem with the application of the sample code.
>>
>> Like in the php-sample "Server-side Selection" (pages 47-49) I have tried
>> to
>> select my own data. But the code don't work:
>>
>> ...
>>      MgInitializeWebTier("$extensionsDir\webconfig.ini");
>>      $webLayout =
>> "Library://downtown/Layouts/downtwon_layout1.WebLayout";
>>      $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, $mapName);
>>      $Optionen = new MgFeatureQueryOptions();
>>      $Optionen->SetFilter("MAT LIKE 'PVC%'");
>>      $featureResId = new
>> MgResourceIdentifier("Library://downtown/Data/wltg_lin.FeatureSource");
>>      $featureReader = $featureService->SelectFeatures($featureResId,
>> 'wltg_lin', $Optionen);
>> ...
>>
>> "wltg_lin" is the name of the layer and the name of the data-source.
>> "MAT"
>> is an datafield and "PVC" a datavalue. 
>>
>> All data was generated by shp-files (exported from Autodesk MAP).
>>
>> I'm working with XP, MG OS 1.0.1, Apache and php.
>>
>> Please help to find my mistake.
>>
>> Thanks in advance - Peter
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Newbie-problem-with-SetFilter-tf2259520.html#a6300911
Sent from the OSGeo MapGuide forum at Nabble.com.





More information about the Mapguide-users mailing list