Version 0.2 uses a simpler, more intuitive API. It does, however, introduce some breaking changes. Follow these steps for a smooth upgrade:
-
The package
com.geodesk.core
has been consolidated intocom.geodesk.geom
. Most notably, this affects theBox
class. Change allimport
statements accordingly. -
The methods of
Node
,Way
andRelation
have been moved toFeature
(their supertype). The subtypes continue to exist as marker interfaces, but you should change all uses ofNode
,Way
andRelation
toFeature
. -
The
Features
interface is no longer generic. Change all uses ofFeatures<T>
to plainFeatures
. -
Change:
Old New Relation.memberNodes()
Feature.members().nodes()
Relation.memberWays()
Feature.members().ways()
Relation.memberRelations()
Feature.members().relations()
Feature.parentWays()
Feature.parents().ways()
Feature.parentRelations()
Feature.parents().relations()
Note that in many cases, the type filter can be omitted. For example, in
Feature.members("n[public_transport=stop_position]").nodes()
the call to
.nodes()
can be omitted sincen
already restricts the members to nodes.
-
The
Filters
class has been deprecated and may be removed in future releases. Instead of creating filters via its factory methods and passing them toFeatures.select()
, you can now call filter methods directly onFeatures
. So, instead ofhotels.select(Filters.within(berlin))
you can simply use:
hotels.within(berlin)
Note that the names of several filter methods have changed to better reflect their purpose:
Old New contains()
containing()
crosses()
crossing()
intersects()
intersecting()
overlaps()
overlapping()
touches()
touching()
-
Use the new type-check methods instead of
instanceof
:Old New feature instanceof Node
feature.isNode()
feature instanceof Way
feature.isWay()
feature instanceof Relation
feature.isRelation()