Location removeAltitude - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Location removeAltitude method.

This code example shows how to use the following methods:removeAltitude, setLatitude, setLongitude
   * Tests {@link SendFusionTablesUtils#appendLocation(Location, StringBuilder)} 
   * with no altitude. 
   */ 
  public void testAppendLocation_no_altitude() { 
    StringBuilder builder = new StringBuilder();
    Location location = new Location("test");
    location.setLongitude(10.1);
    location.setLatitude(20.2);
    location.removeAltitude();
    SendFusionTablesUtils.appendLocation(location, builder);
    assertEquals("10.1,20.2", builder.toString());
  } 
 
  /** 
   * Tests {@link SendFusionTablesUtils#appendLocation(Location, StringBuilder)} 
   * with altitude. 
   */ 
  public void testAppendLocation_has_altitude() { 
    StringBuilder builder = new StringBuilder();
    Location location = new Location("test");
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getAccuracy, getLatitude, getLongitude, removeAltitude, removeBearing
     * <p>Second we snap-to-grid (quantize). This has the nice property of 
     * producing stable results, and mitigating against taking many samples 
     * to average out a random offset. 
     */ 
    private Location createCoarseLocked(Location fine) {
        Location coarse = new Location(fine);
 
        // clean all the optional information off the location, because 
        // this can leak detailed location information 
        coarse.removeBearing();
        coarse.removeSpeed();
        coarse.removeAltitude();
        coarse.setExtras(null);
 
        double lat = coarse.getLatitude();
        double lon = coarse.getLongitude();
 
        // wrap 
        lat = wrapLatitude(lat);
        lon = wrapLongitude(lon);

4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
removeAltitude Method Overview
Remove the altitude from this location.
See Code Examples for other Android Location Methods: