Define an alias for a computed property and an expression for what is to be computed. In this SQL example, "select min(aDouble + aSingle) as minF, min(anInt16 + anInt16) as minI from featclass;", minF and minI are computed properties. Call this method for each computed property that you add.
.NET Syntax
Java Syntax
PHP Syntax
Example (PHP)
<?php $queryOptions->AddComputedProperty("minF", "aDouble + aSingle"); $queryOptions->AddComputedProperty("minI", "anInt64 + anInt16"); $featureService->SelectFeatures($featureSrcResourceId, $featClassName, $queryOptions); $featureService->SelectFeatures($featureSrcResourceId, $featClassName, $queryOptions); ?> sqlplus> select min(aDouble + aSingle) as minF, min(anInt16 + anInt16) as minI 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("aDouble"); queryOptions.AddComputedProperty("ceilADouble", "Ceil(aDouble)"); featureReader = featureService.SelectFeatures(resourceId, className, queryOptions);
|