Index: applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
===================================================================
--- applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 2768)
+++ applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 2787)
@@ -18,5 +18,6 @@
     ElemStyle curStyle;
     ElemStyles styles;
-    String curWidth, curKey, curValue;
+    String curKey, curValue ;
+		int curWidth = 1, curRealWidth = 0;
 	int curMinZoom;
     ImageIcon curIcon;
@@ -78,7 +79,9 @@
                 {
                     if(atts.getQName(count).equals("width"))
-                        curWidth = atts.getValue(count);
+                        curWidth = Integer.parseInt(atts.getValue(count));
                     else if (atts.getQName(count).equals("colour"))
                         curColour=ColorHelper.html2color(atts.getValue(count));
+										else if (atts.getQName(count).equals("realwidth"))
+												curRealWidth=Integer.parseInt(atts.getValue(count));
                 }
             }
@@ -137,6 +140,8 @@
         {
             inLine = false;
-            curStyle = new LineElemStyle(Integer.parseInt(curWidth), curColour,
+            curStyle = new LineElemStyle(curWidth,curRealWidth, curColour,
 										curMinZoom);
+						curWidth=1;
+						curRealWidth = 0;
         }
         else if (inIcon && qName.equals("icon"))
Index: applications/editors/josm/plugins/mappaint/src/mappaint/LineElemStyle.java
===================================================================
--- applications/editors/josm/plugins/mappaint/src/mappaint/LineElemStyle.java	(revision 2768)
+++ applications/editors/josm/plugins/mappaint/src/mappaint/LineElemStyle.java	(revision 2787)
@@ -5,9 +5,11 @@
 {
 	int width;
+	int realWidth = 0; //the real width of this line in meter
 	Color colour;
 
-	public LineElemStyle (int width, Color colour, int minZoom)
+	public LineElemStyle (int width, int realWidth, Color colour, int minZoom)
 	{
 		this.width = width;
+		this.realWidth = realWidth;
 		this.colour = colour;
 		this.minZoom = minZoom;
@@ -17,4 +19,9 @@
 	{
 		return width;
+	}
+
+	public int getRealWidth()
+	{
+		return realWidth;
 	}
 
Index: applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java
===================================================================
--- applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 2768)
+++ applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 2787)
@@ -64,6 +64,8 @@
 	// Altered from SimplePaintVisitor
 	@Override public void visit(Way w) {
+		double circum = Main.map.mapView.getScale()*100*Main.proj.scaleFactor()*40041455; // circumference of the earth in meter
 		Color colour = getPreferencesColor("untagged",Color.GRAY);
-		int width=2;
+		int width = 2;
+		int realWidth = 0; //the real width of the element in meters 
 		boolean area=false;
 		ElemStyle wayStyle = MapPaintPlugin.elemStyles.getStyle(w);
@@ -74,4 +76,5 @@
 				colour = ((LineElemStyle)wayStyle).getColour();
 				width = ((LineElemStyle)wayStyle).getWidth();
+				realWidth = ((LineElemStyle)wayStyle).getRealWidth();	
 			}
 			else if (wayStyle instanceof AreaElemStyle)
@@ -96,4 +99,9 @@
 						drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,true);
 					else
+						if (realWidth > 0 && Main.pref.getBoolean("mappaint.useRealWith",false)){
+							int tmpWidth = (int) (100 /  (float) (circum / realWidth));
+							if (tmpWidth > width) width = tmpWidth;
+						}
+
 						drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,false);
 				if (!ls.incomplete && Main.pref.getBoolean("draw.segment.order_number"))
@@ -217,5 +225,5 @@
 	// Shows areas before non-areas
 	public void visitAll(DataSet data) {
-
+		
 		Collection<Way> noAreaWays = new LinkedList<Way>();
 
