/** * Creates a new KmlPoint object * * @return KmlPoint object */ private static KmlPoint createPoint(XmlPullParser parser) throws XmlPullParserException, IOException { LatLngAlt latLngAlt = null; int eventType = parser.getEventType(); while (!(eventType == END_TAG && parser.getName().equals("Point"))) { if (eventType == START_TAG && parser.getName().equals("coordinates")) { latLngAlt = convertToLatLngAlt(parser.nextText()); } eventType = parser.next(); } return new KmlPoint(latLngAlt.latLng, latLngAlt.altitude); }
public void testGetKmlGeometryObject() throws Exception { kmlPoint = createSimplePoint(); assertNotNull(kmlPoint); assertNotNull(kmlPoint.getGeometryObject()); assertEquals(kmlPoint.getGeometryObject().latitude, 0.0); assertEquals(kmlPoint.getGeometryObject().longitude, 50.0); }
public void testGetType() throws Exception { kmlPoint = createSimplePoint(); assertNotNull(kmlPoint); assertNotNull(kmlPoint.getGeometryType()); assertEquals("Point", kmlPoint.getGeometryType()); }
public void testPointAltitude() throws Exception { //test point without altitude kmlPoint = createSimplePoint(); assertNotNull(kmlPoint); assertNull(kmlPoint.getAltitude()); //test point with altitude kmlPoint = createSimplePointWithAltitudes(); assertNotNull(kmlPoint); assertNotNull(kmlPoint.getAltitude()); assertEquals(kmlPoint.getAltitude(), 100.0); } }
public KmlPoint createSimplePointWithAltitudes() { LatLng coordinates = new LatLng(0, 50); Double altitude = new Double(100); return new KmlPoint(coordinates, altitude); }
public KmlPoint createSimplePoint() { LatLng coordinates = new LatLng(0, 50); return new KmlPoint(coordinates); }