Index: src/uk/me/parabola/splitter/AreaList.java
===================================================================
--- src/uk/me/parabola/splitter/AreaList.java	(revision 590)
+++ src/uk/me/parabola/splitter/AreaList.java	(working copy)
@@ -349,6 +349,30 @@
 			al.writeArgsFile(new File(fileOutputDir, pd.getName() + "-" + "template.args").getPath(), outputType, pd.getMapId());
 		}
 	}
+
+	public void realignForDem(int res) {
+		List<Area> aligned = new ArrayList<>();
+		for (Area unal : areas) {
+			aligned.add(calcHGTArea(unal, res));
+		}
+		areas.clear();
+		areas.addAll(aligned);
+	}
 	
+	private static Area calcHGTArea(Area bbox, int res) {
+		double top = Utils.toDegrees(bbox.getMaxLat());
+		double bottom = Utils.toDegrees(bbox.getMinLat());
+		double left = Utils.toDegrees(bbox.getMinLong());
+		double right = Utils.toDegrees(bbox.getMaxLong());
+		// expand move upper left corner close to hgt raster
+		double hgtDis = 1.0D / res;
+		double hgtTop = Math.round(top / hgtDis) * hgtDis;
+		double hgtBottom = Math.round(bottom / hgtDis) * hgtDis;
+		double hgtLeft = Math.round(left / hgtDis) * hgtDis;
+		double hgtRight = Math.round(right/ hgtDis) * hgtDis;
 
+		return new Area(Utils.toMapUnit(hgtBottom), Utils.toMapUnit(hgtLeft), Utils.toMapUnit(hgtTop), Utils.toMapUnit(hgtRight));
+	}
+		 	
+
 }
Index: src/uk/me/parabola/splitter/Main.java
===================================================================
--- src/uk/me/parabola/splitter/Main.java	(revision 590)
+++ src/uk/me/parabola/splitter/Main.java	(working copy)
@@ -15,6 +15,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -24,6 +25,7 @@
 import uk.me.parabola.splitter.args.SplitterParams;
 import uk.me.parabola.splitter.kml.KmlWriter;
 import uk.me.parabola.splitter.solver.AreasCalculator;
+import uk.me.parabola.splitter.solver.PolygonDesc;
 import uk.me.parabola.splitter.writer.AbstractOSMWriter;
 import uk.me.parabola.splitter.writer.BinaryMapWriter;
 import uk.me.parabola.splitter.writer.O5mMapWriter;
@@ -204,10 +206,14 @@
 			writeAreas = true;
 			int alignment = 1 << (24 - resolution);
 			System.out.println("Map is being split for resolution " + resolution + ':');
-			System.out.println(" - area boundaries are aligned to 0x" + Integer.toHexString(alignment) + " map units ("
-					+ Utils.toDegrees(alignment) + " degrees)");
-			System.out.println(
-					" - areas are multiples of 0x" + Integer.toHexString(alignment) + " map units wide and high");
+			if (mainOptions.getAlignForDem() < 0) {
+				System.out.println(" - area boundaries are aligned to 0x" + Integer.toHexString(alignment) + " map units ("
+						+ Utils.toDegrees(alignment) + " degrees)");
+				System.out.println(
+						" - areas are multiples of 0x" + Integer.toHexString(alignment) + " map units wide and high");
+			} else {
+				System.out.println(" - area boundaries are aligned to 1/" + mainOptions.getAlignForDem() + " degrees");
+			}
 			areasCalculator.fillDensityMap(osmFileHandler, fileOutputDir);
 			areaList.setAreas(areasCalculator.calcAreas());
 			if (areaList.getAreas().isEmpty()) {
@@ -221,8 +227,11 @@
 			if (mapId + areaList.getAreas().size() > 99999999) {
 				throw new SplitFailedException("Too many areas for initial mapid " + mapId);
 			}
+			if (mainOptions.getAlignForDem() > 0)
+				areaList.realignForDem(mainOptions.getAlignForDem());
 			areaList.setMapIds(mapId);
 		}
