Index: /applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/panels/PanelMain.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/panels/PanelMain.java	(revision 29215)
@@ -25,13 +25,29 @@
 		}
 	};
-	private JButton openButton = null;
-	final JFileChooser fc = new JFileChooser();
-	private ActionListener alOpen = new ActionListener() {
+	private JButton importButton = null;
+	final JFileChooser ifc = new JFileChooser();
+	private ActionListener alImport = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (e.getSource() == openButton) {
+			if (e.getSource() == importButton) {
         messageBar.setText("Select file");
-        int returnVal = fc.showOpenDialog(Main.parent);
+        int returnVal = ifc.showOpenDialog(Main.parent);
         if (returnVal == JFileChooser.APPROVE_OPTION) {
-          Smed2Action.panelS57.startImport(fc.getSelectedFile());
+          Smed2Action.panelS57.startImport(ifc.getSelectedFile());
+         } else {
+           messageBar.setText("");
+         }
+      }
+		}
+	};
+
+	private JButton exportButton = null;
+	final JFileChooser efc = new JFileChooser();
+	private ActionListener alExport = new ActionListener() {
+		public void actionPerformed(java.awt.event.ActionEvent e) {
+			if (e.getSource() == exportButton) {
+        messageBar.setText("Select file");
+        int returnVal = efc.showOpenDialog(Main.parent);
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+          Smed2Action.panelS57.startExport(efc.getSelectedFile());
          } else {
            messageBar.setText("");
@@ -54,12 +70,16 @@
 		
     messageBar = new JTextField();
-    messageBar.setBounds(40, 430, 320, 20);
+    messageBar.setBounds(70, 430, 290, 20);
     messageBar.setEditable(false);
     messageBar.setBackground(Color.WHITE);
     add(messageBar);
-		openButton = new JButton(new ImageIcon(getClass().getResource("/images/fileButton.png")));
-		openButton.setBounds(10, 430, 20, 20);
-		add(openButton);
-		openButton.addActionListener(alOpen);
+		importButton = new JButton(new ImageIcon(getClass().getResource("/images/importButton.png")));
+		importButton.setBounds(10, 430, 20, 20);
+		add(importButton);
+		importButton.addActionListener(alImport);
+		exportButton = new JButton(new ImageIcon(getClass().getResource("/images/exportButton.png")));
+		exportButton.setBounds(40, 430, 20, 20);
+		add(exportButton);
+		exportButton.addActionListener(alExport);
 		saveButton = new JButton();
 		saveButton.setBounds(370, 430, 100, 20);
Index: /applications/editors/josm/plugins/smed2/src/s57/S57att.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/s57/S57att.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/s57/S57att.java	(revision 29215)
@@ -246,5 +246,5 @@
 	
 	public static Att enumAttribute(String attribute, Obj obj) {	// Convert OSeaM attribute string to OSeaM enumeration
-	  if ((attribute != null) && (attribute.length() > 0)) {
+	  if ((attribute != null) && !attribute.isEmpty()) {
 	    for (Att att : AttStr.keySet()) {
 	      if (AttStr.get(att).equals(attribute) && (verifyAttribute(obj, att) != Ver.NON ))
Index: /applications/editors/josm/plugins/smed2/src/s57/S57dat.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/s57/S57dat.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/s57/S57dat.java	(revision 29215)
@@ -7,5 +7,5 @@
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.IOException;
 
@@ -66,4 +66,6 @@
 	private File importFile;
 	private FileInputStream inp;
+	private File exportFile;
+	private FileOutputStream outp;
 	private OsmDataLayer layer;
 	private DataSet data;
@@ -74,7 +76,18 @@
 			if (e.getSource() == importButton) {
 				readFile();
-		    Smed2Action.panelS57.setVisible(false);
-		    Smed2Action.panelMain.setVisible(true);
+		    Smed2Action.panelS57.setVisible(true);
+		    Smed2Action.panelMain.setVisible(false);
         PanelMain.messageBar.setText("File imported");
+      }
+		}
+	};
+	private JButton exportButton;
+	private ActionListener alExport = new ActionListener() {
+		public void actionPerformed(java.awt.event.ActionEvent e) {
+			if (e.getSource() == exportButton) {
+				writeFile();
+		    Smed2Action.panelS57.setVisible(true);
+		    Smed2Action.panelMain.setVisible(false);
+        PanelMain.messageBar.setText("File exported");
       }
 		}
@@ -89,5 +102,5 @@
 		    Smed2Action.panelS57.setVisible(false);
 		    Smed2Action.panelMain.setVisible(true);
-        PanelMain.messageBar.setText("Import cancelled");
+        PanelMain.messageBar.setText("Operation cancelled");
       }
 		}
@@ -108,4 +121,9 @@
 		importButton.addActionListener(alImport);
 		add(importButton);
+		exportButton = new JButton();
+		exportButton.setBounds(370, 430, 100, 20);
+		exportButton.setText(tr("Export"));
+		exportButton.addActionListener(alExport);
+		add(exportButton);
 	}
 
@@ -120,4 +138,19 @@
     Smed2Action.panelMain.setVisible(false);
     Smed2Action.panelS57.setVisible(true);
+	}
+
+	public void startExport(File file) {
+		exportFile = file;
+		try {
+			outp = new FileOutputStream(file);
+		} catch (IOException e) {
+      PanelMain.messageBar.setText("Failed to open file");
+			return;
+		}
+    Smed2Action.panelMain.setVisible(false);
+    Smed2Action.panelS57.setVisible(true);
+	}
+
+	private void writeFile() {
 	}
 
Index: /applications/editors/josm/plugins/smed2/src/s57/S57obj.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/s57/S57obj.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/s57/S57obj.java	(revision 29215)
@@ -150,5 +150,6 @@
 	static {
 		for (Map.Entry<Obj, String> entry : ObjStr.entrySet()) {
-			StrObj.put(entry.getValue(), entry.getKey());
+			if (!entry.getValue().isEmpty())
+				StrObj.put(entry.getValue(), entry.getKey());
 		}
 	}
@@ -173,5 +174,5 @@
 
 	public static Obj enumType(String type) { // Convert OSeaM object string to OSeaM object enumeration
-		if (StrObj.containsKey(type))
+		if ((type != null) && !type.isEmpty() && (StrObj.containsKey(type)))
 			return StrObj.get(type);
 		else
Index: /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29215)
@@ -71,5 +71,5 @@
 	}
 
-	public static double calcArea(Feature feature) {
+	public static double signedArea(Feature feature) {
 	  if (feature.flag == Fflag.AREA) {
 			ArrayList<Long> way;
@@ -91,7 +91,15 @@
 				llat = lat;
 	    }
-	    return Math.abs(sigma) * 3444 * 3444 / 2.0;
+	    return sigma;
 	  }
-	  return 0.0;
+	  return 0;
+	}
+
+	public boolean handOfArea(Feature feature) {
+		return (signedArea(feature) < 0);
+	}
+	
+	public static double calcArea(Feature feature) {
+	  return Math.abs(signedArea(feature)) * 3444 * 3444 / 2.0;
 	}
 
Index: /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29215)
@@ -26,4 +26,25 @@
 		UNKN, NODE, LINE, AREA
 	}
+	
+	public enum Nflag {
+		ANON, ISOL, CONN
+	}
+
+	public class Coord {
+		public double lat;
+		public double lon;
+		public Nflag flg;
+
+		public Coord(double ilat, double ilon) {
+			lat = ilat;
+			lon = ilon;
+			flg = Nflag.ANON;
+		}
+		public Coord(double ilat, double ilon, Nflag iflg) {
+			lat = ilat;
+			lon = ilon;
+			flg = iflg;
+		}
+	}
 
 	public class AttItem {
@@ -98,14 +119,4 @@
 			atts = new AttMap();
 			objs = new ObjMap();
-		}
-	}
-
-	public class Coord {
-		public double lat;
-		public double lon;
-
-		public Coord(double ilat, double ilon) {
-			lat = ilat;
-			lon = ilon;
 		}
 	}
Index: /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29214)
+++ /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29215)
@@ -112,5 +112,5 @@
 		editFrame.setResizable(true);
 		editFrame.setAlwaysOnTop(true);
-		editFrame.setVisible(false);
+		editFrame.setVisible(true);
 		panelMain = new PanelMain();
 		editFrame.add(panelMain);
