Package com.geodesk.feature
Interface Features<T extends Feature>
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
FeatureLibrary
,com.geodesk.feature.query.WorldView
A collection of features.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Checks whether this collection contains the given object.default long
count()
Returns the number of features in this collection.default T
first()
Returns the first feature in the collection.in
(com.geodesk.geom.Bounds bbox) Returns a view of this collection that contains only features whose bounding box intersects the givenBounds
.default boolean
isEmpty()
Returns `true` if this collection contains no features.nodes()
Returns a view of this collection that contains only nodes.Returns a view of this collection that contains only nodes matching the given query.Returns a sub-view that contains only the features that are nodes of the given way, or members of the given relation.Returns a view of this collection that contains only relations.Returns a view of this collection that contains only relations matching the given query.Features<?>
Returns a view of this collection that only contains features matching the given query.default Object[]
toArray()
Creates an array containing all features in this collection.default T[]
toList()
Creates aList
containing all features in this collection.ways()
Returns a view of this collection that contains only ways.Returns a view of this collection that contains only ways matching the given query.Returns a sub-view that contains only the features that are parent elements of the given feature (ways and/or relations).Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
select
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
Returns a view of this collection that contains only nodes.- Returns:
- a collection of
Node
objects
-
nodes
Returns a view of this collection that contains only nodes matching the given query. -
ways
Returns a view of this collection that contains only ways.- Returns:
- a collection of
Way
objects
-
ways
Returns a view of this collection that contains only ways matching the given query. -
relations
Returns a view of this collection that contains only relations.- Returns:
- a collection of
Relation
objects
-
relations
Returns a view of this collection that contains only relations matching the given query. -
of
Returns a sub-view that contains only 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
-
with
Returns a sub-view that contains only 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
Returns a view of this collection that contains only features whose bounding box intersects the givenBounds
.- Parameters:
bbox
- the bounding box to use as a filter- Returns:
- a collection of
Relation
objects
-
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
Creates aList
containing all features in this collection.- Returns:
- a list containing all features
-
toArray
Creates an array containing all features in this collection.- Returns:
- an array containing all features
-
toArray
-
contains
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
-