Class FeatureLibrary
java.lang.Object
com.geodesk.feature.FeatureLibrary
- All Implemented Interfaces:
Features
,AutoCloseable
,Iterable<Feature>
A Geographic Object Library containing features.
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureLibrary
(String path) Creates aFeatureLibrary
instance associated with an existing GOL file.FeatureLibrary
(String path, String url) Creates aFeatureLibrary
instance associated with the given GOL file; if the file does not exist, an empty library will be created.FeatureLibrary
(Path path) Creates aFeatureLibrary
instance associated with an existing GOL file.FeatureLibrary
(Path path, String url) Creates aFeatureLibrary
instance associated with the given GOL file; if the file does not exist, an empty library will be created. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the library and releases its resources.boolean
Checks whether this collection contains the given object.Returns a view of this collection that contains only features whose bounding box intersects the givenBounds
.iterator()
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.Returns a sub-view that contains only the features that are nodes of the given way.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 andother
.Returns a view of this collection that only contains features matching the given query.int
types()
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.geodesk.feature.Features
addTo, connectedTo, connectedTo, containing, containing, containing, containingLonLat, containingXY, count, coveredBy, coveredBy, coveredBy, crossing, crossing, crossing, disjoint, disjoint, disjoint, first, intersecting, intersecting, intersecting, isEmpty, maxMetersFrom, maxMetersFrom, maxMetersFromLonLat, maxMetersFromXY, overlapping, overlapping, overlapping, toArray, toArray, toList, touching, touching, touching, within, within, within
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FeatureLibrary
Creates aFeatureLibrary
instance associated with an existing GOL file.- Parameters:
path
- the path of the GOL file.
-
FeatureLibrary
Creates aFeatureLibrary
instance associated with an existing GOL file.- Parameters:
path
- the path of the GOL file.
-
FeatureLibrary
-
FeatureLibrary
-
-
Method Details
-
geometryFactory
-
close
public void close()Closes the library and releases its resources.
Important: Do not call the methods of any collections or features you have retrieved from this library after you've closed it. Doing so leads to undefined results and may cause a segmentation fault.
- Specified by:
close
in interfaceAutoCloseable
-
in
-
contains
-
select
-
iterator
-
types
public int types() -
select
-
nodes
-
nodes
-
ways
-
ways
-
relations
-
relations
Description copied from interface:Features
Returns a view of this collection that contains only relations matching the given query. -
parentsOf
-
membersOf
Description copied from interface:Features
Returns the features that are nodes of the given way, or members of the given relation. If a node is passed asparent
, an empty view is returned (as nodes cannot have child elements). -
nodesOf
-
select
-