예제 #1
0
  /** Inserts the Feature to the index and stages it to be committed. */
  public ObjectId insertAndAdd(GeogitTransaction transaction, Feature f) throws Exception {
    ObjectId objectId = insert(transaction, f);

    if (transaction != null) {
      transaction.command(AddOp.class).call();
    } else {
      geogit.command(AddOp.class).call();
    }
    return objectId;
  }
예제 #2
0
  /**
   * Deletes a feature from the index
   *
   * @param f
   * @return
   * @throws Exception
   */
  public boolean deleteAndAdd(GeogitTransaction transaction, Feature f) throws Exception {
    boolean existed = delete(transaction, f);
    if (existed) {
      if (transaction != null) {
        transaction.command(AddOp.class).call();
      } else {
        geogit.command(AddOp.class).call();
      }
    }

    return existed;
  }