@Test public void testAreaOther() { assertEquals(0.0, Geo.areaOf(gf.createPoint(new Coordinate(0, 0))), 1E-22); assertEquals(0.0, Geo.areaOf(gf.createMultiPoint(new Point[]{ gf.createPoint(new Coordinate(0, 0)), gf.createPoint(new Coordinate(1, 1)) })), 1E-22); assertEquals(0.0, Geo.areaOf(gf.createLineString( constructCoordinates(0, 0, 1, 1, 0, 1, 0, 0) )), 1E-22); assertEquals(0.0, Geo.areaOf(gf.createMultiLineString(new LineString[]{ gf.createLineString(constructCoordinates(0, 0, 1, 1, 0, 1, 0, 0)), gf.createLineString(constructCoordinates(1, 1, 2, 2, 1, 2, 1, 1)) })), 1E-22); }
public static double areaOf(Polygon poly) { double area = 0.0; area += Math.abs(ringArea((LinearRing) poly.getExteriorRing())); for (int i = 0; i < poly.getNumInteriorRing(); i++) { area -= Math.abs(ringArea((LinearRing) poly.getInteriorRingN(i))); } return area; }
Geo { public static double areaOf(Polygon poly) { double area = 0.0; area += Math.abs(ringArea((LinearRing) poly.getExteriorRing())); for (int i = 0; i < poly.getNumInteriorRing(); i++) { area -= Math.abs(ringArea((LinearRing) poly.getInteriorRingN(i))); } return area; } }
Geo { public static double areaOf(Polygon poly) { double area = 0.0; area += Math.abs(ringArea((LinearRing) poly.getExteriorRing())); for (int i = 0; i < poly.getNumInteriorRing(); i++) { area -= Math.abs(ringArea((LinearRing) poly.getInteriorRingN(i))); } return area; }  }
Geo { public static double areaOf(Polygon poly) { double area = 0.0; area += Math.abs(ringArea((LinearRing) poly.getExteriorRing())); for (int i = 0; i < poly.getNumInteriorRing(); i++) { area -= Math.abs(ringArea((LinearRing) poly.getInteriorRingN(i))); } return area; }  static double distanceBetweenCoordinatesHaversine(
      double lat1, double lng1, double lat2, double lng2
  ); static double distanceBetweenCoordinates(
      double lat1, double lng1, double lat2, double lng2
  ); static double lengthOf(LineString line); static double lengthOf(MultiLineString multiline); static double lengthOf(GeometryCollection geometryCollection); static double lengthOf(Geometry geom); static double areaOf(Polygon poly); static double areaOf(MultiPolygon multipoly); static double areaOf(GeometryCollection geometryCollection); static double areaOf(Geometry geom); static double ringArea(LinearRing ring); static Geometry clip(Geometry obj, OSHDBBoundingBox bbox); static Geometry clip(Geometry obj, P poly); }
Geo { public static double areaOf(Polygon poly) { double area = 0.0; area += Math.abs(ringArea((LinearRing) poly.getExteriorRing())); for (int i = 0; i < poly.getNumInteriorRing(); i++) { area -= Math.abs(ringArea((LinearRing) poly.getInteriorRingN(i))); } return area; }  static double distanceBetweenCoordinatesHaversine(
      double lat1, double lng1, double lat2, double lng2
  ); static double distanceBetweenCoordinates(
      double lat1, double lng1, double lat2, double lng2
  ); static double lengthOf(LineString line); static double lengthOf(MultiLineString multiline); static double lengthOf(GeometryCollection geometryCollection); static double lengthOf(Geometry geom); static double areaOf(Polygon poly); static double areaOf(MultiPolygon multipoly); static double areaOf(GeometryCollection geometryCollection); static double areaOf(Geometry geom); static double ringArea(LinearRing ring); static Geometry clip(Geometry obj, OSHDBBoundingBox bbox); static Geometry clip(Geometry obj, P poly); static double earthRadius; }