semantique.ArrayProxy.filter_space

semantique.ArrayProxy.filter_space#

ArrayProxy.filter_space(*filterer, **kwargs)[source]#

Filter an array along the spatial dimension.

This verb is a shortcut for first extracting the spatial dimension with the extract() verb (optionally only a specific component of that dimension, such as the spatial feature indices), then evaluating a relational operator on the coordinates of this dimension using the evaluate() verb, and finally using the output of that operation as filterer in the filter() verb.

Parameters:
  • *filterer – Either two positional arguments consisting of respectively the name of the relational operator and value of the right-hand side operand to be used in the expression, or three positional arguments consisting of respectively the name of the component to be extracted from the spatial dimension, the relational operator and value of the right-hand side operand to be used in the expression.

  • **kwargs – Additional keyword arguments passed on to Array.filter.

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").filter_space("intersects", sq.geometry(gpd.read_file("foo.gpkg")))
>>> sq.entity("water").filter_space("feature", "equals", 1)