Interface ILayerResultOptions
Provides access to methods that control geometry options.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("874BA262-3901-4B69-B322-94104E4989C1")]
public interface ILayerResultOptions
Remarks
LayerResultOptions has properties that can be used to customize the results of a MapServer query.
If IncludeGeometry is set to False (default value is True), no geometry is returned. This should increase performance in cases where feature geometry is large. When IncludeGeometry is set to True, you can also choose to densify or generalize the geometry using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance.
It is important to note that QueryHyperLinks() always returns geometry regardless InlcudeGeometry’s value, but honors GeometryResultOptions.
FormatValuesInResults and ReturnFieldNamesInResults are only applied to Find and Identify functions. They are ignored by QueryData, QueryFeatureData2, QueryRowIDs, QueryFeatureIDs2, QueryRowCount, QueryFeatureCount2 & QueryHyperLinks functions. The default values for FormatValuesInResults & ReturnFieldNamesInResults are True and False respectively – that means if they are not set explicitly, those functions will respect field formatting and field alias set in the source map document and values are converted to a string in the result. When FormatValuesInResults is set to False, the numerical results of the query will be unformatted. When ReturnFieldNamesInResults is set to True, the results will display original field names.
It is important to note that Identify and Find ignores these properties when querying a layer that does not implement IFeatureLayer interface (i.e. RasterLayer etc.)
Properties
FormatValuesInResults
Indicates whether to format the values in results.
bool FormatValuesInResults { get; set; }
Property Value
Remarks
FormatValuesInResults is only applied to Find and Identify functions. It is ignored by other query function such as QueryData, QueryFeatureData2, QueryHyperLinks etc. The default value for FormatValuesInResults is True – that means if it is not set explicitly, field formatting set in the source map document will be honored. For example, if the format for a field of type double is set to have thousand separator and 3 digits after decimal, the output will be a string “999,999.999”. When it is set to False, values will be returned in the source data type, for the same case, the returned value will be a double 999999.9999999.
This property is ignored by Identify and Find functions when querying a layer that does not implement IFeatureLayer interface (i.e. Raster layer)
GeometryResultOptions
Indicates whether we need to modify Geometry.
IGeometryResultOptions GeometryResultOptions { get; set; }
Property Value
Remarks
Use GeometryResultOptions to densify or generalize the geometry returned from a query. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance.
IncludeGeometry
Indicates whether we should include Geometry.
bool IncludeGeometry { get; set; }
Property Value
Remarks
If IncludeGeometry is set to False, no geometry is returned. This should increase performance in cases where feature geometry is large. The default value for IncludeGeometry is True.
QueryHyperLinks() always returns geometry regardless InlcudeGeometry’s value.
ReturnFieldNamesInResults
Indicates whether to include field name or alias.
bool ReturnFieldNamesInResults { get; set; }
Property Value
Remarks
ReturnFieldNamesInResults is only applied to Find and Identify functions. It is ignored by other query function such as QueryData, QueryFeatureData2, QueryHyperLinks etc. The default value for ReturnFieldNamesInResults is False – that means if it is not set explicitly, field aliases set in the source map document will be honored in Find and Identify results. For example, if a field named “CNTRY_NM” has an alias set to “Country Name” in the original map document, a Find or Identify result will display “Country Name”. When ReturnFieldNamesInResult set to True, the field name “CNTRY_NM” will be returned instead of the alias.
This property is ignored by Identify and Find functions when querying a layer that does not implement the IFeatureLayer interface (i.e. Raster layer)