Package net.sf.myway.base.db

Examples of net.sf.myway.base.db.Angle


    monitor.worked(1);
    final Region r = new Region();
    final double a = d / 60.0;
    final BoundingBox bb = new BoundingBox();
    r.setBoundingBox(bb);
    bb.setNorth(new Angle(scannedMap.getNorth().getVal() + a));
    bb.setSouth(new Angle(scannedMap.getSouth().getVal() - a));
    bb.setWest(new Angle(scannedMap.getWest().getVal() - a));
    bb.setEast(new Angle(scannedMap.getEast().getVal() + a));
    r.setName(scannedMap.getName());
    if (!_selection.isEmpty() && _selection instanceof IStructuredSelection) {
      final Object f = ((IStructuredSelection) _selection).getFirstElement();
      if (f instanceof Region)
        r.setParent((Region) f);
View Full Code Here


  /**
   * Calculate the box which contains all points of the object.
   */
  public void calcBoundingBox() {
    final Angle north = new Angle(_center.getNode().getLatitude().getVal());
    final Angle south = new Angle(_center.getNode().getLatitude().getVal());
    final Angle east = new Angle(_center.getNode().getLongitude().getVal());
    final Angle west = new Angle(_center.getNode().getLongitude().getVal());
    for (final MapNodeRef ref : _nodes) {
      final MapNode node = ref.getNode();
      if (north.getVal() < node.getLatitude().getVal())
        north.setVal(node.getLatitude().getVal());
      if (south.getVal() > node.getLatitude().getVal())
        south.setVal(node.getLatitude().getVal());
      if (east.getVal() < node.getLongitude().getVal())
        east.setVal(node.getLongitude().getVal());
      if (west.getVal() > node.getLongitude().getVal())
        west.setVal(node.getLongitude().getVal());
    }
    _boundingBox = new BoundingBox(north, south, west, east);
  }
View Full Code Here

      final double longMax = _lon + EDGE_LEN * _lonInc;
      final double latMax = _lat - EDGE_LEN * _latInc;
      final List<MapObject> all = MapPlugin.getBL().getObjects(
        new BoundingBox(latMax, _lat, _lon, longMax));
      _mapObjects = all == null ? new ArrayList<MapObject>() : new ArrayList<MapObject>(all);
      _log.info("fetch objects for " + new Angle(_lon) + "[" + _lon + "] "
        + new Angle(longMax) + "[" + longMax + "] " + new Angle(latMax) + "[" + latMax
        + "] " + new Angle(_lat) + "[" + _lat + "] Anzahl Objekte: " + all.size());
      // TODO Objekte klassifizieren und auf layers aufteilen.
      // fireCellChanged();
    }
    return _mapObjects;
  }
View Full Code Here

        final List<MapNodeRef> nodes = mo.getNodes();
        boolean first = true;
        final String wayName = mo.getName();
        final Path path = new Path(display);
        for (final MapNodeRef node : nodes) {
          final Angle lat = node.getNode().getLatitude();
          final Angle lon = node.getNode().getLongitude();
          final int x = (int) ((lon.getVal() - cm.getLon()) / cm.getLonInc());
          final int y = (int) ((cm.getLat() - lat.getVal()) / cm.getLatInc());
          if (first)
            path.moveTo(x, y);
          else
            path.lineTo(x, y);
          first = false;
        }
        gc.setForeground(black);
        gc.setLineWidth(5);
        gc.drawPath(path);
      }
      // Dann alle einzelnen Knoten malen, damit diese oben sind
      for (final MapObject mo : obj)
        for (final MapNodeRef r : mo.getNodes()) {
          final Angle lat = r.getNode().getLatitude();
          final Angle lon = r.getNode().getLongitude();
          final int x = (int) ((lon.getVal() - cm.getLon()) / cm.getLonInc());
          // int y = (int) (CellModel.EDGE_LEN - (lat.getVal() - cm.getLat())
          // / cm.getLatInc());
          final int y = (int) ((cm.getLat() - lat.getVal()) / cm.getLatInc());
          if (mo.equals(selO)) {
            gc.setBackground(high);
View Full Code Here

        n = nf.parse(s, pos);
        sec = n.doubleValue() / 3600.0;
        pos.setIndex(source.length());
      }
    }
    return new Angle(degree + min + sec);
  }
View Full Code Here

        n = nf.parse(s, pos);
        sec = n.doubleValue() / 3600.0;
        pos.setIndex(source.length());
      }
    }
    return new Angle(degree + min + sec);
  }
View Full Code Here

    throws ParseException {
    final MapNode n = new MapNode();
    final String osmId = node.attributeValue("id");
    lookup.put(osmId, n);
    n.addExtRef(SYSTEM_ID, osmId);
    n.setLatitude(new Angle(Double.parseDouble(node.attributeValue("lat"))));
    n.setLongitude(new Angle(Double.parseDouble(node.attributeValue("lon"))));
    n.setUser(node.attributeValue("user"));
    final String t = node.attributeValue("timestamp");
    final Date ts = parseTimestamp(t);
    final Calendar cal = Calendar.getInstance();
    cal.setTime(ts);
View Full Code Here

TOP

Related Classes of net.sf.myway.base.db.Angle

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.