Package org.openstreetmap.osmosis.core.container.v0_6

Examples of org.openstreetmap.osmosis.core.container.v0_6.WayContainer


    testWay = new Way(new CommonEntityData(3456, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0));
    testWay.getWayNodes().add(new WayNode(1234));
    testWay.getWayNodes().add(new WayNode(1235));
    testWay.getTags().add(new Tag("test_key1", "test_value1"));
   
    testOsmWriter.process(new WayContainer(testWay));
    testOsmWriter.process(new BoundContainer(new Bound("source")));
  }
View Full Code Here


   * @param wayContainer
   *            Way to be sent.
   */
  private void emitWay(WayContainer wayContainer) {
    if (clipIncompleteEntities) {
      WayContainer filteredWayContainer;
      Way filteredWay;
     
      filteredWayContainer = wayContainer.getWriteableInstance();
      filteredWay = filteredWayContainer.getEntity();
     
      // Remove node references for nodes that are unavailable.
      for (Iterator<WayNode> i = filteredWay.getWayNodes().iterator(); i.hasNext();) {
        WayNode nodeReference = i.next();
       
View Full Code Here

    private void pumpWaysToSink() {
      ReleasableIterator<WayContainer> i = allWays.iterate();
     
      try {
        while (i.hasNext()) {
        WayContainer wayContainer = i.next();
        if (availableWays.get(wayContainer.getEntity().getId())) {
          emitWay(wayContainer);
        }
      }
       
      } finally {
View Full Code Here

    public EntityContainer next() {
      if (nodeIds.hasNext()) {
        return new NodeContainer(getNode(nodeIds.next()));
      }
      if (wayIds.hasNext()) {
        return new WayContainer(getWay(wayIds.next()));
      }
      if (relationIds.hasNext()) {
        return new RelationContainer(getRelation(relationIds.next()));
      }
     
View Full Code Here

    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);

    tags = Arrays.asList(new Tag("highway", "residential"), new Tag("Ckey", "Cvalue"));
    residentialWay =
      new Way(new CommonEntityData(2202, 0, new Date(), user, 0, tags), new ArrayList<WayNode>());
    residentialWayContainer = new WayContainer(residentialWay);

    tags = Arrays.asList(new Tag("Dkey", "Dvalue"));
    testRelation =
      new Relation(new CommonEntityData(3301, 0, new Date(), user, 0, tags), new ArrayList<RelationMember>());
    testRelationContainer = new RelationContainer(testRelation);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  protected EntityContainerFactory<Way> getContainerFactory() {
    return new WayContainerFactory();
  }
View Full Code Here

    sources.add(new UpcastIterator<EntityContainer, BoundContainer>(
        new BoundContainerIterator(new ReleasableAdaptorForIterator<Bound>(bounds.iterator()))));
    sources.add(new UpcastIterator<EntityContainer, NodeContainer>(
        new NodeContainerIterator(nodeDao.iterate())));
    sources.add(new UpcastIterator<EntityContainer, WayContainer>(
        new WayContainerIterator(wayDao.iterate())));
    sources.add(new UpcastIterator<EntityContainer, RelationContainer>(
        new RelationContainerIterator(relationDao.iterate())));
   
    return new MultipleSourceIterator<EntityContainer>(sources);
  }
View Full Code Here

    resultSets.add(
        new UpcastIterator<EntityContainer, NodeContainer>(
            new NodeContainerIterator(nodeDao.iterate("bbox_"))));
    resultSets.add(
        new UpcastIterator<EntityContainer, WayContainer>(
            new WayContainerIterator(wayDao.iterate("bbox_"))));
    resultSets.add(
        new UpcastIterator<EntityContainer, RelationContainer>(
            new RelationContainerIterator(relationDao.iterate("bbox_"))));
   
    // Merge all readers into a single result iterator and return.     
View Full Code Here

    sources.add(new UpcastIterator<EntityContainer, BoundContainer>(
        new BoundContainerIterator(new ReleasableAdaptorForIterator<Bound>(bounds.iterator()))));
    sources.add(new UpcastIterator<EntityContainer, NodeContainer>(
        new NodeContainerIterator(nodeDao.iterate())));
    sources.add(new UpcastIterator<EntityContainer, WayContainer>(
        new WayContainerIterator(wayDao.iterate())));
    sources.add(new UpcastIterator<EntityContainer, RelationContainer>(
        new RelationContainerIterator(relationDao.iterate())));
   
    return new MultipleSourceIterator<EntityContainer>(sources);
  }
View Full Code Here

      resultSets.add(
          new UpcastIterator<EntityContainer, NodeContainer>(
              new NodeContainerIterator(new NodeReader(dbCtx, "box_node_list"))));
      resultSets.add(
          new UpcastIterator<EntityContainer, WayContainer>(
              new WayContainerIterator(new WayReader(dbCtx, "box_way_list"))));
      resultSets.add(
          new UpcastIterator<EntityContainer, RelationContainer>(
              new RelationContainerIterator(new RelationReader(dbCtx, "box_relation_list"))));
     
      // Merge all readers into a single result iterator and return.     
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.core.container.v0_6.WayContainer

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.