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

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


        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

   * @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

   */
  @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

  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

  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

    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

    @Test
    public void testChangeset() {
      DatabaseContext dbCtx;
      UserManager userManager;
      ChangesetManager changesetManager;
      OsmUser user;
      long changesetId;
     
      user = new OsmUser(1, "user");
      changesetId = 2;
     
      dbCtx = dbUtils.createDatabaseContext();
     
      // Reset the database to a clean state.
View Full Code Here

  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

    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

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.