Package aimax.osm.data.entities

Examples of aimax.osm.data.entities.MapNode


  /**
   * {@inheritDoc}
   */
  @Override
  public MapNode getNearestWayNode(Position pos, MapWayFilter filter) {
    MapNode node = pos.selectNearest(nodes.values(), filter);
    return node;
  }
View Full Code Here


  public MapNode addMarker(float lat, float lon) {
    long id = 1;
    for (MapNode node : markers)
      if (node.getId() >= id)
        id = node.getId() + 1;
    MapNode node = new DefaultMapNode(id);
    node.setName(Long.toString(id));
    List<EntityAttribute> atts = new ArrayList<EntityAttribute>(1);
    atts.add(new EntityAttribute("marker", "yes"));
    node.setAttributes(atts);
    node.setPosition(lat, lon);
    updateEntityViewInfo(node, false);
    markers.add(node);
    fireMapDataEvent(new MapEvent(this, MapEvent.Type.MARKER_ADDED, node
        .getId()));
    return node;
  }
View Full Code Here

            iResults.remove(99);
        }
        nextRadius = -1;
      }
      if (iResults.size() == 1 && wayName != null) {
        MapNode place = (MapNode) iResults.get(0);
        findWay(wayName, new Position(place.getLat(), place.getLon()),
            null);
      }
     
    } else {
      nextRadius *= 2;
View Full Code Here

    return trkpts;
  }
 
  @Override
  public MapNode getLastNode() {
    MapNode result = null;
    if (!trkpts.isEmpty())
      result = trkpts.get(trkpts.size()-1);
    return result;
  }
View Full Code Here

 
  @Override
  public void addNode(Position pos) {
    int idx = trkpts.isEmpty()
    ? 0 : (int) trkpts.get(trkpts.size()-1).getId()+1;
    MapNode node = new DefaultMapNode(idx);
    node.setPosition(pos.getLat(), pos.getLon());
    addNode(node);
  }
View Full Code Here

      return 0;
    }
  }
 
  private DefaultMapEntity getTrkPt(int i) {
    MapNode result = trkpts.get(i);
    if (result instanceof DefaultMapNode)
      return (DefaultMapEntity) result;
      else
    return null;
  }
View Full Code Here

  }

  /** {@inheritDoc} */
  @Override
  public boolean isNodeDefined(long id, BoundingBox bb) {
    MapNode node = result.getNode(id);
    boolean result = (node != null && node.hasPosition());
    if (result && bb != null)
      result = bb.isInside(node.getLat(), node.getLon());
    return result;
  }
View Full Code Here

  }
 
  /** {@inheritDoc} */
  @Override
  public boolean isNodeReferenced(long id) {
    MapNode node = result.getNode(id);
    return node != null && !node.getWayRefs().isEmpty();
  }
View Full Code Here

      logger.log("Error: Please set two marks with mouse-left.");
      return;
    }
    String[] locs = new String[marks.size()];
    for (int i = 0; i < marks.size(); i++) {
      MapNode node = marks.get(i);
      Point2D pt = new Point2D(node.getLon(), node.getLat());
      locs[i] = map.getNearestLocation(pt);
    }
    heuristic.adaptToGoal(locs[1], map);
    Agent agent = null;
    MapAgentFrame.SelectionState state = frame.getSelection();
View Full Code Here

    }
  }

  private void updateTrack(Agent agent, String location) {
    MapAdapter map = (MapAdapter) getMapEnv().getMap();
    MapNode node = map.getWayNode(location);
    if (node != null) {
      int aIdx = getMapEnv().getAgents().indexOf(agent);
      map.getOsmMap().addToTrack(TRACK_NAME + aIdx,
          new Position(node.getLat(), node.getLon()));
    }
  }
View Full Code Here

TOP

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

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.