Interface Features

All Superinterfaces:
Iterable<Feature>
All Known Implementing Classes:
FeatureLibrary, com.geodesk.feature.query.View, com.geodesk.feature.query.WorldView

public interface Features extends Iterable<Feature>
A collection of features.
  • Method Details

    • select

      Features select(String query)
      Returns a view of this collection that only contains features matching the given query.
      Parameters:
      query - a query in GOQL format
      Returns:
      a feature collection
    • nodes

      Features nodes()
      Returns a view of this collection that contains only nodes.
      Returns:
      a collection of Node objects
    • nodes

      Features nodes(String query)
      Returns a view of this collection that contains only nodes matching the given query.
      Parameters:
      query - a query in GOQL format
      Returns:
      a collection of Node objects
    • ways

      Features ways()
      Returns a view of this collection that contains only ways.
      Returns:
      a collection of Way objects
    • ways

      Features ways(String query)
      Returns a view of this collection that contains only ways matching the given query.
      Parameters:
      query - a query in GOQL format
      Returns:
      a collection of Way objects
    • relations

      Features relations()
      Returns a view of this collection that contains only relations.
      Returns:
      a collection of Relation objects
    • relations

      Features relations(String query)
      Returns a view of this collection that contains only relations matching the given query.
      Parameters:
      query - a query in GOQL format
      Returns:
      a collection of Relation objects
    • nodesOf

      default Features nodesOf(Feature parent)
      Returns a sub-view that contains only the features that are nodes of the given way.
      Parameters:
      parent - a way or relation
      Returns:
      a collection of features
    • membersOf

      default Features membersOf(Feature parent)
      Returns the features that are nodes of the given way, or members of the given relation. If a node is passed as `parent`, an empty view is returned (as nodes cannot have child elements).
      Parameters:
      parent - a way or relation
      Returns:
      a collection of features
    • parentsOf

      default Features parentsOf(Feature child)
      Returns the features that are parent elements of the given feature (ways and/or relations).
      Parameters:
      child - a way or relation
      Returns:
      a collection of features
    • in

      Features in(Bounds bbox)
      Returns a view of this collection that contains only features whose bounding box intersects the given Bounds.
      Parameters:
      bbox - the bounding box to use as a filter
      Returns:
      a collection of Feature objects
    • first

      default Feature first()
      Returns the first feature in the collection. If the collection is unordered, this method selects one of multiple features in a non-deterministic way.
      Returns:
      the first feature, or `null` if the collection is empty
    • count

      default long count()
      Returns the number of features in this collection.
      Returns:
      the number of features
    • isEmpty

      default boolean isEmpty()
      Returns `true` if this collection contains no features.
      Returns:
      `true` if this collection contains no features
    • toList

      default List<Feature> toList()
      Creates a List containing all features in this collection.
      Returns:
      a list containing all features
    • toArray

      default Object[] toArray()
      Creates an array containing all features in this collection.
      Returns:
      an array containing all features
    • toArray

      default Feature[] toArray(Feature[] a)
    • contains

      default boolean contains(Object f)
      Checks whether this collection contains the given object.
      Parameters:
      f - the object whose presence in this collection is to be tested
      Returns:
      `true` if this collection contains the specified object
    • select

      Features select(Filter filter)
    • connectedTo

      default Features connectedTo(Feature f)
      Returns all features that have at least one common node with the given `Feature`.
      Parameters:
      f - the `Feature` whose nodes to check against
      Returns:
    • connectedTo

      default Features connectedTo(Geometry geom)
      Returns all features that have at least one common vertex with the given `Geometry`. Coordinates of the `Geometry` are rounded to integers.
      Parameters:
      geom - the `Geometry` whose vertexes to check against
      Returns:
    • containingXY

      default Features containingXY(int x, int y)
      Returns all features that contain the given Mercator-projected coordinate
      Parameters:
      x -
      y -
      Returns:
    • containingLonLat

      default Features containingLonLat(double lon, double lat)
      Returns all features that contain the given coordinate expressed at longitude and latitude
      Parameters:
      lon -
      lat -
      Returns:
    • containing

      default Features containing(Feature feature)
      Returns all features that contain the given feature.
      Parameters:
      feature -
      Returns:
    • containing

      default Features containing(Geometry geom)
      Returns all features that contain the given `Geometry`.
      Parameters:
      geom -
      Returns:
    • containing

      default Features containing(PreparedGeometry prepared)
      Returns all features that contain the given `PreparedGeometry`.
      Parameters:
      prepared -
      Returns:
    • coveredBy

      default Features coveredBy(Feature feature)
    • coveredBy

      default Features coveredBy(Geometry geom)
    • coveredBy

      default Features coveredBy(PreparedGeometry prepared)
    • crossing

      default Features crossing(Feature feature)
    • crossing

      default Features crossing(Geometry geom)
    • crossing

      default Features crossing(PreparedGeometry prepared)
    • disjoint

      default Features disjoint(Feature feature)
    • disjoint

      default Features disjoint(Geometry geom)
    • disjoint

      default Features disjoint(PreparedGeometry prepared)
    • intersecting

      default Features intersecting(Feature feature)
    • intersecting

      default Features intersecting(Geometry geom)
    • intersecting

      default Features intersecting(PreparedGeometry prepared)
    • maxMetersFromXY

      default Features maxMetersFromXY(double distance, int x, int y)
      Returns all features whose closest point lies within a given radius.
      Parameters:
      distance - the maximum distance (in meters)
      x - the X coordinate of the center point
      y - the Y coordinate of the center point
      Returns:
    • maxMetersFromLonLat

      default Features maxMetersFromLonLat(double distance, double lon, double lat)
      Returns all features whose closest point lies within a given radius.
      Parameters:
      distance - the maximum distance (in meters)
      lon - the longitude of the center point
      lat - the latitude of the center point
      Returns:
    • maxMetersFrom

      default Features maxMetersFrom(double distance, Geometry geom)
      Returns all features that lie within a given distance from a `Geometry`. The Filter measures the distance between the closest points of the Geometry and the candidate Feature.
      Parameters:
      distance - the maximum distance (in meters)
      geom - the Geometry from which to measure
      Returns:
    • maxMetersFrom

      default Features maxMetersFrom(double distance, Feature feature)
      Returns all features that lie within a given distance from another `Feature`. The Filter measures the distance between the closest points of the features.
      Parameters:
      distance - the maximum distance (in meters)
      feature - the Feature from which to measure
      Returns:
    • overlapping

      default Features overlapping(Feature feature)
    • overlapping

      default Features overlapping(Geometry geom)
    • overlapping

      default Features overlapping(PreparedGeometry prepared)
    • touching

      default Features touching(Feature feature)
    • touching

      default Features touching(Geometry geom)
    • touching

      default Features touching(PreparedGeometry prepared)
    • within

      default Features within(Feature feature)
    • within

      default Features within(Geometry geom)
    • within

      default Features within(PreparedGeometry prepared)
    • select

      Features select(Features other)
      Returns the features present in both this collection and `other`.
      Parameters:
      other -
      Returns: