Java utility class that determines compass rose points for 4, 8, 16 and 32 point windroses
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Java utility class that determines compass rose points for 4, 8, 16 and 32 point windroses.

For example here is the output and source code for determining the compass points between Ocean City, NJ and New Orleans, LA.

Traveling from Ocean City, NJ to New Orleans, LA
True Bearing/Heading:   238 degrees
4-point compass point:  West
8-point compass point:  Southwest
16-point compass point: West-southwest
32-point compass point: Southwest by west
public class WindroseTester {

    public static void main(String[] args) {

        String currentLocation = "Ocean City, NJ";
        String targetLocation  = "New Orleans, LA";
        Float[] location1 = WindroseUtils.performGeoCoding(currentLocation);
        Float[] location2 = WindroseUtils.performGeoCoding(targetLocation);

        System.out.println("Traveling from "+ currentLocation + " to " + targetLocation);

        System.out.println("True Bearing/Heading:   " + WindroseUtils.queryWindRose(location1[0], location1[1], location2[0], location2[1]) + " degrees");
        System.out.println("4-point compass point:  " + WindroseUtils.queryWindRose(WindrosePoints.FOUR, location1[0], location1[1], location2[0], location2[1]));
        System.out.println("8-point compass point:  " + WindroseUtils.queryWindRose(WindrosePoints.EIGHT, location1[0], location1[1], location2[0], location2[1]));
        System.out.println("16-point compass point: " + WindroseUtils.queryWindRose(WindrosePoints.SIXTEEN, location1[0], location1[1], location2[0], location2[1]));
        System.out.println("32-point compass point: " + WindroseUtils.queryWindRose(WindrosePoints.THIRTY_TWO, location1[0], location1[1], location2[0], location2[1]));