Class GeometryFilter

    • Constructor Detail

      • GeometryFilter

        protected GeometryFilter​(@Nonnull
                                 org.heigit.ohsome.oshdb.filter.GeometryFilter.ValueRange valueRange,
                                 org.heigit.ohsome.oshdb.filter.GeometryFilter.GeometryMetricEvaluator metricEvaluator)
    • Method Detail

      • getRange

        public org.heigit.ohsome.oshdb.filter.GeometryFilter.ValueRange getRange()
      • applyOSH

        public boolean applyOSH​(OSHEntity entity)
        Description copied from interface: FilterExpression
        Apply the filter to an OSH entity.

        Must be compatible with the result of FilterExpression.applyOSM(org.heigit.ohsome.oshdb.osm.OSMEntity), e.g. that it must not return false when oshEntity.getVersions().….anyMatch(applyOSM) would evaluate to true.

        Specified by:
        applyOSH in interface FilterExpression
        Parameters:
        entity - the OSH entity to check.
        Returns:
        false if the filter knows that none of the versions of the OSH entity can fulfill the specified filter, true otherwise.
      • applyOSM

        public boolean applyOSM​(OSMEntity entity)
        Description copied from interface: FilterExpression
        Apply the filter to an OSM entity.
        Specified by:
        applyOSM in interface FilterExpression
        Parameters:
        entity - the OSM entity to check.
        Returns:
        true if the entity fulfills the specified filter, otherwise false.
      • applyOSMGeometry

        public boolean applyOSMGeometry​(OSMEntity entity,
                                        Supplier<org.locationtech.jts.geom.Geometry> geometrySupplier)
        Description copied from interface: FilterExpression
        Apply the filter to an "OSM feature" (i.e. an entity with a geometry).

        The default implementation doesn't perform a geometry type check, but any Filter can override it to do so.

        Specified by:
        applyOSMGeometry in interface FilterExpression
        Parameters:
        entity - the OSM entity to check.
        geometrySupplier - a function returning the geometry of this OSM feature to check.
        Returns:
        true if the OSM feature fulfills the specified filter, otherwise false.
      • applyOSMContribution

        public boolean applyOSMContribution​(OSMContribution contribution)
        Description copied from interface: FilterExpression
        Apply a filter to a contribution (OSMEntitySnapshot) to an OSM entity.

        A contribution matches the given filter if either the state of the OSM entity before the modification or the state of it after the modification matches the filter.

        Specified by:
        applyOSMContribution in interface FilterExpression
        Parameters:
        contribution - a modification of the OSM entity to check
        Returns:
        true if the the OSM contribution fulfills the specified filter, otherwise false.
      • negate

        public org.heigit.ohsome.oshdb.filter.NegatableFilter negate()
        Description copied from interface: FilterExpression
        Returns the opposite of the current filter expression.
        Specified by:
        negate in interface FilterExpression
        Returns:
        the opposite of the current filter expression.