Opened 14 years ago

Closed 14 years ago

#1154 closed defect (fixed)

MgLayerBase should be able to get the filter of layer definition

Reported by: christinebao Owned by: Christine Bao
Priority: medium Milestone:
Component: General Version: 2.0.2
Severity: trivial Keywords:
Cc: External ID: 1277730

Description

This requirement is from ticket http://trac.osgeo.org/fusion/ticket/327: Query: The matched objects excluded by layer filter are listed in Query result.

Layer definition may have filter, for example:

<LayerDefinition xsi:noNamespaceSchemaLocation="LayerDefinition-1.3.0.xsd" version="1.3.0">
      <VectorLayerDefinition>
           <ResourceId>Library://Theme/Data/bayarea_cities.FeatureSource</ResourceId>
           <FeatureName>SHP_Schema:bayarea_cities</FeatureName>
           <FeatureNameType>FeatureClass</FeatureNameType>
           <Filter>Autogenerated_SDF_ID < 3</Filter>
           <Geometry>SHPGEOM</Geometry>

MgLayerBase has APIs for read resource Id, feature name and geometry, but there is no way to get filter. It's better to make MgLayerBase have an API GetFilter(), and return the filter inside layer definition.

Attachments (1)

GetFilterAPI.patch (2.5 KB ) - added by christinebao 14 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by christinebao, 14 years ago

Add an new API in MgLayerBase:

    //////////////////////////////////////////////////////////////////
    /// \brief
    /// Gets the filter associated with this layer
    ///
    /// <!-- Syntax in .Net, Java, and PHP -->
    /// \htmlinclude DotNetSyntaxTop.html
    /// string GetFilter();
    /// \htmlinclude SyntaxBottom.html
    /// \htmlinclude JavaSyntaxTop.html
    /// String GetFilter();
    /// \htmlinclude SyntaxBottom.html
    /// \htmlinclude PHPSyntaxTop.html
    /// string GetFilter();
    /// \htmlinclude SyntaxBottom.html
    ///
    /// \return
    /// Returns the filter or an empty string if this layer is not a feature layer or doesn't have filter.
    ///
    virtual STRING GetFilter();  /// __get


The m_filter is assigned when parsing layer definition model, which is the same as feature source id, feature class name and geometry name.

by christinebao, 14 years ago

Attachment: GetFilterAPI.patch added

comment:3 by christinebao, 14 years ago

Resolution: fixed
Status: newclosed

Submit the patch for fixing this defect.

Note: See TracTickets for help on using tickets.