Index: doc/options.txt
===================================================================
--- doc/options.txt	(revision 3631)
+++ doc/options.txt	(working copy)
@@ -167,7 +167,6 @@
 in the same tile are used only. So the results close to a tile 
 border have less quality.  
 
-
 ;--housenumbers
 : Enables house number search for OSM input files. 
 
@@ -430,7 +429,6 @@
 problems. If MinLength is specified (in metres), arcs shorter
 than that length will be removed. If a length is not
 specified, only zero-length arcs will be removed.
- 
 
 ;--adjust-turn-headings[=BITMASK]
 : 	Where possible, ensure that turns off to side roads change
@@ -444,7 +442,6 @@
 :* 1 = increase angle between side road and outgoing main road
 :* 2 = increase angle between side road and incoming main road
 
-
 ;--report-similar-arcs
 : 	Issue a warning when more than one arc connects two nodes and
 the ways that the arcs are derived from contain identical
@@ -459,12 +456,11 @@
 :* 1 = multiple one-way roads that join together but go nowhere
 :* 2 = individual one-way roads that go nowhere.
 
-
 ;--road-name-pois[=GarminCode]
 :   Now ignored, former meaning:   	
 		Generate a POI for each named road. By default, the POIs'
 Garmin type code is 0x640a. If desired, a different type code
-can be specified with this option.  This s a workaround for not
+can be specified with this option.  This was a workaround for not
 being able to search for roads.
 
 : 0x2f15: a blue dot in the middle of the road, and if you select,
@@ -480,7 +476,6 @@
 :* end    - The last point of the line
 :* inner  - Each point of the line except the first and the last 
 :* mid    - The middle point
-:
 
 ;--add-pois-to-areas
 : 	Generate a POI for each polygon and multipolygon. The POIs are created 
@@ -494,13 +489,11 @@
 :: First rule that applies:
 ::* the first node tagged with a tag defined by the pois-to-areas-placement option
 ::* the centre point  
-::
 
 :;multipolygons:
 :: First rule that applies:
 ::* the node with role=label
 ::* the centre point of the biggest area
-:
 
 ;--pois-to-areas-placement[=taglist]
 :     A semicolon separated list of tag=value definitions. A POI is placed at the first
@@ -512,6 +505,16 @@
 
 : Default: entrance=main;entrance=yes;building=entrance
 
+;--max-same-poi-distance=distance
+: 	POIs with the same name and type within the specified distance of each other will be
+considered to be duplicates and only a single POI will be included on the map.
+See also the --include-nearby-poi-types option.
+Default: 0
+
+;--include-nearby-poi-types=type[,type...]
+: 	POIS of any type included in the comma separated list of types will not be excluded by
+the --max-same-poi-distance option unless they are at identical coordinates.
+
 ;--precomp-sea=directory|zipfile
 :     Defines the directory or a zip file that contains precompiled sea tiles. 
 Sea files in a zip file must be located in the zip files root directory or in 
@@ -576,7 +579,6 @@
 :: switches on the debugging of the flood blocker
 generates GPX files for each polygon checked by
 the flood blocker
-:
 
 ;--make-poi-index
 : 	Generate the POI index (not yet useful).
Index: resources/help/en/options
===================================================================
--- resources/help/en/options	(revision 3631)
+++ resources/help/en/options	(working copy)
@@ -506,6 +506,16 @@
     It is possible to define wildcards for tag values like entrance=*.
     Default: entrance=main;entrance=yes;building=entrance
 
+--max-same-poi-distance=distance
+  	POIs with the same name and type within the specified distance of each other will be
+    considered to be duplicates and only a single POI will be included on the map.
+    See also the --include-nearby-poi-types option.
+    Default: 0
+
+--include-nearby-poi-types=type[,type...]
+    POIS of any type included in the comma separated list of types will not be excluded by
+    the --max-same-poi-distance option unless they are at identical coordinates.
+
 --precomp-sea=directory|zipfile
     Defines the directory or a zip file that contains precompiled sea tiles. 
     Sea files in a zip file must be located in the zip file's root directory or in 
Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(revision 3631)
+++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(working copy)
@@ -144,6 +144,8 @@
 	private final boolean linkPOIsToWays;
 	private final boolean mergeRoads;
 	private final boolean routable;
+	private final int maxSamePointDistance;
+	private int[] includedNearbyPoiTypes;
 	
 
 	private LineAdder lineAdder = new LineAdder() {
@@ -204,10 +206,17 @@
 			lineAdder = overlayAdder;
 		linkPOIsToWays = props.getProperty("link-pois-to-ways", false);
 		
+		maxSamePointDistance = props.getProperty("max-same-poi-distance", 0);
+		String [] includeNearbyTypes = props.getProperty("include-nearby-poi-types", "").split(",");
+		includedNearbyPoiTypes = new int[includeNearbyTypes.length];
+		for (int i = includeNearbyTypes.length - 1; i >= 0; i--) {
+			if (includeNearbyTypes[i] != "")
+				includedNearbyPoiTypes[i] = Integer.decode(includeNearbyTypes[i]);
+		}
+
 		// undocumented option - usually used for debugging only
 		mergeRoads = props.getProperty("no-mergeroads", false) == false;
 		routable = props.containsKey("route");
-		
 	}
 
 	/** One type result for ways to avoid recreating one for each way. */ 
@@ -1027,9 +1036,9 @@
 		if (dupPOI){
 			if (log.isInfoEnabled()){
 				if (FakeIdGenerator.isFakeId(node.getId()))
-					log.info("ignmoring duplicate POI with type",GType.formatType(type),mp.getName(),"for generated element with id",node.getId(),"at",mp.getLocation().toDegreeString());
+					log.info("ignoring duplicate POI with type",GType.formatType(type),mp.getName(),"for generated element with id",node.getId(),"at",mp.getLocation().toDegreeString());
 				else 
-					log.info("ignmoring duplicate POI with type",GType.formatType(type),mp.getName(),"for element",node.toBrowseURL());
+					log.info("ignoring duplicate POI with type",GType.formatType(type),mp.getName(),"for element",node.toBrowseURL());
 			}
 			return;
 		}
@@ -1043,17 +1052,33 @@
 	 * @return
 	 */
 	private boolean checkDuplicatePOI(MapPoint mp) {
-		Map<String, MapPoint> typeMap = pointMap.get(mp.getType());
+		int type = mp.getType();
+		Map<String, MapPoint> typeMap = pointMap.get(type);
 		if (typeMap == null){
 			typeMap = new HashMap<>();
 			pointMap.put(mp.getType(), typeMap);
 		}
-		MapPoint old = typeMap.get(mp.getName());
+		String name = mp.getName();
+		MapPoint old = typeMap.get(name);
 		if (old == null){
 			typeMap.put(mp.getName(), mp);
 		} else {
-			if (old.getLocation().equals(mp.getLocation()))
-				return true;
+			Coord location = mp.getLocation();
+			Coord oldLocation = old.getLocation();
+			if ((location != null) && (oldLocation != null)) {
+					
+				if ((maxSamePointDistance == 0) && (oldLocation.equals(location)))
+					return true;
+				
+				if ((name != null) && (maxSamePointDistance > 0) && (location.distance(oldLocation) < maxSamePointDistance))
+				{
+					for (int i = includedNearbyPoiTypes.length - 1; i >= 0; i--) {
+						if (includedNearbyPoiTypes[i] == type)
+							return false;
+					}
+					return true;
+				}
+			}
 		}
 		return false;
 	}