+		
 		areaList.setAreaNames();
 		if (writeAreas) {
 			areaList.write(new File(fileOutputDir, "areas.list").getPath());
@@ -241,7 +250,15 @@
 		String outputType = mainOptions.getOutput();
 		
 		if (!areasCalculator.getPolygons().isEmpty()) {
-			areaList.writeListFiles(outputDir, areasCalculator.getPolygons(), kmlOutputFile, outputType);
+			List<PolygonDesc> polygons = areasCalculator.getPolygons();
+			if (mainOptions.getAlignForDem() > 0) {
+				ArrayList<PolygonDesc> aligned = new ArrayList<>();
+				for (PolygonDesc pd : polygons) {
+					aligned.add(pd.realignForDem(mainOptions.getAlignForDem()));
+				}
+				polygons = aligned;
+			}
+			areaList.writeListFiles(outputDir, polygons, kmlOutputFile, outputType);
 		}
 		areaList.writeArgsFile(new File(fileOutputDir, "template.args").getPath(), outputType, -1);
 		areaList.dumpHex();
@@ -347,6 +364,11 @@
 			System.err.println("The --resolution parameter must be a value between 1 and 24. Reasonable values are close to 13.");
 			throw new IllegalArgumentException();
 		}
+		int alignDem = params.getAlignForDem();
+		if (alignDem != -1 && alignDem <= 0) {
+			System.err.println("The --align-for-dem parameter must be either -1 or a value > 0.");
+			throw new IllegalArgumentException();
+		}
 
 		String outputDir = params.getOutputDir();
 		fileOutputDir = new File(outputDir == null ? DEFAULT_DIR : outputDir);
Index: src/uk/me/parabola/splitter/Utils.java
===================================================================
--- src/uk/me/parabola/splitter/Utils.java	(revision 590)
+++ src/uk/me/parabola/splitter/Utils.java	(working copy)
@@ -245,7 +245,46 @@
 		}
 		return new java.awt.geom.Area(path);
 	}
-	
+
+	/**
+	 * Convert area with coordinates in degrees to area in MapUnits
+	 * @param area
+	 * @return
+	 */
+	public static java.awt.geom.Area AreaMapUnitAlignForDem(java.awt.geom.Area area, int DemRes){
+		if (area == null)
+			return null;
+		double hgtDis = 1.0D / DemRes;
+
+		double[] res = new double[6];
+		Path2D path = new Path2D.Double();
+		PathIterator pit = area.getPathIterator(null);
+		while (!pit.isDone()) {
+			int type = pit.currentSegment(res);
+
+			double lat = toMapUnit(Math.round(toDegrees((int)res[1])/ hgtDis) * hgtDis);
+			double lon = toMapUnit(Math.round(toDegrees((int)res[0])/ hgtDis) * hgtDis);
+			
+			switch (type) {
+			case PathIterator.SEG_LINETO:
+				path.lineTo(lon, lat);
+				break;
+			case PathIterator.SEG_MOVETO: 
+				path.moveTo(lon, lat);
+				break;
+			case PathIterator.SEG_CLOSE:
+				path.closePath();
+				break;
+			default:
+				System.out.println("Unsupported path iterator type " + type
+						+ ". This is an internal splitter error.");
+			}
+
+			pit.next();
+		}
+		return new java.awt.geom.Area(path);
+	}
+
 	// returns true if the way is a closed polygon with a clockwise
 	// direction
 	public static boolean clockwise(List<Point> points) {
Index: src/uk/me/parabola/splitter/args/SplitterParams.java
===================================================================
--- src/uk/me/parabola/splitter/args/SplitterParams.java	(revision 590)
+++ src/uk/me/parabola/splitter/args/SplitterParams.java	(working copy)
@@ -123,4 +123,8 @@
 	@Option(defaultValue = "false", description = "Specify if splitter should ignore bounds tags in input files")
 	boolean getIgnoreOsmBounds();
 
+	@Option(defaultValue = "-1", description = "Align tiles to hgt raster. Valid values are > 0. " 
+			+ "-1 means that tiles are aligned as described in option resolution.")
+	int getAlignForDem();
+
 }
Index: src/uk/me/parabola/splitter/solver/PolygonDesc.java
===================================================================
--- src/uk/me/parabola/splitter/solver/PolygonDesc.java	(revision 590)
+++ src/uk/me/parabola/splitter/solver/PolygonDesc.java	(working copy)
@@ -13,6 +13,7 @@
 package uk.me.parabola.splitter.solver;
 
 import java.awt.geom.Area;
+import uk.me.parabola.splitter.Utils;
 
 /**
  * Store a java area with a name and mapid 
@@ -40,4 +41,11 @@
 	public int getMapId() {
 		return mapId;
 	}
+
+	public PolygonDesc realignForDem(int res) {
+		if (res < 0)
+			return this;
+		Area alignedArea = Utils.AreaMapUnitAlignForDem(area, res);
+		return new PolygonDesc(name, alignedArea, mapId);
+	}
 }
