long setCurrentGeometry(string attrName, string attrVal)

This method finds the feature defined by the given arguments (See General Search Criteria), and sets its geometry as the “current geometry” for subsequent calls to methods that interrogate that geometry.

The subsequent calls must be consistent with the type of geometry.  Thus, it is meaningful to call  hasLocInCurrentPolygon and getFeaturesInCurrentPolygon only after setCurrentGeometry has been called with polygon search criteria.  Similarly, it is meaningful to call hasLocRelativeToCurrentLine only after setCurrentGeometry has been called with line search criteria.

If the search criteria defined by the arguments are not unique, i.e. if more than one feature is found, the first one found will provide the current geometry..

This method returns 0 if a feature satisfying the search criteria is found, and returns an error code if no such feature is found, or if the feature found has an invalid geometry.  (The latter should normally not occur, and would most likely indicate a corrupted map dataset.)

Migration note for v2.5 developers: getFeaturesInCurrentPolygon and setCurrentGeometry together correspond to getFeaturesInsideShape, when: