package com.github.davidmoten.rtree.geometry;

public final class Geometries {

    private Geometries() {
        // prevent instantiation
    }

    public static Point point(double x, double y) {
        return Point.create(x, y);
    }

    public static Rectangle rectangle(double x1, double y1, double x2, double y2) {
        return Rectangle.create(x1, y1, x2, y2);
    }

    public static Circle circle(double x, double y, double radius) {
        return Circle.create(x, y, radius);
    }
    
}

@@ -40,16 +40,73 @@
 metry;%0A%0A
+import com.google.common.annotations.VisibleForTesting;%0A%0A
 public f
@@ -550,15 +550,706 @@
 ;%0A    %7D%0A
+%0A
     
+public static Rectangle rectangleLatLong(double lon1, double lat1, double lon2, double lat2) %7B%0A        double x1 = normalizeLongitude(lon1);%0A        double x2 = normalizeLongitude(lon2);%0A        if (x2 %3C x1) %7B%0A            x2 += 360;%0A        %7D%0A        return rectangle(x1, lat1, x2, lon2);%0A    %7D%0A%0A    public static Point pointLatLong(double lon, double lat) %7B%0A        return point(normalizeLongitude(lon), lat);%0A    %7D%0A%0A    @VisibleForTesting%0A    static double normalizeLongitude(double d) %7B%0A        double sign = Math.signum(d);%0A        double x = Math.abs(d) / 360;%0A        double x2 = (x - Math.floor(x)) * 360;%0A        if (x2 %3E= 180)%0A            x2 -= 360;%0A        return x2 * sign;%0A    %7D
 %0A%7D%0A

add factory methods for lat lon rectangles and points