Hi Gerd

So, what I am looking for is a tool that helps to find
areas which are heavily overlapped, something like
a heatmap.

When displayed it looks like this:
http://files.mkgmap.org.uk/download/223/Selection_040.png

I need to add a couple of getters and a fix to mkgmap (attached)
then I will check it all into display.

..Steve


Index: src/uk/me/parabola/imgfmt/app/trergn/TREFileReader.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/TREFileReader.java	(revision 3345)
+++ src/uk/me/parabola/imgfmt/app/trergn/TREFileReader.java	(revision )
@@ -112,7 +112,7 @@
 				int endRgnOffset = reader.getu3();
 
 				SubdivData subdivData = new SubdivData(flags,
-						lat, lon, width, height,
+						lat, lon, 2*width, 2*height,
 						lastRgnOffset, endRgnOffset);
 
 				Subdivision subdiv = Subdivision.readSubdivision(mapLevels[count], subdivData);
@@ -127,7 +127,7 @@
 	}
 	
 	/**
-	 * Read the extended type info for the sub divisions. Corresponds to {@link #TREFile.writeExtTypeOffsetsRecords()}.
+	 * Read the extended type info for the sub divisions. Corresponds to {@link TREFile#writeExtTypeOffsetsRecords()}.
 	 */
 	private void readExtTypeOffsetsRecords() {
 		ImgFileReader reader = getReader();
@@ -230,4 +230,4 @@
 		}
 		return msgs.toArray(new String[msgs.size()]);
 	}
-}
\ No newline at end of file
+}
Index: src/uk/me/parabola/imgfmt/app/trergn/Subdivision.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/Subdivision.java	(revision 3345)
+++ src/uk/me/parabola/imgfmt/app/trergn/Subdivision.java	(revision )
@@ -85,7 +85,7 @@
 	// Set if this is the last one.
 	private boolean last;
 
-	private final List<Subdivision> divisions = new ArrayList<Subdivision>();
+	private final List<Subdivision> divisions = new ArrayList<>();
 
 	private int extTypeAreasOffset;
 	private int extTypeLinesOffset;
@@ -299,9 +299,8 @@
 				} else {
 					maxSetIdx = 2;
 				}
-			} else {
-				maxSetIdx = 3;
 			}
+
 			String[] refs = Arrays.copyOfRange(labels, 1, maxSetIdx+1);
 			if(refs.length == 1) {
 				// don't bother to add a single ref that looks the
@@ -545,7 +544,6 @@
 	}
 	/**
 	 * Set the sizes for the extended type data. See {@link #writeLastExtTypeOffsetsRecord(ImgFileWriter)} 
-	 * @param reader
 	 */
 	public void readLastExtTypeOffsetsRecord(ImgFileReader reader) {
 		extTypeAreasSize = reader.getInt() - extTypeAreasOffset;
@@ -639,5 +637,21 @@
 
 	public Coord getCenter(){
 		return new Coord(getLatitude(),getLongitude());
+	}
+
+	/**
+	 * Get the unshifted width of the subdivision.
+	 * @return The true (unshifted) width.
+	 */
+	public int getWidth() {
+		return width << getShift();
+	}
+
+	/**
+	 * Get the unshifted height of the subdivision.
+	 * @return The true (unshifted) height.
+	 */
+	public int getHeight() {
+		return height << getShift();
 	}
 }
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to