Package de.fhpotsdam.unfolding.geo

Examples of de.fhpotsdam.unfolding.geo.Location


      XML lonXML = itemXML[i].getChild("geo:long");
      if (latXML != null && latXML.getContent() != null) {
        float lat = Float.valueOf(latXML.getContent());
        float lon = Float.valueOf(lonXML.getContent());

        Location location = new Location(lat, lon);
        PointFeature pointFeature = new PointFeature(location);
        features.add(pointFeature);

        // Sets title if existing
        XML titleXML = itemXML[i].getChild("title");
View Full Code Here


        String point = pointXML.getContent();
        String[] latLon = point.split(" ");
        float lat = Float.valueOf(latLon[0]);
        float lon = Float.valueOf(latLon[1]);

        Location location = new Location(lat, lon);
        PointFeature pointFeature = new PointFeature(location);
        features.add(pointFeature);

        // Sets title if existing
        XML titleXML = itemXML[i].getChild("title");
View Full Code Here

    // Load GPX file
    XML gpx = p.loadXML(gpxFilename);

    Calendar prevTime = null;
    Location prevLocation = null;

    // Create track with all track points
    ShapeFeature trackFeature = new ShapeFeature(FeatureType.LINES);
    List<Double> speedList = new ArrayList<Double>();

    XML[] itemXML = gpx.getChildren("trk/trkseg/trkpt");
    for (int i = 0; i < itemXML.length; i++) {

      // Adds location for track point
      float lat = itemXML[i].getFloat("lat");
      float lon = itemXML[i].getFloat("lon");
      Location location = new Location(lat, lon);

      // Calculates speed for track point
      // Uses time span (h) and distance (km) to previous point to get km/h
      double speed = 0;
      try {
View Full Code Here

  public void mouseClicked() {
    kiteConnection.setDetailPosition(mouseX, mouseY);

    // Read geo location of the mouse position from the background map
    Location locationOnStaticMap = mapStatic.mapDisplay.getLocationFromScreenPosition(mouseX, mouseY);
    // Pan the small map toward that location
    mapZoom.panTo(locationOnStaticMap);
  }
View Full Code Here

    //size(800, 600);
    smooth();

    map = new UnfoldingMap(this);
    map.zoomToLevel(3);
    map.panTo(new Location(40f, -98f));
    MapUtils.createDefaultEventDispatcher(this, map);

    Location berlinLocation = new Location(40f, -98f);
    berlinMarker = new TestMarker(berlinLocation);
    berlinMarker.setColor(color(255, 0, 0, 100));
    berlinMarker.setStrokeColor(color(255, 0, 0));
    berlinMarker.setStrokeWeight(2);
    map.addMarkers(berlinMarker);
View Full Code Here

  public void setup() {
    size(800, 600);

    map = new UnfoldingMap(this);
    Location location = new Location(52.52, 13.38);

    Coordinate coord = map.mapDisplay.getMapProvider().locationCoordinate(location).zoomTo(14);
    String quadKey = Microsoft.toQuadKey(coord);
    println("QuadKey: " + quadKey + " for location: " + location);
View Full Code Here

    String polyline5Digits = "galqHisis@gA}@pBsHuAaB}CgAyI_P@IKa@tDoG";
    String polyline6Digits = "ouaw~AcjijObM~F~Ocs@~DwTbAoF`B_Ekv@}`AqEcFaFoD}GqBmTqBgEyBuCiF{JeX_KgUyUq\\eo@ueA}G{MXqBc@iFuAkBv@}EbL}R~h@my@";

    List<Location> locations = GeoUtils.decodePolyline(polyline5Digits, 5);
    Location locationA = locations.get(0);
    println("First location of 5 digits array " + locationA + " is "
        + ((locationA.getLat() == 50.20196f && locationA.getLon() == 8.57413f) ? " ok" : " not ok"));

    locations = GeoUtils.decodePolyline(polyline6Digits, 6);
    Location locationB = locations.get(0);
    println("First location of 6 digits array " + locationB + " is "
        + ((locationB.getLat() == 50.20196f && locationB.getLon() == 8.57413f) ? " ok" : " not ok"));
  }
View Full Code Here

  }

  private List<Dot> createRandomDots(int dotNumbers) {
    List<Dot> dots = new ArrayList<Dot>();
    for (int i = 0; i < dotNumbers; i++) {
      Dot dot = new Dot(new Location(random(-85, 85), random(-180, 180)), new Date());
      dots.add(dot);
    }
    return dots;
  }
View Full Code Here

  }

  public List<Dot> createRandomDots(int dotNumbers) {
    List<Dot> dots = new ArrayList<Dot>();
    for (int i = 0; i < dotNumbers; i++) {
      Dot dot = new Dot(new Location(random(-85, 85), random(-180, 180)), new Date());
      dots.add(dot);
    }
    return dots;
  }
View Full Code Here

  }

  private List<Dot> createRandomDots(int dotNumbers) {
    List<Dot> dots = new ArrayList<Dot>();
    for (int i = 0; i < dotNumbers; i++) {
      Dot dot = new Dot(new Location(random(-85, 85), random(-180, 180)), new Date());
      dots.add(dot);
    }
    return dots;
  }
View Full Code Here

TOP

Related Classes of de.fhpotsdam.unfolding.geo.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.