Sets the filter for this select operation. The filter acts like the where clause in an SQL Select statement. Not calling this method causes all instances of the feature class to be selected. For more details on defining filters, see the Filter and Expression documentation.
.NET Syntax
Java Syntax
PHP Syntax
Example (PHP)
<?php
$queryOption->SetFilter("featId > 20");
$featureService->SelectFeatures($featureSrcResourceId, $featClassName, $queryOptions);
?>
sqlplus> select * from featclass where featId > 20;
<?php
$featureService->SelectFeatures($featureSrcResourceId, $featClassName, $queryOptions);
?>
sqlplus> select * from featclass;
Example (C#)
using OSGeo.MapGuide; private MgFeatureQueryOptions queryOptions; private MgFeatureService featureService; private String className = "SdfFeatureClass"; // the SDF file identified by this MgResourceIdentifier exists in the repository private MgResourceIdentifier resourceId; private MgFeatureReader featureReader; resourceId = new MgResourceIdentifier("Library://PlatformApiDocTests/SdfFeatureClass.FeatureSource"); queryOptions = new MgFeatureQueryOptions(); queryOptions.AddFeatureProperty("FeatId"); queryOptions.AddFeatureProperty("anInt32"); queryOptions.SetFilter("anInt32 + 1 < 2"); featureReader = featureService.SelectFeatures(resourceId, className, queryOptions);
|