Select to view content in your preferred language

Analyse Query Definition

1035
3
09-24-2010 04:00 AM
SimonaSchlange
Emerging Contributor
Hi,

We use ArcGIS 9.3 and C#.
In Layer Properties Definition Query whe define that only Features with restricted GTYPE_ID should be visible in map.
Some query definition for example:

  • (GTYPE_ID = 3 or GTYPE_ID = 4) and STATUS <= 4

  • (GTYPE_ID=15 or GTYPE_ID=20 or GTYPE_ID=18 or GTYPE_ID=26 or GTYPE_ID=29 or GTYPE_ID=32) and STATUS <= 4

  • (GTYPE_ID <= 100 AND GTYPE_ID >= 90) OR (GTYPE_ID <= 20 and GTYPE>=10) and not GTYPE_ID =15

Is there a API to check whether GTYPE_ID 5 is visible in map.
ArcMap has to check it before display the objects in map. Can I use the same methods?

Question example: Is GTYPE_ID 5 excludet in Featurelayer?
Alternatively: Is GYTYPE 5 displayes in Featurelayer?

If I develop my own function I have to look for and, or, (), <= and/or >=....

Maybe someone has an example or only a hint for me.

Thanks,
best regards Simona
0 Kudos
3 Replies
NeilClemmons
Honored Contributor
ArcMap has to check it before display the objects in map.  This isn't how it works.  ArcMap executes the definition query against the data source and draws whatever features are returned by the query.  It doesn't parse (or analyze) the query or anything like that.  If you want to check to see if features with a certain attribute value are visible then one of the easiest ways is to just query the layer for them and see if you get anything back.  If you don't get any results from your query, then none are visible.  In order to do this, you need to use a Search method that is aware of the definition query.  You can use IDisplayTable.SearchDisplayTable(), IGeoFeatureLayer.SearchDisplayFeatures() or IFeatureLayer.Search().
0 Kudos
SimonaSchlange
Emerging Contributor
Thanks Neil for the explanation! But sorry, it doesn't help.

I have to check the parameterization. For example: Is every define featureclass/subtype in group layer (and not exclude in query definition)? The problem is that it can be that there are no features in featureclass for a valid subtype. That happens when define a new subtype. I have to find errors when someone in a team define a new subtype and no one add the subtype in the query definition for layer. So the data never displays in map.

Maybe I have to change my requirements.

Best regards.
Simona
0 Kudos
SimonaSchlange
Emerging Contributor
Has anybody else an idea to check if subtype and featureclass is valid in layer without features in featureclass?
0 Kudos