Package aimax.osm.data

Examples of aimax.osm.data.BoundingBox


   */
  @Override
  protected void find(boolean findMore) {
    BestMatchFinder bmf = new BestMatchFinder(pattern);
    List<MapEntity> results = getResults();
    BoundingBox bb = new BoundingBox(position, nextRadius);
    if (!results.isEmpty())
      bmf.checkMatchQuality(results.get(0));
    if (mode.equals(Mode.ENTITY) || mode.equals(Mode.NODE)) {
      for (MapNode node : getStorage().getPois(bb)) {
        int match = bmf.checkMatchQuality(node);
View Full Code Here


 
  /** {@inheritDoc} */
  @Override
  public BoundingBox computeBoundingBox() {
    updateBoundingBox();
    return new BoundingBox(nodes.get(latMinIdx).getLat(),
        nodes.get(lonMinIdx).getLon(), nodes.get(latMaxIdx).getLat(),
        nodes.get(lonMaxIdx).getLon());
  }
View Full Code Here

    if (children == null) {
      entities.add(entity);
      isSorted = false;
      if (entities.size() > maxEntities && depth < maxDepth) {
        computeSplitValues();
        BoundingBox c1bb;
        BoundingBox c2bb;
        if (splitAtLat) {
          c1bb = new BoundingBox
          (bb.getLatMin(), bb.getLonMin(), splitValue, bb.getLonMax());
          c2bb = new BoundingBox
          (splitValue, bb.getLonMin(), bb.getLatMax(), bb.getLonMax());
        } else {
          c1bb = new BoundingBox
          (bb.getLatMin(), bb.getLonMin(), bb.getLatMax(), splitValue);
          c2bb = new BoundingBox
          (bb.getLatMin(), splitValue, bb.getLatMax(), bb.getLonMax());
        }
        children = new KDTree[2];
        children[0] = new KDTree(c1bb, maxEntities, maxDepth, depth+1);
        children[1] = new KDTree(c2bb, maxEntities, maxDepth, depth+1);
View Full Code Here

      }
    }
    for (long id : toDelete) {
      nodes.remove(id);
    }
    BoundingBox bbAllNodes = new BoundingBox();
    bbAllNodes.adjust(nodes.values());
    bbAllNodes.adjust(pois);
    if (boundingBox == null)
      boundingBox = bbAllNodes;
    else
      boundingBox.intersectWith(bbAllNodes);
    applyClassifierAndUpdateTree(bbAllNodes);
View Full Code Here

  /** {@inheritDoc} Very expensive for large maps! */
  @Override
  public List<String> getLocations() {
    List<String> result = new ArrayList<String>();
    HashSet<MapNode> nodeHash = new HashSet<MapNode>();
    for (MapWay way : osmMap.getWays(new BoundingBox(-90, -180, 90, 180))) {
      if (filter == null || filter.isAccepted(way)) {
        for (MapNode node : way.getNodes())
          if (!nodeHash.contains(node)) {
            result.add(Long.toString(node.getId()));
            nodeHash.add(node);
View Full Code Here

    }
    origin = attributes.getValue(ATTRIBUTE_NAME_ORIGIN);
    if (origin == null || origin.equals("")) {
      throw new OsmRuntimeException("Origin attribute of bound element is empty or missing.");
    }
    bb = new BoundingBox(bottom, left, top, right);
  }
View Full Code Here

  public BoundingBox getBoundingBox() {
    float latMin = transformer.lat(getHeight());
    float lonMin = transformer.lon(0);
    float latMax = transformer.lat(0);
    float lonMax = transformer.lon(getWidth());
    return new BoundingBox(latMin, lonMin, latMax, lonMax);
  }
View Full Code Here

      float latMin = transformer.lat(getHeight());
      float lonMin = transformer.lon(0);
      float latMax = transformer.lat(0);
      float lonMax = transformer.lon(getWidth());
      float scale = transformer.computeScale();
      BoundingBox vbox = new BoundingBox(latMin, lonMin, latMax, lonMax);
      float viewScale = scale / renderer.getDisplayFactor();
      renderer.initForRendering(g2, transformer, map);
      map.visitEntities(renderer, vbox, viewScale);
      for (MapEntity entity : map.getVisibleMarkersAndTracks(viewScale))
        entity.accept(renderer);
View Full Code Here

      fileChooser.setDialogTitle(title);
      int returnVal = fileChooser.showDialog(this, "Load");
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        if ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0) {
          // ctrl+load -> ask the user for a bounding box.
          BoundingBox bb = askForBoundingBox();
          if (bb != null)
            mapReader.setFilter(bb);
          else
            return;
        }
View Full Code Here

      showSidebar(sidebarCheckBox.isSelected());
    }
  }

  protected BoundingBox askForBoundingBox() {
    BoundingBox result = null;
    JTextField minLat = new JTextField("-90");
    JTextField minLon = new JTextField("-180");
    JTextField maxLat = new JTextField("90");
    JTextField maxLon = new JTextField("180");
    if (getMap().getMarkers().size() == 2) {
      MapNode m1 = getMap().getMarkers().get(0);
      MapNode m2 = getMap().getMarkers().get(1);
      minLat.setText(Float.toString(Math.min(m1.getLat(), m2.getLat())));
      minLon.setText(Float.toString(Math.min(m1.getLon(), m2.getLon())));
      maxLat.setText(Float.toString(Math.max(m1.getLat(), m2.getLat())));
      maxLon.setText(Float.toString(Math.max(m1.getLon(), m2.getLon())));
    }
    Object[] content = new Object[] { "Min Latitude:", minLat,
        "Min Longitude:", minLon, "Max Latitude:", maxLat,
        "Max Longitude:", maxLon, };
    boolean done;
    do {
      done = true;
      if (JOptionPane.showConfirmDialog(this, content,
          "Specify Bounding Box", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
        try {
          result = new BoundingBox(
              Float.parseFloat(minLat.getText()), Float
                  .parseFloat(minLon.getText()), Float
                  .parseFloat(maxLat.getText()), Float
                  .parseFloat(maxLon.getText()));
        } catch (NumberFormatException e) {
View Full Code Here

TOP

Related Classes of aimax.osm.data.BoundingBox

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.