Index: /experimental/TerrainTest/rampedEllipsoidTechnique.cpp
===================================================================
--- /experimental/TerrainTest/rampedEllipsoidTechnique.cpp	(revision 265)
+++ /experimental/TerrainTest/rampedEllipsoidTechnique.cpp	(revision 266)
@@ -6,5 +6,5 @@
 {
 	_height = 0.0;
-	_rampWidthFactor = 0.1;	// 10% of ROI is ramp.
+	_rampWidthFactor = 0.4;	// 10% of ROI is ramp.
 }
 
@@ -32,8 +32,10 @@
 	int X_start=0, X_startRamp=0, X_startCore=0, X_endCore=0, X_endRamp=0, X_end=h->getNumColumns();	// Lon
 
-	Y_startRamp = (modificationROI[0]-tileExtends[0]) / h->getYInterval();
-	Y_startCore = (coreROI[0]-tileExtends[0]) / h->getYInterval();
-	Y_endCore   = (coreROI[1]-tileExtends[0]) / h->getYInterval();
-	Y_endRamp   = (modificationROI[1]-tileExtends[0]) / h->getYInterval();
+	// Lat
+	Y_startRamp = round((modificationROI[0]-tileExtends[0]) / h->getYInterval());
+	Y_startCore = round((coreROI[0]-tileExtends[0]) / h->getYInterval());
+	Y_endCore   = round((coreROI[1]-tileExtends[0]) / h->getYInterval());
+	Y_endRamp   = round((modificationROI[1]-tileExtends[0]) / h->getYInterval());
+
 	clampValue(Y_startRamp, Y_start, Y_end);
 	clampValue(Y_startCore, Y_start, Y_end);
@@ -41,23 +43,14 @@
 	clampValue(Y_endRamp, Y_start, Y_end);
 
-	X_startRamp = (modificationROI[2]-tileExtends[2]) / h->getXInterval();
-	X_startCore = (coreROI[2]-tileExtends[2]) / h->getXInterval();
-	X_endCore   = (coreROI[3]-tileExtends[2]) / h->getXInterval();
-	X_endRamp   = (modificationROI[3]-tileExtends[2]) / h->getXInterval();
+	// Lon
+	X_startRamp = round((modificationROI[2]-tileExtends[2]) / h->getXInterval());
+	X_startCore = round((coreROI[2]-tileExtends[2]) / h->getXInterval());
+	X_endCore   = round((coreROI[3]-tileExtends[2]) / h->getXInterval());
+	X_endRamp   = round((modificationROI[3]-tileExtends[2]) / h->getXInterval());
+
 	clampValue(X_startRamp, X_start, X_end);
 	clampValue(X_startCore, X_start, X_end);
 	clampValue(X_endCore, X_start, X_end);
 	clampValue(X_endRamp, X_start, X_end);
-
-	// Determine loop variables..
-	//if(tileExtends[0]<modificationROI[0])
-	//	startY = (modificationROI[0] - tileExtends[0]) / h->getYInterval();
-	//if(tileExtends[1]>modificationROI[1])
-	//	endY = (modificationROI[1] - tileExtends[0]) / h->getYInterval();
-
-	//if(tileExtends[2]<modificationROI[2])
-	//	startX = (modificationROI[2] - tileExtends[2]) / h->getXInterval();
-	//if(tileExtends[3]>modificationROI[3])
-	//	endX = (modificationROI[3] - tileExtends[2]) / h->getXInterval();
 
 
@@ -67,13 +60,54 @@
 		for(int y=Y_startRamp;y<Y_endRamp;y++)
 		{
+			// Calculate vertex position in global coordinate system (lat/lon)
+			double vertex_lat = y*h->getYInterval()+tileExtends[0];
+			double vertex_lon = x*h->getXInterval()+tileExtends[2];
+			// Calculate vertex delta h: h_dest - h_org
+			double height_org = h->getHeight(x,y);
+			double delta_h = _height - height_org;
+			// preset offsetvalue to max and let every region try to lower it...
+			double destination_height = std::numeric_limits<double>::max();
+
+			// Calculate vertex height according to the region it is in.
 			if( Y_startCore<=y && y<Y_endCore && X_startCore<=x && x<X_endCore )	// If vertex is inside core: Apply final height
 			{
-				h->setHeight( x, y, _height);
+					if(_height<destination_height)
+					destination_height = _height;
 			}
-			else	//  vertex is inside ramp but not inside core: apply ramp height
+			if(Y_startRamp<=y && y<Y_startCore) // Vertex is inside Y start ramp
 			{
-				h->setHeight( x, y, _height-50.0);
+				double delta_s = abs(modificationROI[0]-vertex_lat);
+				double gradient = delta_h/deltaLatPerSide;
+				double dest = delta_s*gradient + height_org;
+				if(dest<destination_height)
+					destination_height = dest;			
+			}
+			if(X_startRamp<=x && x<X_startCore)	// Vertex is inside X start ramp
+			{
+				double delta_s = abs(modificationROI[2]-vertex_lon);
+				double gradient = delta_h/deltaLonPerSide;
+				double dest = delta_s*gradient + height_org;
+				if(dest<destination_height)
+					destination_height = dest;
+			}
+			if(Y_endCore<=y && y<Y_endRamp)  // Vertex is inside Y end ramp
+			{
+				double delta_s = abs(modificationROI[1]-vertex_lat);
+				double gradient = delta_h/deltaLatPerSide;
+				double dest = delta_s*gradient + height_org;
+				if(dest<destination_height)
+					destination_height = dest;
+			}
+			if (X_endCore<=x && x<X_endRamp) // Vertex is inside X end ramp
+			{
+				double delta_s = abs(modificationROI[3]-vertex_lon);
+				double gradient = delta_h/deltaLonPerSide;
+				double dest = delta_s*gradient + height_org;
+				if(dest<destination_height)
+					destination_height = dest;
 			}
 			
+			// Set height to calculated value
+			h->setHeight( x, y, destination_height);
 		}
 	}
Index: /experimental/TerrainTest/rampedEllipsoidTechnique.h
===================================================================
--- /experimental/TerrainTest/rampedEllipsoidTechnique.h	(revision 265)
+++ /experimental/TerrainTest/rampedEllipsoidTechnique.h	(revision 266)
@@ -1,4 +1,5 @@
 #pragma once
 #include "terrainModificationTechnique.h"
+#include <limits>
 
 
@@ -15,4 +16,5 @@
 
 private:
+	double round(double x) {return (x > 0.5) ? ceil(x) : floor(x);}
 	double _height;
 	double _rampWidthFactor;
Index: /experimental/TerrainTest/terrainModificationTechnique.h
===================================================================
--- /experimental/TerrainTest/terrainModificationTechnique.h	(revision 265)
+++ /experimental/TerrainTest/terrainModificationTechnique.h	(revision 266)
@@ -21,5 +21,5 @@
 	 * \brief This function performs the terrain data modification. Must be subclassed.
 	 * 
-	 * @param modificationROI This vector contains the extents of the region of interest which should be modified: lat min, lat_max, long_min, long_max
+	 * @param modificationROI This vector contains the extents of the region of interest which should be modified: lat_min, lat_max, long_min, long_max
 	 * @param h : Heightfield of the tile which should be modified
 	 * @param tileExtends : This vector contains the extents of the tile: lat_min, lat_max, long_min, long_max
