Example #1
0
 /** Inserts the feature to the index but does not stages it to be committed */
 public ObjectId insert(GeogitTransaction transaction, Feature f) throws Exception {
   final WorkingTree workTree =
       (transaction != null ? transaction.getWorkingTree() : repo.getWorkingTree());
   Name name = f.getType().getName();
   String parentPath = name.getLocalPart();
   Node ref = workTree.insert(parentPath, f);
   ObjectId objectId = ref.getObjectId();
   return objectId;
 }
 protected void writeNode(Writer w, Node node) throws IOException {
   print(w, TreeNode.REF.name());
   print(w, "\t");
   print(w, node.getType().name());
   print(w, "\t");
   print(w, node.getName());
   print(w, "\t");
   print(w, node.getObjectId().toString());
   print(w, "\t");
   print(w, node.getMetadataId().or(ObjectId.NULL).toString());
   print(w, "\t");
   Envelope envHelper = new Envelope();
   writeBBox(w, node, envHelper);
   println(w);
 }