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

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


     * @param replaceId. The changesetId to use in case the feature has a negative one indicating a
     *        temporary value
     * @return
     */
    public Entity toEntity(SimpleFeature feature, Long changesetId) {
        Entity entity;
        SimpleFeatureType type = feature.getFeatureType();
        long id = Long.parseLong(feature.getID());
        int version = ((Integer) feature.getAttribute("version")).intValue();
        Long changeset = (Long) feature.getAttribute("changeset");
        if (changesetId != null && changeset < 0) {
View Full Code Here


                    PropertyDescriptor descriptor = descriptors.get(i);
                    Optional<Object> value = values.get(i);
                    featureBuilder.set(descriptor.getName(), value.orNull());
                }
                SimpleFeature feature = featureBuilder.buildFeature(ref.name());
                Entity entity = converter.toEntity(feature, id);
                EntityContainer container;
                if (entity instanceof Node) {
                    container = new NodeContainer((Node) entity);
                } else {
                    container = new WayContainer((Way) entity);
View Full Code Here

                    PropertyDescriptor descriptor = descriptors.get(i);
                    Optional<Object> value = values.get(i);
                    featureBuilder.set(descriptor.getName(), value.orNull());
                }
                SimpleFeature feature = featureBuilder.buildFeature(ref.name());
                Entity entity = converter.toEntity(feature, null);
                EntityContainer container;
                if (entity instanceof Node) {
                    container = new NodeContainer((Node) entity);
                } else {
                    container = new WayContainer((Way) entity);
View Full Code Here

  }

  @Test
  public void process() {
    // Setup
    Entity entityMocked = mock(Entity.class);
    when(entityMocked.getType()).thenReturn(EntityType.Node);

    EntityContainer entityContainerMocked = mock(EntityContainer.class);
    when(entityContainerMocked.getEntity()).thenReturn(entityMocked);

    // Action
View Full Code Here

    LOG.fine("initialize() with metadata: " + metadata.toString());
  }

  @Override
  public void process(EntityContainer entityContainer) {
    Entity entity = entityContainer.getEntity();
    EntityType type = entity.getType();
    workerPool.submit(entity);
    entityCounter.increment(type);
  }
View Full Code Here

    this.newTypeNotification = new AtomicReference<Worker.NewTypeNotification>();
  }

  @Override
  public void run() {
    Entity entity = null;
    EntityBuffer entityBuffer = null;
    NewTypeNotification notification = null;
    while (running || !taskQueue.isEmpty()) {
      try {
        // Check if a NewTypeNotification was triggered
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public List<ChangeContainer> next() {
    List<ChangeContainer> changeList;
    Entity peekEntity;
    long currentId;
    EntityType currentEntityType;
   
    // Get the next change from the underlying stream.
    peekEntity = sourceIterator.peekNext().getEntityContainer().getEntity();
    currentId = peekEntity.getId();
    currentEntityType = peekEntity.getType();
   
    // Loop until all history values for the current element are exhausted.
    changeList = new ArrayList<ChangeContainer>();
    while (sourceIterator.hasNext()) {
      ChangeContainer tmpChangeContainer = sourceIterator.peekNext();
View Full Code Here

  }

  @Override
  public void process(EntityContainer entityContainer) {
    Entity entity = entityContainer.getEntity();
    EntityType type = entity.getType();
    workerPool.submit(entity);
    entityCounter.increment(type);
  }
View Full Code Here

  @Override
  public List<ChangeContainer> next() {
    List<ChangeContainer> changeList;
    Entity peekEntity;
    long currentId;
    EntityType currentEntityType;
   
    // Get the next change from the underlying stream.
    peekEntity = sourceIterator.peekNext().getEntityContainer().getEntity();
    currentId = peekEntity.getId();
    currentEntityType = peekEntity.getType();
   
    // Loop until all history values for the current element are exhausted.
    changeList = new ArrayList<ChangeContainer>();
    while (sourceIterator.hasNext()) {
      ChangeContainer tmpChangeContainer = sourceIterator.peekNext();
     
      // Break out of the loop when we reach the next entity in the stream.
      if (currentId != tmpChangeContainer.getEntityContainer().getEntity().getId()
        || !currentEntityType.equals(tmpChangeContainer.getEntityContainer().getEntity().getType())) {
        break;
      }
     
      // We want the value that we have already peeked from the iterator, so remove it from the iterator.
      sourceIterator.next();
View Full Code Here

    for (Way way : waysById.values()) {
     
      List<WayNode> origWayNodes = way.getWayNodes();
      List<OSMNode> wayNodes = new ArrayList<OSMNode>(origWayNodes.size());
      for (WayNode origWayNode : origWayNodes) {
        Node origNode = nodesById.get(origWayNode.getNodeId());
        if (origNode != null) {
          wayNodes.add(nodeMap.get(origNode));
        }
      }
     
View Full Code Here

TOP

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

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.