Java Code Examples for mil.nga.sf.Polygon#numRings()

The following examples show how to use mil.nga.sf.Polygon#numRings() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GoogleMapShapeConverterUtils.java    From geopackage-android-map with MIT License 5 votes vote down vote up
/**
 * Compare two Polygons
 * 
 * @param polygon
 * @param polygon2
 */
private static void comparePolygons(Polygon polygon, Polygon polygon2) {
	List<LineString> rings = polygon.getRings();
	List<LineString> rings2 = polygon2.getRings();

	TestCase.assertEquals(polygon.numRings(), polygon2.numRings());

	for (int i = 0; i < polygon.numRings(); i++) {
		compareLineStrings(rings.get(i), rings2.get(i));
	}
}
 
Example 2
Source File: GeoPackageGeometryDataUtils.java    From geopackage-android with MIT License 5 votes vote down vote up
/**
 * Compare the two polygons for equality
 *
 * @param expected
 * @param actual
 * @param delta
 */
private static void comparePolygon(Polygon expected, Polygon actual,
                                   double delta) {

    compareBaseGeometryAttributes(expected, actual);
    TestCase.assertEquals(expected.numRings(), actual.numRings());
    for (int i = 0; i < expected.numRings(); i++) {
        compareLineString(expected.getRings().get(i), actual.getRings()
                .get(i), delta);
    }
}
 
Example 3
Source File: GeoPackageGeometryDataUtils.java    From geopackage-java with MIT License 5 votes vote down vote up
/**
 * Compare the two polygons for equality
 * 
 * @param expected
 * @param actual
 * @param delta
 */
private static void comparePolygon(Polygon expected, Polygon actual,
		double delta) {

	compareBaseGeometryAttributes(expected, actual);
	TestCase.assertEquals(expected.numRings(), actual.numRings());
	for (int i = 0; i < expected.numRings(); i++) {
		compareLineString(expected.getRings().get(i), actual.getRings()
				.get(i), delta);
	}
}