Examples of OsmUser


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

  /**
   * Performs pre-test activities.
   */
  @Before
  public void setUp() {
    OsmUser user;
    List<Tag> tags;
   
    user = new OsmUser(12, "OsmosisTest");
   
    // All nodes have an empty tags list.
    tags = new ArrayList<Tag>();
   
    polygonFile = new File(getClass().getResource("testPolygon.txt").getFile());
View Full Code Here

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

  /**
   * {@inheritDoc}
   */
  @Override
  public OsmUser mapRow(ResultSet rs, int rowNumber) throws SQLException {
    return new OsmUser(rs.getInt("id"), rs.getString("name"));
  }
View Full Code Here

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

   * @param userId
   *            The unique identifier of the user.
   * @return The loaded user.
   */
  public OsmUser getUser(long userId) {
    OsmUser user;
   
    try {
      user = jdbcTemplate.queryForObject(SELECT_USER, rowMapper, userId);
    } catch (EmptyResultDataAccessException e) {
      throw new NoSuchRecordException("User " + userId + " doesn't exist.", e);
View Full Code Here

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

  }


  private CommonEntityData buildCommonEntityData(long entityId, List<Integer> keys, List<Integer> values, Info info,
      PbfFieldDecoder fieldDecoder) {
    OsmUser user;
    CommonEntityData entityData;

    // Build the user, but only if one exists.
    if (info.hasUid() && info.getUid() >= 0 && info.hasUserSid()) {
      user = new OsmUser(info.getUid(), fieldDecoder.decodeString(info.getUserSid()));
    } else {
      user = OsmUser.NONE;
    }

    entityData = new CommonEntityData(entityId, info.getVersion(),
View Full Code Here

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

        userSid += denseInfo.getUserSid(i);
        timestamp += denseInfo.getTimestamp(i);
        changesetId += denseInfo.getChangeset(i);

        // Build the user, but only if one exists.
        OsmUser user;
        if (userId >= 0) {
          user = new OsmUser(userId, fieldDecoder.decodeString(userSid));
        } else {
          user = OsmUser.NONE;
        }

        entityData = new CommonEntityData(nodeId, denseInfo.getVersion(i),
View Full Code Here

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

   * @return The newly build user object.
   */
  private OsmUser buildUser(ResultSet resultSet) {
    try {
      int userId;
      OsmUser user;
     
      userId = resultSet.getInt("user_id");
      if (userId == OsmUser.NONE.getId()) {
        user = OsmUser.NONE;
      } else {
        user = new OsmUser(
          userId,
          resultSet.getString("user_name")
        );
      }
     
View Full Code Here

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

   */
  @Test
  public final void testProcessNormalNode() {
    Node node =
      new Node(
        new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0),
        20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
View Full Code Here

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

  public final void testProcessNodeNoTags() {
    testNodeWriter.process(
        new Node(
          new CommonEntityData(
            1234, 2, timestamp,
            new OsmUser(23, "someuser"), 0,
            new ArrayList<Tag>()),
          20.12345678,
          -21.98765432));
    try {
      testBufferedWriter.flush();
View Full Code Here

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

  public void process(Dataset dataset) {
    DatasetContext dsCtx = dataset.createReader();
   
    try {
      EntityManager<Node> nodeManager = dsCtx.getNodeManager();
      OsmUser user;
      Node node;
     
      // Create the user for edits to be performed under. This is an existing user with an
      // updated name.
      user = new OsmUser(10, "user10b");
     
      // Modify node 1 to add a new tag.
      node = nodeManager.getEntity(1).getWriteableInstance();
      node.setUser(user);
      node.getTags().add(new Tag("change", "new tag"));
View Full Code Here

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

    String sversion;
    int version;
    TimestampContainer timestampContainer;
    String rawUserId;
    String rawUserName;
    OsmUser user;
    long changesetId;
   
    id = Long.parseLong(attributes.getValue(ATTRIBUTE_NAME_ID));
    sversion = attributes.getValue(ATTRIBUTE_NAME_VERSION);
    if (sversion == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.