Package com.geodesk.feature
Interface Features
- All Known Implementing Classes:
FeatureLibrary
,com.geodesk.feature.query.View
,com.geodesk.feature.query.WorldView
A collection of features.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Features
Returns all features that have at least one common node with the given `Feature`.default Features
connectedTo
(Geometry geom) Returns all features that have at least one common vertex with the given `Geometry`.default Features
containing
(Feature feature) Returns all features that contain the given feature.default Features
containing
(Geometry geom) Returns all features that contain the given `Geometry`.default Features
containing
(PreparedGeometry prepared) Returns all features that contain the given `PreparedGeometry`.default Features
containingLonLat
(double lon, double lat) Returns all features that contain the given coordinate expressed at longitude and latitudedefault Features
containingXY
(int x, int y) Returns all features that contain the given Mercator-projected coordinatedefault boolean
Checks whether this collection contains the given object.default long
count()
Returns the number of features in this collection.default Features
default Features
default Features
coveredBy
(PreparedGeometry prepared) default Features
default Features
default Features
crossing
(PreparedGeometry prepared) default Features
default Features
default Features
disjoint
(PreparedGeometry prepared) default Feature
first()
Returns the first feature in the collection.Returns a view of this collection that contains only features whose bounding box intersects the givenBounds
.default Features
intersecting
(Feature feature) default Features
intersecting
(Geometry geom) default Features
intersecting
(PreparedGeometry prepared) default boolean
isEmpty()
Returns `true` if this collection contains no features.default Features
maxMetersFrom
(double distance, Feature feature) Returns all features that lie within a given distance from another `Feature`.default Features
maxMetersFrom
(double distance, Geometry geom) Returns all features that lie within a given distance from a `Geometry`.default Features
maxMetersFromLonLat
(double distance, double lon, double lat) Returns all features whose closest point lies within a given radius.default Features
maxMetersFromXY
(double distance, int x, int y) Returns all features whose closest point lies within a given radius.default Features
Returns the features that are nodes of the given way, or members of the given relation.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.default Features
Returns a sub-view that contains only the features that are nodes of the given way.default Features
overlapping
(Feature feature) default Features
overlapping
(Geometry geom) default Features
overlapping
(PreparedGeometry prepared) default Features
Returns the features that are parent elements of the given feature (ways and/or relations).Returns a view of this collection that contains only relations.Returns a view of this collection that contains only relations matching the given query.Returns the features present in both this collection and `other`.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 Feature[]
toList()
Creates aList
containing all features in this collection.default Features
default Features
default Features
touching
(PreparedGeometry prepared) 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.default Features
default Features
default Features
within
(PreparedGeometry prepared) 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
Features 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
Features 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
Features 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. -
nodesOf
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
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
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
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
Feature
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
-
connectedTo
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
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
Returns all features that contain the given Mercator-projected coordinate- Parameters:
x
-y
-- Returns:
-
containingLonLat
Returns all features that contain the given coordinate expressed at longitude and latitude- Parameters:
lon
-lat
-- Returns:
-
containing
Returns all features that contain the given feature.- Parameters:
feature
-- Returns:
-
containing
Returns all features that contain the given `Geometry`.- Parameters:
geom
-- Returns:
-
containing
Returns all features that contain the given `PreparedGeometry`.- Parameters:
prepared
-- Returns:
-
coveredBy
-
coveredBy
-
coveredBy
-
crossing
-
crossing
-
crossing
-
disjoint
-
disjoint
-
disjoint
-
intersecting
-
intersecting
-
intersecting
-
maxMetersFromXY
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 pointy
- the Y coordinate of the center point- Returns:
-
maxMetersFromLonLat
Returns all features whose closest point lies within a given radius.- Parameters:
distance
- the maximum distance (in meters)lon
- the longitude of the center pointlat
- the latitude of the center point- Returns:
-
maxMetersFrom
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
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
-
overlapping
-
overlapping
-
touching
-
touching
-
touching
-
within
-
within
-
within
-
select
Returns the features present in both this collection and `other`.- Parameters:
other
-- Returns:
-