@Test public void testParseMultiPolygon() throws Exception { GeoJsonParser parser = new GeoJsonParser(validMultiPolygon()); assertEquals(1, parser.getFeatures().size()); GeoJsonFeature feature = parser.getFeatures().get(0); GeoJsonMultiPolygon polygon = ((GeoJsonMultiPolygon) feature.getGeometry()); assertEquals(2, polygon.getPolygons().size()); assertEquals(1, polygon.getPolygons().get(0).getCoordinates().size()); List<List<LatLng>> p1 = new ArrayList<>(); p1.add( new ArrayList<>( Arrays.asList( new LatLng(2, 102), new LatLng(2, 103), new LatLng(3, 103), new LatLng(3, 102), new LatLng(2, 102)))); assertEquals(p1, polygon.getPolygons().get(0).getCoordinates()); assertEquals(2, polygon.getPolygons().get(1).getCoordinates().size()); List<List<LatLng>> p2 = new ArrayList<>(); p2.add( new ArrayList<>( Arrays.asList( new LatLng(0, 100), new LatLng(0, 101), new LatLng(1, 101), new LatLng(1, 100), new LatLng(0, 100)))); p2.add( new ArrayList<>( Arrays.asList( new LatLng(0.2, 100.2), new LatLng(0.2, 100.8), new LatLng(0.8, 100.8), new LatLng(0.8, 100.2), new LatLng(0.2, 100.2)))); assertEquals(p2, polygon.getPolygons().get(1).getCoordinates()); }
ArrayList<GeoJsonFeature> getFeatures() { return mGeoJsonFeatures; }
GeoJsonParser { ArrayList<GeoJsonFeature> getFeatures() { return mGeoJsonFeatures; } }
GeoJsonParser { ArrayList<GeoJsonFeature> getFeatures() { return mGeoJsonFeatures; } GeoJsonParser(JSONObject geoJsonFile); }
GeoJsonParser { ArrayList<GeoJsonFeature> getFeatures() { return mGeoJsonFeatures; } GeoJsonParser(JSONObject geoJsonFile); static Geometry parseGeometry(JSONObject geoJsonGeometry); }
GeoJsonParser { ArrayList<GeoJsonFeature> getFeatures() { return mGeoJsonFeatures; } GeoJsonParser(JSONObject geoJsonFile); static Geometry parseGeometry(JSONObject geoJsonGeometry);  }