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

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


      // the previous one.
      long nodeId = 0;
      List<WayNode> wayNodes = osmWay.getWayNodes();
      for (long nodeIdOffset : way.getRefsList()) {
        nodeId += nodeIdOffset;
        wayNodes.add(new WayNode(nodeId));
      }

      decodedEntities.add(new WayContainer(osmWay));
    }
  }
View Full Code Here


  public void begin(Attributes attributes) {
    long id;
   
    id = Long.parseLong(attributes.getValue(ATTRIBUTE_NAME_ID));
   
    wayNode = new WayNode(id);
  }
View Full Code Here

            }
               
            long lastId = 0;
            List<WayNode> nodes = new ArrayList<WayNode>();
            for (long j : i.getRefsList()) {
                nodes.add(new WayNode(j + lastId));
                lastId = j + lastId;
            }

            long id = i.getId();
View Full Code Here

      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();
       
        if (!availableNodes.get(nodeReference.getNodeId())) {
          i.remove();
        }
      }
     
      // Only add ways that contain nodes.
View Full Code Here

   */
  @Override
  public DbOrderedFeature<WayNode> mapRow(ResultSet rs, int rowNumber) throws SQLException {
    return new DbOrderedFeature<WayNode>(
        rs.getLong("entity_id"),
        new WayNode(
          rs.getLong("node_id")
        ),
        rs.getInt("sequence_id")
      );
  }
View Full Code Here

  @Test
  public final void testProcess6() {
    Way testWay;
   
    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));
    // Nothing to assert; just expect no exception
  }
View Full Code Here

  @Test(expected = OsmosisRuntimeException.class)
  public final void testProcess7() {
    Way testWay;
   
    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

  @Override
  public DbOrderedFeature<WayNode> buildEntity(ResultSet resultSet) {
    try {
      return new DbOrderedFeature<WayNode>(
        resultSet.getLong("entity_id"),
        new WayNode(
          resultSet.getLong("node_id")
        ),
        resultSet.getInt("sequence_id")
      );
     
View Full Code Here

  @Override
  public int populateEntityParameters(
      PreparedStatement statement, int initialIndex, DbOrderedFeature<WayNode> entityFeature) {
    try {
      int prmIndex;
      WayNode wayNode;
     
      wayNode = entityFeature.getFeature();
     
      prmIndex = initialIndex;
     
      statement.setLong(prmIndex++, entityFeature.getEntityId());
      statement.setLong(prmIndex++, wayNode.getNodeId());
      statement.setInt(prmIndex++, entityFeature.getSequenceId());
     
      return prmIndex;
     
    } catch (SQLException e) {
View Full Code Here

   
    if (nodeIdArray != null) {
      nodeIds = (Long[]) nodeIdArray.getArray();
      wayNodes = way.getWayNodes();
      for (long nodeId : nodeIds) {
        wayNodes.add(new WayNode(nodeId));
      }
    }
   
    return way;
  }
View Full Code Here

TOP

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

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.