Last Published: April 25, 2020

Error Message

Setting the Geometry property of a spatial filter to null (or Nothing, in Visual Basic) returns the following error:



Prior to ArcGIS 9.3, the Geometry property of a spatial filter could be set to null. At version 9.3, additional error checking was added to prevent the property from being set to an invalid geometry with a null geometry considered as invalid.

Solution or Workaround

To perform a query without spatial constraints, there are two options:

1. Use the QueryFilter class along with the IQueryFilter interface, instead of a spatial filter.

// Create the query filter.
IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.WhereClause = "PROPERTY_ID > 3000";

// Execute the query.
featureClass.Search(queryFilter, true);

2. Do not set the spatial filter's Geometry property. By default, it is already set to null.

// Create the spatial filter.
ISpatialFilter spatialFilter = new SpatialFilterClass();
spatialFilter.WhereClause = "PROPERTY_ID > 3000";

// Execute the query.
featureClass.Search(spatialFilter, true);

    Article ID:000010046

    • ArcGIS Engine 9 x
    • ArcMap 9 x

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options

    Discover more on this topic