org.openstreetmap.osmosis.core.domain.v0_6.Relation.getMembers()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.openstreetmap.osmosis.core.domain.v0_6.Relation.getMembers方法的一些代码示例,展示了Relation.getMembers的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relation.getMembers方法的具体详情如下:
包路径:org.openstreetmap.osmosis.core.domain.v0_6.Relation
类名称:Relation
方法名:getMembers

Relation.getMembers介绍

[英]Returns the attached list of relation members. The returned list is read-only.
[中]返回附加的关系成员列表。返回的列表是只读的。

代码示例

代码示例来源:origin: mapsforge/mapsforge

for (RelationMember relationMember : relation.getMembers()) {
  if (relationMember.getMemberType().equals(EntityType.Way)
      && "outer".equalsIgnoreCase(relationMember.getMemberRole())) {
    + " #Members: " + relation.getMembers().size()
    + " #Segments: " + bounds.size());

代码示例来源:origin: mapsforge/mapsforge

if (relation.getMembers().isEmpty()) {
  return null;
List<RelationMember> members = relation.getMembers();
List<TDWay> wayMembers = new ArrayList<>();
for (RelationMember relationMember : members) {

代码示例来源:origin: openstreetmap/osmosis

/**
   * {@inheritDoc}
   */
  @Override
  public Collection<RelationMember> getFeatureCollection(Relation entity) {
    return entity.getMembers();
  }
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core

/**
   * {@inheritDoc}
   */
  @Override
  public Collection<RelationMember> getFeatureCollection(Relation entity) {
    return entity.getMembers();
  }
}

代码示例来源:origin: openstreetmap/osmosis

/**
   * This is called by child element processors when a way node object is
   * encountered.
   * 
   * @param relationMember
   *            The wayNode to be processed.
   */
  public void processRelationMember(RelationMember relationMember) {
    relation.getMembers().add(relationMember);
  }
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-xml

/**
   * This is called by child element processors when a way node object is
   * encountered.
   * 
   * @param relationMember
   *            The wayNode to be processed.
   */
  public void processRelationMember(RelationMember relationMember) {
    relation.getMembers().add(relationMember);
  }
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
@Override
protected void loadFeatures(long entityId, Relation entity) {
  entity.getMembers().addAll(relationMemberDao.getAllRaw(entityId));
}

代码示例来源:origin: openstreetmap/osmosis

private void loadFeatures(long entityId, Relation entity) {
  entity.getMembers().addAll(relationMemberDao.getAllRaw(entityId));
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * Initializes the contents of the builder to the specified data.
 * 
 * @param relation
 *            The entity to initialise to.
 * @return This object allowing method chaining.
 */
public RelationBuilder initialize(Relation relation) {
  super.initialize(relation);
  initializeLocal();
  members.addAll(relation.getMembers());
  
  return this;
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core

/**
 * Initializes the contents of the builder to the specified data.
 * 
 * @param relation
 *            The entity to initialise to.
 * @return This object allowing method chaining.
 */
public RelationBuilder initialize(Relation relation) {
  super.initialize(relation);
  initializeLocal();
  members.addAll(relation.getMembers());
  
  return this;
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
@Override
public void addEntity(Relation entity) {
  super.addEntity(entity);
  
  addMembers(entity.getId(), entity.getMembers());
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
@Override
public void addEntity(Relation entity) {
  super.addEntity(entity);
  
  addMembers(entity.getId(), entity.getMembers());
}

代码示例来源:origin: osmlab/atlas

/**
 * Checks if the given {@link Relation} contains an un-indexed member {@link Relation}.
 *
 * @param relation
 *            The {@link Relation} to check
 * @return {@code true} if the given {@link Relation} contains a member {@link Relation} that
 *         hasn't yet been indexed.
 */
private boolean containsUnindexedSubRelation(final Relation relation)
{
  return relation.getMembers().stream()
      .anyMatch(member -> member.getMemberType() == EntityType.Relation && this.builder
          .peek().relation(padIdentifier(member.getMemberId())) == null);
}

代码示例来源:origin: openstreetmap/osmosis

/**
   * Process the relation members.
   * 
   * @param relation The relation to be processed.
   */
  private void addRelationMembers(Relation relation) {
    List<RelationMember> memberReferenceList;

    memberReferenceList = relation.getMembers();

    for (int i = 0; i < memberReferenceList.size(); i++) {
      relationMemberBuffer.add(new DbFeatureHistory<DbOrderedFeature<RelationMember>>(
          new DbOrderedFeature<RelationMember>(relation.getId(), memberReferenceList.get(i), i + 1), relation
              .getVersion()));
    }

    flushRelationMembers(false);
  }
}

代码示例来源:origin: openstreetmap/osmosis

public void addStringsToStringtable() {
  StringTable stable = getStringTable();
  super.addStringsToStringtable();
  for (Relation i : contents) {
    for (RelationMember j : i.getMembers()) {
      stable.incr(j.getMemberRole());
    }
  }
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
@Override
public void modifyEntity(Relation entity) {
  long relationId;
  
  super.modifyEntity(entity);
  
  relationId = entity.getId();
  relationMemberDao.removeList(relationId);
  addMembers(entity.getId(), entity.getMembers());
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
@Override
public void modifyEntity(Relation entity) {
  long relationId;
  
  super.modifyEntity(entity);
  
  relationId = entity.getId();
  relationMemberDao.removeList(relationId);
  addMembers(entity.getId(), entity.getMembers());
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
public void process(RelationContainer container) {
  Relation relation;
  // mark all nodes as required
  relation = container.getEntity();
  for (RelationMember memberReference : relation.getMembers()) {
    if (memberReference.getMemberType() == EntityType.Node) {
      long nodeId = memberReference.getMemberId();
      requiredNodes.set(nodeId);
    }
  }
  allRelations.add(container);
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * Test processing a Relation.
 */
@Test
public final void testProcess8() {
  Relation testRelation;
  
  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));
  // Nothing to assert; just expect no exception
}

代码示例来源:origin: openstreetmap/osmosis

/**
   * Test processing a Bound after a Relation.
   */
  @Test(expected = OsmosisRuntimeException.class)
  public final void testProcess9() {
    Relation testRelation;
    
    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")));
  }
}

相关文章