Class FilterParser


  • public class FilterParser
    extends Object
    A parser for OSM entity filters.

    Such filters can select OSM entities by their tags, their type or other attributes. Filters can contain boolean operators (and/or/not) and parentheses can be used.

    Example: "type:way and highway=residential and not (lit=yes or lit=automatic)"

    • Constructor Detail

      • FilterParser

        public FilterParser​(TagTranslator tt)
        Creates a new parser for OSM entity filters.
        Parameters:
        tt - A tagtranslator object, used to transform OSM tags (e.g. "building=yes") to their respective OSHDB counterparts.
      • FilterParser

        public FilterParser​(TagTranslator tt,
                            boolean allowContributorFilters)
        Creates a new parser for OSM entity filters.
        Parameters:
        tt - A tagtranslator object, used to transform OSM tags (e.g. "building=yes") to their respective OSHDB counterparts.
        allowContributorFilters - if true enables filtering by contributor/user id.
    • Method Detail

      • parse

        @Contract(pure=true)
        public FilterExpression parse​(String str)
        Parse a filter expression.
        Parameters:
        str - A string representing an OSM entity filter.
        Returns:
        A tree structure representing this filter, can be applied to OSM entities.