Index: ../trunk-jpl/src/c/Makefile.am
===================================================================
--- ../trunk-jpl/src/c/Makefile.am	(revision 18844)
+++ ../trunk-jpl/src/c/Makefile.am	(revision 18845)
@@ -855,6 +855,8 @@
 					./classes/kriging/PowerVariogram.cpp\
 					./classes/kriging/Quadtree.h\
 					./classes/kriging/Quadtree.cpp\
+					./classes/kriging/Covertree.h\
+					./classes/kriging/Covertree.cpp\
 					./classes/kriging/Observation.h\
 					./classes/kriging/Observation.cpp\
 					./modules/Krigingx/pKrigingx.cpp
Index: ../trunk-jpl/src/c/classes/kriging/Covertree.cpp
===================================================================
--- ../trunk-jpl/src/c/classes/kriging/Covertree.cpp	(revision 0)
+++ ../trunk-jpl/src/c/classes/kriging/Covertree.cpp	(revision 18845)
@@ -0,0 +1,12 @@
+#include "../classes.h"
+
+	/*Constructors/Destructors*/
+Covertree::Covertree(){/*{{{*/
+	_error_("Constructor not supported");
+}
+/*}}}*/
+Covertree::~Covertree(){/*{{{*/
+}
+/*}}}*/
+
+	/*Methods*/
Index: ../trunk-jpl/src/c/classes/kriging/Covertree.h
===================================================================
--- ../trunk-jpl/src/c/classes/kriging/Covertree.h	(revision 0)
+++ ../trunk-jpl/src/c/classes/kriging/Covertree.h	(revision 18845)
@@ -0,0 +1,14 @@
+
+#ifndef _COVERTREE_H
+#define _COVERTREE_H
+
+class Observation;
+
+class Covertree{
+
+	public:
+		Covertree();
+		~Covertree();
+
+};
+#endif //_COVERTREE_H
Index: ../trunk-jpl/src/c/classes/kriging/krigingobjects.h
===================================================================
--- ../trunk-jpl/src/c/classes/kriging/krigingobjects.h	(revision 18844)
+++ ../trunk-jpl/src/c/classes/kriging/krigingobjects.h	(revision 18845)
@@ -12,6 +12,7 @@
 #include "./SphericalVariogram.h"
 #include "./PowerVariogram.h"
 #include "./Quadtree.h"
+#include "./Covertree.h"
 #include "./Observation.h"
 #include "./Observations.h"
 
Index: ../trunk-jpl/src/c/classes/kriging/Observations.cpp
===================================================================
--- ../trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 18844)
+++ ../trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 18845)
@@ -22,6 +22,7 @@
 #include "../../shared/shared.h"
 
 #include "./Quadtree.h"
+#include "./Covertree.h"
 #include "./Variogram.h"
 #include "../../toolkits/toolkits.h"
 
@@ -30,12 +31,54 @@
 
 /*Object constructors and destructor*/
 Observations::Observations(){/*{{{*/
-	this->quadtree = NULL;
+	this->treetype  = 0;
+	this->quadtree  = NULL;
+	this->covertree = NULL;
 	return;
 }
 /*}}}*/
 Observations::Observations(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/
 
+	/*Check that there are observations*/
+	if(n<=0) _error_("No observation found");
+
+	/*Get tree type*/
+	options->Get(&this->treetype,"treetype",1);
+	switch(this->treetype){
+		case 1:
+			this->covertree = NULL;
+			this->InitQuadtree(observations_list,x,y,n,options);
+			break;
+		case 2:
+			this->quadtree = NULL;
+			this->InitCovertree(observations_list,x,y,n,options);
+			break;
+		default:
+			_error_("Tree type "<<this->treetype<<" not supported yet (1: quadtree, 2: covertree)");
+	}
+
+
+
+}
+/*}}}*/
+Observations::~Observations(){/*{{{*/
+	switch(this->treetype){
+		case 1:
+			delete this->quadtree;
+			break;
+		case 2:
+			delete this->covertree;
+			break;
+		default:
+			_error_("Tree type "<<this->treetype<<" not supported yet (1: quadtree, 2: covertree)");
+	}
+	return;
+}
+/*}}}*/
+
+/*Initialize data structures*/
+void Observations::InitQuadtree(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/
+
 	/*Intermediaries*/
 	int          i,maxdepth,level,counter,index;
 	int          xi,yi;
@@ -43,8 +86,8 @@
 	IssmPDouble  offset,minlength,minspacing,mintrimming,maxtrimming;
 	Observation *observation = NULL;
 
-	/*Check that observations is not empty*/
-	if(n==0) _error_("No observation found");
+	/*Checks*/
+	_assert_(n);
 
 	/*Get extrema*/
 	xmin=x[0]; ymin=y[0];
@@ -109,9 +152,10 @@
 	_printf0_("  Final number of observations: " << this->quadtree->NbObs << "\n");
 }
 /*}}}*/
-Observations::~Observations(){/*{{{*/
-	delete quadtree;
-	return;
+void Observations::InitCovertree(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/
+
+	_error_("Not supported yet");
+
 }
 /*}}}*/
 
@@ -509,6 +553,7 @@
 }/*}}}*/
 void Observations::QuadtreeColoring(IssmPDouble* A,IssmPDouble *x,IssmPDouble *y,int n){/*{{{*/
 
+	if(this->treetype!=1) _error_("Tree type is not quadtree");
 	int xi,yi,level;
 
 	for(int i=0;i<n;i++){
Index: ../trunk-jpl/src/c/classes/kriging/Observations.h
===================================================================
--- ../trunk-jpl/src/c/classes/kriging/Observations.h	(revision 18844)
+++ ../trunk-jpl/src/c/classes/kriging/Observations.h	(revision 18845)
@@ -2,6 +2,7 @@
 #define  _CONTAINER_OBSERVATIONS_H_
 
 class Quadtree;
+class Covertree;
 class Variogram;
 class Options;
 #include "../../datastructures/datastructures.h"
@@ -15,7 +16,9 @@
 class Observations: public DataSet{
 
 	private:
-		Quadtree* quadtree;
+		int        treetype;
+		Quadtree*  quadtree;
+		Covertree* covertree;
 
 	public:
 
@@ -24,6 +27,10 @@
 		Observations(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options);
 		~Observations();
 
+		/*Initialize data structures*/
+		void InitQuadtree(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options);
+		void InitCovertree(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options);
+
 		/*Methods*/
 		void ClosestObservation(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius);
 		void Distances(IssmPDouble* distances,IssmPDouble *x,IssmPDouble *y,int n,IssmPDouble radius);
