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

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


   
    testRelation = new Relation(new CommonEntityData(3456, 0, new Date(), new OsmUser(12, "OsmosisTest"), 0));
    testRelation.getMembers().add(new RelationMember(1234, EntityType.Node, "role1"));
    testRelation.getTags().add(new Tag("test_key1", "test_value1"));
   
    testOsmWriter.process(new RelationContainer(testRelation));
    testOsmWriter.process(new BoundContainer(new Bound("source")));
  }
View Full Code Here


   * @param relationContainer
   *            Relation to be sent.
   */
  private void emitRelation(RelationContainer relationContainer) {
      if (clipIncompleteEntities) {
        RelationContainer filteredRelationContainer;
        Relation filteredRelation;
       
        filteredRelationContainer = relationContainer.getWriteableInstance();
        filteredRelation = filteredRelationContainer.getEntity();
       
        // Remove members for entities that are unavailable.
        for (Iterator<RelationMember> i = filteredRelation.getMembers().iterator(); i.hasNext();) {
          RelationMember member = i.next();
          EntityType memberType;
View Full Code Here

    private void pumpRelationsToSink() {
      ReleasableIterator<RelationContainer> i = allRelations.iterate();
     
      try {
        while (i.hasNext()) {
        RelationContainer relationContainer = i.next();
        if (availableRelations.get(relationContainer.getEntity().getId())) {
          emitRelation(relationContainer);
        }
      }
       
      } finally {
View Full Code Here

      }
      if (wayIds.hasNext()) {
        return new WayContainer(getWay(wayIds.next()));
      }
      if (relationIds.hasNext()) {
        return new RelationContainer(getRelation(relationIds.next()));
      }
     
      throw new NoSuchElementException();
    }
View Full Code Here

    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<Relation> getContainerFactory() {
    return new RelationContainerFactory();
  }
View Full Code Here

    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, 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.     
    return new MultipleSourceIterator<EntityContainer>(resultSets);
  }
View Full Code Here

    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, 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.     
      return new MultipleSourceIterator<EntityContainer>(resultSets);
     
    } catch (SQLException e) {
View Full Code Here

TOP

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

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.