Package org.openstreetmap.osmosis.core.domain.v0_6

Examples of org.openstreetmap.osmosis.core.domain.v0_6.Node


    tilesFound = false;
    minimumTile = 0;
    maximumTile = 0;
    for (WayNode wayNode : way.getWayNodes()) {
      long nodeId;
      Node node;
      int tile;
     
      nodeId = wayNode.getNodeId();
     
      try {
      node = nodeObjectReader.get(
        nodeObjectOffsetIndexReader.get(nodeId).getValue()
      );
     
      tile = (int) tileCalculator.calculateTile(node.getLatitude(), node.getLongitude());
     
      if (tilesFound) {
        if (uintComparator.compare(tile, minimumTile) < 0) {
          minimumTile = tile;
        }
View Full Code Here


 
  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer container) {
    Node node;
   
    node = container.getEntity();
   
    // Check if we're storing entities for later.
    if (storeEntities) {
      allNodes.add(container);
    }
   
    // Only add the node if it lies within the box boundaries.
    if (isNodeWithinArea(node)) {
      availableNodes.set(node.getId());
     
      // If we're not storing entities, we pass it on immediately.
      if (!storeEntities) {
        emitNode(container);
      }
View Full Code Here

   */
  @Test
  public final void testProcess3() {
    testOsmWriter.process(
        new NodeContainer(
          new Node(
            new CommonEntityData(
                1234, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0, new ArrayList<Tag>()),
            20, 20)));
    // Nothing to assert; just expect no exception
  }
View Full Code Here

   * Test processing a Bound after a Node.
   */
  @Test(expected = OsmosisRuntimeException.class)
  public final void testProcess4() {
    testOsmWriter.process(new NodeContainer(
        new Node(
            new CommonEntityData(1234, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0,
                new ArrayList<Tag>()),
            20, 20)));
    testOsmWriter.process(new BoundContainer(new Bound("source")));
    fail("Expected to throw an exception.");
View Full Code Here

      Point point;
     
      geom = (PGgeometry) resultSet.getObject("geom");
      point = (Point) geom.getGeometry();
     
      return new Node(
        new CommonEntityData(
          resultSet.getLong("id"),
          resultSet.getInt("version"),
          new Date(resultSet.getTimestamp("tstamp").getTime()),
          buildUser(resultSet),
View Full Code Here

      }
    }
   
    // Now we need to check if any of the segments cross the box.
    for (int i = 0; i < nodes.size() - 1; i++) {
      Node nodeA;
      Node nodeB;
     
      nodeA = nodes.get(i);
      nodeB = nodes.get(i + 1);
     
      if (boundingBox.intersectsLine(nodeA.getLongitude(), nodeA.getLatitude(), nodeB.getLongitude(),
          nodeB.getLatitude())) {
        return true;
      }
    }
   
    return false;
View Full Code Here

    }
   
    // Check to see whether each applicable node lies within the bounding
    // box and add them to the result id list if they are.
    for (long nodeId : idTracker) {
      Node node = getNode(nodeId);
     
      // Determine if the node lies within the required bounding box.
      if (isNodeInsideBox(bboxCtx.boundingBox, node)) {
        bboxCtx.nodeIdTracker.set(nodeId);
      }
View Full Code Here

    List<Tag> tags;
   
    user = new OsmUser(12, "OsmosisTest");
     
    tags = Arrays.asList(new Tag("amenity", "bank"), new Tag("Akey", "Avalue"));
    amenityNode = new Node(new CommonEntityData(1101, 0, new Date(), user, 0, tags), 1, 2);
    amenityNodeContainer = new NodeContainer(amenityNode);

    tags = new ArrayList<Tag>();
    taglessNode = new Node(new CommonEntityData(1102, 0, new Date(), user, 0, tags), 3, 4);
    taglessNodeContainer = new NodeContainer(taglessNode);

    tags = Arrays.asList(new Tag("highway", "motorway"), new Tag("Bkey", "Bvalue"));
    motorwayWay = new Way(new CommonEntityData(2201, 0, new Date(), user, 0, tags), new ArrayList<WayNode>());
    motorwayWayContainer = new WayContainer(motorwayWay);
View Full Code Here

  private class Writer implements Runnable {
    private Node node;
    private NodeContainer nodeContainer;

    public Writer() {
      node = new Node(new CommonEntityData(1, 2, new Date(), OsmUser.NONE, 3), 10, 10);
      nodeContainer = new NodeContainer(node);
    }
View Full Code Here

            }
          }
          continue;
        }

        Node node = (Node)inode;
        if(node.getIndex() != index) continue;
        Attribute [] attrs = inode.getAttributes();
        if(attrs == null || attrs.length < 1) {
          list.add(item);
        } else {
          String data = (String)item.getData();
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.core.domain.v0_6.Node

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.