Package aimax.osm.data.entities

Examples of aimax.osm.data.entities.MapWay


    List<String> result = new ArrayList<String>();
    MapNode node = getWayNode(fromLocation);
    if (node != null) {
      for (WayRef wref : node.getWayRefs()) {
        if (filter == null || filter.isAccepted(wref.getWay())) {
          MapWay way = wref.getWay();
          int nodeIdx = wref.getNodeIdx();
          List<MapNode> wayNodes = way.getNodes();
          MapNode next;
          if (wayNodes.size() > nodeIdx + 1) {
            next = wayNodes.get(nodeIdx + 1);
            result.add(Long.toString(next.getId()));
          }
          if (nodeIdx > 0 && (!way.isOneway() || ignoreOneways)) {
            next = wayNodes.get(nodeIdx - 1);
            result.add(Long.toString(next.getId()));
          }
        }
      }
View Full Code Here


  public double getDistKM(MapEntity entity) {
    if (entity instanceof MapNode) {
      return getDistKM(lat, lon, ((MapNode) entity).getLat(),
          ((MapNode) entity).getLon());
    } else if (entity instanceof MapWay) {
      MapWay way = (MapWay) entity;
      BoundingBox bb = way.computeBoundingBox();
      float bbLat = (Math.abs(lat - bb.getLatMin()) < Math.abs(lat
          - bb.getLatMax())) ? bb.getLatMin() : bb.getLatMax();
      float bbLon = (Math.abs(lon - bb.getLonMin()) < Math.abs(lon
          - bb.getLonMax())) ? bb.getLonMin() : bb.getLonMax();
      return getDistKM(lat, lon, bbLat, bbLon);
View Full Code Here

  public Set<Action> actions(Object s) {
    Set<Action> result = new LinkedHashSet<Action>();
    MapNode from = (MapNode) s;
    for (WayRef wref : from.getWayRefs()) {
      if (filter == null || filter.isAccepted(wref.getWay())) {
        MapWay way = wref.getWay();
        int nodeIdx = wref.getNodeIdx();
        List<MapNode> wayNodes = way.getNodes();
        MapNode to;
        for (int idx = nodeIdx + 1; idx < wayNodes.size(); idx++) {
          to = wayNodes.get(idx);
          if (goal == null || goal == to
              || to.getWayRefs().size() > 1
              || idx == wayNodes.size() - 1) {
            result.add(new OsmMoveAction(way, from, to));
            break;
          }
        }
        if (!way.isOneway() || ignoreOneWays) {
          for (int idx = nodeIdx - 1; idx >= 0; idx--) {
            to = wayNodes.get(idx);
            if (goal == null || goal == to
                || to.getWayRefs().size() > 1 || idx == 0) {
              result.add(new OsmMoveAction(way, from, to));
View Full Code Here

TOP

Related Classes of aimax.osm.data.entities.MapWay

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.