Package org.openstreetmap.josm.tools
Class DefaultGeoProperty
- java.lang.Object
-
- org.openstreetmap.josm.tools.DefaultGeoProperty
-
- All Implemented Interfaces:
GeoProperty<java.lang.Boolean>
public class DefaultGeoProperty extends java.lang.Object implements GeoProperty<java.lang.Boolean>
Implementation of simple booleanGeoProperty.
-
-
Constructor Summary
Constructors Constructor Description DefaultGeoProperty(java.util.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 java.lang.Booleanget(LatLon ll)Look up the property for a point.java.lang.Booleanget(BBox box)Look up the property for a coordinate rectangle.java.awt.geom.AreagetArea()Returns the area.LatLongetRandomLatLon()Returns a random lat/lon in the area.
-
-
-
Constructor Detail
-
DefaultGeoProperty
public DefaultGeoProperty(java.util.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 java.lang.Boolean get(LatLon ll)
Description copied from interface:GeoPropertyLook up the property for a point.- Specified by:
getin interfaceGeoProperty<java.lang.Boolean>- Parameters:
ll- the point coordinates- Returns:
- property value at that point. Must not be null.
-
get
public java.lang.Boolean get(BBox box)
Description copied from interface:GeoPropertyLook up the property for a coordinate rectangle.- Specified by:
getin interfaceGeoProperty<java.lang.Boolean>- Parameters:
box- the rectangle- Returns:
- the property, if it is the same in the entire rectangle; null otherwise
-
getArea
public final java.awt.geom.Area getArea()
Returns the area.- Returns:
- the area
- Since:
- 14484
-
getRandomLatLon
public final LatLon getRandomLatLon()
Returns a random lat/lon in the area.- Returns:
- a random lat/lon in the area
- Since:
- 15359
-
-