Class SimpleGeoJson.LinearProportionalGridToWorld
java.lang.Object
com.github.basking2.sdsai.marchinesquares.SimpleGeoJson.LinearProportionalGridToWorld
- All Implemented Interfaces:
SimpleGeoJson.GridToWorld
- Enclosing class:
- SimpleGeoJson
public static class SimpleGeoJson.LinearProportionalGridToWorld
extends Object
implements SimpleGeoJson.GridToWorld
A grid to world method that treats X and Y as being proportional to latitude and longitude.
That is, if the range of x values is (-50, 50) then an X value of -50 would be -180, X=0 is 0 degrees, and
X=50 is 180.
-
Constructor Summary
ConstructorDescriptionLinearProportionalGridToWorld
(double maxWidth, double maxHeight) Assume that xOffset and yOffset are both 0.LinearProportionalGridToWorld
(double xOffset, double yOffset, double maxWidth, double maxHeight) -
Method Summary
-
Constructor Details
-
LinearProportionalGridToWorld
public LinearProportionalGridToWorld(double xOffset, double yOffset, double maxWidth, double maxHeight) - Parameters:
xOffset
- Added to X before conversion.yOffset
- Added to Y before conversion.maxWidth
- The size in the X dimension.maxHeight
- The size in the Y dimension.
-
LinearProportionalGridToWorld
public LinearProportionalGridToWorld(double maxWidth, double maxHeight) Assume that xOffset and yOffset are both 0.- Parameters:
maxWidth
- The size in the X dimension.maxHeight
- The size in the Y dimension.
-
-
Method Details
-
convert
Description copied from interface:SimpleGeoJson.GridToWorld
Returns (x, y) as a two element array.- Specified by:
convert
in interfaceSimpleGeoJson.GridToWorld
- Parameters:
p
- The point to convertPoint.x
andPoint.y
from.- Returns:
- A two element array of the longitude and latitude.
-