Package org.oscim.core
Class Box
java.lang.Object
org.oscim.core.Box
The Classic Box.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double x, double y) voidbooleancontains(double x, double y) Check if Box contains point defined by coordinates x and y.booleanCheck if Box contains Point.static BoxcreateSafe(double x1, double y1, double x2, double y2) doubledoublegetWidth()booleanCheck if this Box is inside box.voidConvert map coordinates to lat/lon.booleanvoidscale(double d) voidsetExtents(float[] points) Init or overwrite extents of box.voidsetExtents(float[] points, int length) Init or overwrite extents of box.toString()voidtranslate(double dx, double dy)
-
Field Details
-
xmin
public double xmin -
xmax
public double xmax -
ymin
public double ymin -
ymax
public double ymax
-
-
Constructor Details
-
Box
public Box()Instantiates a new Box with all values being 0. -
Box
public Box(double x, double y) Simple box instantiation (for adding extents).- Parameters:
x- the initial x valuey- the initial y value
-
Box
public Box(double xmin, double ymin, double xmax, double ymax) Instantiates a new Box.- Parameters:
xmin- the min xymin- the min yxmax- the max xymax- the max y
-
Box
Copy constructor.
-
-
Method Details
-
add
public void add(double x, double y) -
add
-
contains
public boolean contains(double x, double y) Check if Box contains point defined by coordinates x and y.- Parameters:
x- the x ordinatey- the y ordinate- Returns:
- true, if point is inside box.
-
contains
Check if Box contains Point. -
createSafe
-
getHeight
public double getHeight() -
getWidth
public double getWidth() -
inside
Check if this Box is inside box. -
map2mercator
public void map2mercator()Convert map coordinates to lat/lon. -
overlap
-
scale
public void scale(double d) -
setExtents
public void setExtents(float[] points) Init or overwrite extents of box.- Parameters:
points- the points to extend to
-
setExtents
public void setExtents(float[] points, int length) Init or overwrite extents of box.- Parameters:
points- the points to extend tolength- the number of considered points
-
toString
-
translate
public void translate(double dx, double dy)
-