Package org.openstreetmap.josm.tools
Class DefaultGeoProperty
- java.lang.Object
-
- org.openstreetmap.josm.tools.DefaultGeoProperty
-
- All Implemented Interfaces:
GeoProperty<Boolean>
public class DefaultGeoProperty extends Object implements GeoProperty<Boolean>
Implementation of simple booleanGeoProperty
.
-
-
Constructor Summary
Constructors Constructor Description DefaultGeoProperty(Collection<Way> ways)
Create DefaultGeoProperty based on a collection of closed ways.DefaultGeoProperty(Relation multipolygon)
Create DefaultGeoProperty based on a multipolygon relation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
get(LatLon ll)
Look up the property for a point.Boolean
get(BBox box)
Look up the property for a coordinate rectangle.Area
getArea()
Returns the area.LatLon
getRandomLatLon()
Returns a random lat/lon in the area.
-
-
-
Constructor Detail
-
DefaultGeoProperty
public DefaultGeoProperty(Collection<Way> ways)
Create DefaultGeoProperty based on a collection of closed ways.- Parameters:
ways
- the ways forming the area
-
DefaultGeoProperty
public DefaultGeoProperty(Relation multipolygon)
Create DefaultGeoProperty based on a multipolygon relation.- Parameters:
multipolygon
- the multipolygon
-
-
Method Detail
-
get
public Boolean get(LatLon ll)
Description copied from interface:GeoProperty
Look up the property for a point.- Specified by:
get
in interfaceGeoProperty<Boolean>
- Parameters:
ll
- the point coordinates- Returns:
- property value at that point. Must not be null.
-
get
public Boolean get(BBox box)
Description copied from interface:GeoProperty
Look up the property for a coordinate rectangle.- Specified by:
get
in interfaceGeoProperty<Boolean>
- Parameters:
box
- the rectangle- Returns:
- the property, if it is the same in the entire rectangle; null otherwise
-
getRandomLatLon
public final LatLon getRandomLatLon()
Returns a random lat/lon in the area.- Returns:
- a random lat/lon in the area
- Since:
- 15359
-
-