Index: /applications/editors/josm/plugins/smed2/src/seamap/MapHelper.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/MapHelper.java	(revision 29174)
+++ /applications/editors/josm/plugins/smed2/src/seamap/MapHelper.java	(revision 29174)
@@ -0,0 +1,9 @@
+package seamap;
+
+import java.awt.geom.Point2D;
+
+import seamap.SeaMap.Coord;
+
+public interface MapHelper {
+	Point2D getPoint(Coord coord);
+}
Index: plications/editors/josm/plugins/smed2/src/seamap/Render.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Render.java	(revision 29173)
+++ 	(revision )
@@ -1,14 +1,0 @@
-/* Copyright 2013 Malcolm Herring
- *
- * This is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
- */
-
-package seamap;
-
-public class Render {
-
-}
Index: /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29174)
+++ /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29174)
@@ -0,0 +1,47 @@
+/* Copyright 2013 Malcolm Herring
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
+ */
+
+package seamap;
+
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+
+import seamap.SeaMap.*;
+import symbols.Symbols;
+import symbols.Symbols.*;
+
+public class Renderer {
+	
+	static MapHelper helper;
+	static SeaMap map;
+	static double sScale;
+	static double tScale;
+	static Graphics2D g2;
+	
+	public static void reRender(Graphics2D g, int zoom, double factor, SeaMap m, MapHelper h) {
+		g2 = g;
+		helper = h;
+		map = m;
+		sScale = Symbols.symbolScale[zoom]*factor;
+		tScale = Symbols.textScale[zoom]*factor;
+		if (map != null) {
+			g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+			g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
+			Rules.MainRules(map, zoom);
+		}
+	}
+	
+	public static void symbol(Feature feature, ArrayList<Instr> symbol) {
+		Point2D point = helper.getPoint(map.nodes.get(feature.refs));
+		Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, null);
+	}
+	
+}
Index: /applications/editors/josm/plugins/smed2/src/seamap/Rules.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29173)
+++ /applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29174)
@@ -10,103 +10,148 @@
 package seamap;
 
-import s57.S57obj.Obj;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+
+import s57.S57att;
+import s57.S57val.BcnSHP;
+import s57.S57att.*;
+import s57.S57obj;
+import s57.S57obj.*;
+import s57.S57val;
+import s57.S57val.*;
+
+import seamap.SeaMap.AttItem;
 import seamap.SeaMap.Feature;
+import symbols.Beacons;
+import symbols.Symbols.Instr;
 
 public class Rules {
 
-	public static void MainRules (SeaMap map) {
-		for (Feature feature : map.features.get(Obj.SLCONS)) shoreline(feature);
-		for (Feature feature : map.features.get(Obj.PIPSOL)) pipelines(feature);
-		for (Feature feature : map.features.get(Obj.CBLSUB)) cables(feature);
-		for (Feature feature : map.features.get(Obj.PIPOHD)) pipelines(feature);
-		for (Feature feature : map.features.get(Obj.CBLOHD)) cables(feature);
-		for (Feature feature : map.features.get(Obj.TSEZNE)) separation(feature);
-		for (Feature feature : map.features.get(Obj.TSSCRS)) separation(feature);
-		for (Feature feature : map.features.get(Obj.TSSRON)) separation(feature);
-		for (Feature feature : map.features.get(Obj.TSELNE)) separation(feature);
-		for (Feature feature : map.features.get(Obj.TSSLPT)) separation(feature);
-		for (Feature feature : map.features.get(Obj.TSSBND)) separation(feature);
-		for (Feature feature : map.features.get(Obj.SNDWAV)) areas(feature);
-		for (Feature feature : map.features.get(Obj.OSPARE)) areas(feature);
-		for (Feature feature : map.features.get(Obj.FAIRWY)) areas(feature);
-		for (Feature feature : map.features.get(Obj.DRGARE)) areas(feature);
-		for (Feature feature : map.features.get(Obj.RESARE)) areas(feature);
-		for (Feature feature : map.features.get(Obj.SPLARE)) areas(feature);
-		for (Feature feature : map.features.get(Obj.SEAARE)) areas(feature);
-		for (Feature feature : map.features.get(Obj.OBSTRN)) obstructions(feature);
-		for (Feature feature : map.features.get(Obj.UWTROC)) obstructions(feature);
-		for (Feature feature : map.features.get(Obj.MARCUL)) areas(feature);
-		for (Feature feature : map.features.get(Obj.WTWAXS)) waterways(feature);
-		for (Feature feature : map.features.get(Obj.RECTRC)) transits(feature);
-		for (Feature feature : map.features.get(Obj.NAVLNE)) transits(feature);
-		for (Feature feature : map.features.get(Obj.HRBFAC)) harbours(feature);
-		for (Feature feature : map.features.get(Obj.ACHARE)) harbours(feature);
-		for (Feature feature : map.features.get(Obj.ACHBRT)) harbours(feature);
-		for (Feature feature : map.features.get(Obj.LOKBSN)) locks(feature);
-		for (Feature feature : map.features.get(Obj.LKBSPT)) locks(feature);
-		for (Feature feature : map.features.get(Obj.GATCON)) locks(feature);
-		for (Feature feature : map.features.get(Obj.DISMAR)) distances(feature);
-		for (Feature feature : map.features.get(Obj.HULKES)) ports(feature);
-		for (Feature feature : map.features.get(Obj.CRANES)) ports(feature);
-		for (Feature feature : map.features.get(Obj.LNDMRK)) landmarks(feature);
-		for (Feature feature : map.features.get(Obj.MORFAC)) moorings(feature);
-		for (Feature feature : map.features.get(Obj.NOTMRK)) notices(feature);
-		for (Feature feature : map.features.get(Obj.SMCFAC)) marinas(feature);
-		for (Feature feature : map.features.get(Obj.BRIDGE)) bridges(feature);
-		for (Feature feature : map.features.get(Obj.LITMAJ)) lights(feature);
-		for (Feature feature : map.features.get(Obj.LITMIN)) lights(feature);
-		for (Feature feature : map.features.get(Obj.LIGHTS)) lights(feature);
-		for (Feature feature : map.features.get(Obj.SISTAT)) signals(feature);
-		for (Feature feature : map.features.get(Obj.SISTAW)) signals(feature);
-		for (Feature feature : map.features.get(Obj.CGUSTA)) signals(feature);
-		for (Feature feature : map.features.get(Obj.RDOSTA)) signals(feature);
-		for (Feature feature : map.features.get(Obj.RADSTA)) signals(feature);
-		for (Feature feature : map.features.get(Obj.RSCSTA)) signals(feature);
-		for (Feature feature : map.features.get(Obj.PILBOP)) signals(feature);
-		for (Feature feature : map.features.get(Obj.WTWGAG)) gauges(feature);
-		for (Feature feature : map.features.get(Obj.OFSPLF)) platforms(feature);
-		for (Feature feature : map.features.get(Obj.WRECKS)) wrecks(feature);
-		for (Feature feature : map.features.get(Obj.LITVES)) floats(feature);
-		for (Feature feature : map.features.get(Obj.LITFLT)) floats(feature);
-		for (Feature feature : map.features.get(Obj.BOYINB)) floats(feature);
-		for (Feature feature : map.features.get(Obj.BOYLAT)) buoys(feature);
-		for (Feature feature : map.features.get(Obj.BOYCAR)) buoys(feature);
-		for (Feature feature : map.features.get(Obj.BOYISD)) buoys(feature);
-		for (Feature feature : map.features.get(Obj.BOYSAW)) buoys(feature);
-		for (Feature feature : map.features.get(Obj.BOYSPP)) buoys(feature);
-		for (Feature feature : map.features.get(Obj.BOYWTW)) buoys(feature);
-		for (Feature feature : map.features.get(Obj.BCNLAT)) beacons(feature);
-		for (Feature feature : map.features.get(Obj.BCNCAR)) beacons(feature);
-		for (Feature feature : map.features.get(Obj.BCNISD)) beacons(feature);
-		for (Feature feature : map.features.get(Obj.BCNSAW)) beacons(feature);
-		for (Feature feature : map.features.get(Obj.BCNSPP)) beacons(feature);
-		for (Feature feature : map.features.get(Obj.BCNWTW)) beacons(feature);
+	static SeaMap map;
+	static int zoom;
+	
+	public static void MainRules (SeaMap m, int z) {
+		map = m;
+		zoom = z;
+		ArrayList<Feature> feature;
+		if ((feature = map.features.get(Obj.SLCONS)) != null) shoreline(feature);
+		if ((feature = map.features.get(Obj.SLCONS)) != null) shoreline(feature);
+		if ((feature = map.features.get(Obj.PIPSOL)) != null) pipelines(feature);
+		if ((feature = map.features.get(Obj.CBLSUB)) != null) cables(feature);
+		if ((feature = map.features.get(Obj.PIPOHD)) != null) pipelines(feature);
+		if ((feature = map.features.get(Obj.CBLOHD)) != null) cables(feature);
+		if ((feature = map.features.get(Obj.TSEZNE)) != null) separation(feature);
+		if ((feature = map.features.get(Obj.TSSCRS)) != null) separation(feature);
+		if ((feature = map.features.get(Obj.TSSRON)) != null) separation(feature);
+		if ((feature = map.features.get(Obj.TSELNE)) != null) separation(feature);
+		if ((feature = map.features.get(Obj.TSSLPT)) != null) separation(feature);
+		if ((feature = map.features.get(Obj.TSSBND)) != null) separation(feature);
+		if ((feature = map.features.get(Obj.SNDWAV)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.OSPARE)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.FAIRWY)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.DRGARE)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.RESARE)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.SPLARE)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.SEAARE)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.OBSTRN)) != null) obstructions(feature);
+		if ((feature = map.features.get(Obj.UWTROC)) != null) obstructions(feature);
+		if ((feature = map.features.get(Obj.MARCUL)) != null) areas(feature);
+		if ((feature = map.features.get(Obj.WTWAXS)) != null) waterways(feature);
+		if ((feature = map.features.get(Obj.RECTRC)) != null) transits(feature);
+		if ((feature = map.features.get(Obj.NAVLNE)) != null) transits(feature);
+		if ((feature = map.features.get(Obj.HRBFAC)) != null) harbours(feature);
+		if ((feature = map.features.get(Obj.ACHARE)) != null) harbours(feature);
+		if ((feature = map.features.get(Obj.ACHBRT)) != null) harbours(feature);
+		if ((feature = map.features.get(Obj.LOKBSN)) != null) locks(feature);
+		if ((feature = map.features.get(Obj.LKBSPT)) != null) locks(feature);
+		if ((feature = map.features.get(Obj.GATCON)) != null) locks(feature);
+		if ((feature = map.features.get(Obj.DISMAR)) != null) distances(feature);
+		if ((feature = map.features.get(Obj.HULKES)) != null) ports(feature);
+		if ((feature = map.features.get(Obj.CRANES)) != null) ports(feature);
+		if ((feature = map.features.get(Obj.LNDMRK)) != null) landmarks(feature);
+		if ((feature = map.features.get(Obj.MORFAC)) != null) moorings(feature);
+		if ((feature = map.features.get(Obj.NOTMRK)) != null) notices(feature);
+		if ((feature = map.features.get(Obj.SMCFAC)) != null) marinas(feature);
+		if ((feature = map.features.get(Obj.BRIDGE)) != null) bridges(feature);
+		if ((feature = map.features.get(Obj.LITMAJ)) != null) lights(feature);
+		if ((feature = map.features.get(Obj.LITMIN)) != null) lights(feature);
+		if ((feature = map.features.get(Obj.LIGHTS)) != null) lights(feature);
+		if ((feature = map.features.get(Obj.SISTAT)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.SISTAW)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.CGUSTA)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.RDOSTA)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.RADSTA)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.RSCSTA)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.PILBOP)) != null) signals(feature);
+		if ((feature = map.features.get(Obj.WTWGAG)) != null) gauges(feature);
+		if ((feature = map.features.get(Obj.OFSPLF)) != null) platforms(feature);
+		if ((feature = map.features.get(Obj.WRECKS)) != null) wrecks(feature);
+		if ((feature = map.features.get(Obj.LITVES)) != null) floats(feature);
+		if ((feature = map.features.get(Obj.LITFLT)) != null) floats(feature);
+		if ((feature = map.features.get(Obj.BOYINB)) != null) floats(feature);
+		if ((feature = map.features.get(Obj.BOYLAT)) != null) buoys(feature);
+		if ((feature = map.features.get(Obj.BOYCAR)) != null) buoys(feature);
+		if ((feature = map.features.get(Obj.BOYISD)) != null) buoys(feature);
+		if ((feature = map.features.get(Obj.BOYSAW)) != null) buoys(feature);
+		if ((feature = map.features.get(Obj.BOYSPP)) != null) buoys(feature);
+		if ((feature = map.features.get(Obj.BOYWTW)) != null) buoys(feature);
+		if ((feature = map.features.get(Obj.BCNLAT)) != null) beacons(feature);
+		if ((feature = map.features.get(Obj.BCNCAR)) != null) beacons(feature);
+		if ((feature = map.features.get(Obj.BCNISD)) != null) beacons(feature);
+		if ((feature = map.features.get(Obj.BCNSAW)) != null) beacons(feature);
+		if ((feature = map.features.get(Obj.BCNSPP)) != null) beacons(feature);
+		if ((feature = map.features.get(Obj.BCNWTW)) != null) beacons(feature);
 	}
 	
-	private static void shoreline(Feature feature) {}
-	private static void pipelines(Feature feature) {}
-	private static void cables(Feature feature) {}
-	private static void separation(Feature feature) {}
-	private static void areas(Feature feature) {}
-	private static void obstructions(Feature feature) {}
-	private static void waterways(Feature feature) {}
-	private static void transits(Feature feature) {}
-	private static void harbours(Feature feature) {}
-	private static void locks(Feature feature) {}
-	private static void distances(Feature feature) {}
-	private static void ports(Feature feature) {}
-	private static void landmarks(Feature feature) {}
-	private static void moorings(Feature feature) {}
-	private static void notices(Feature feature) {}
-	private static void marinas(Feature feature) {}
-	private static void bridges(Feature feature) {}
-	private static void lights(Feature feature) {}
-	private static void floats(Feature feature) {}
-	private static void signals(Feature feature) {}
-	private static void wrecks(Feature feature) {}
-	private static void gauges(Feature feature) {}
-	private static void platforms(Feature feature) {}
-	private static void buoys(Feature feature) {}
-	private static void beacons(Feature feature) {}
-
+	private static void shoreline(ArrayList<Feature> features) {
+		for (Feature feature : features) {
+		}
+	}
+	private static void pipelines(ArrayList<Feature> features) {}
+	private static void cables(ArrayList<Feature> features) {}
+	private static void separation(ArrayList<Feature> features) {}
+	private static void areas(ArrayList<Feature> features) {}
+	private static void obstructions(ArrayList<Feature> features) {}
+	private static void waterways(ArrayList<Feature> features) {}
+	private static void transits(ArrayList<Feature> features) {}
+	private static void harbours(ArrayList<Feature> features) {}
+	private static void locks(ArrayList<Feature> features) {}
+	private static void distances(ArrayList<Feature> features) {}
+	private static void ports(ArrayList<Feature> features) {}
+	private static void landmarks(ArrayList<Feature> features) {}
+	private static void moorings(ArrayList<Feature> features) {}
+	private static void notices(ArrayList<Feature> features) {}
+	private static void marinas(ArrayList<Feature> features) {}
+	private static void bridges(ArrayList<Feature> features) {}
+	private static void lights(ArrayList<Feature> features) {}
+	private static void floats(ArrayList<Feature> features) {}
+	private static void signals(ArrayList<Feature> features) {}
+	private static void wrecks(ArrayList<Feature> features) {}
+	private static void gauges(ArrayList<Feature> features) {}
+	private static void platforms(ArrayList<Feature> features) {}
+	private static void buoys(ArrayList<Feature> features) {}
+	private static void beacons(ArrayList<Feature> features) {
+		for (Feature feature : features) {
+			BcnSHP shape;
+			HashMap<Integer, EnumMap<Att, AttItem>> objs = feature.objs.get(feature.type);
+			if (objs == null) shape = BcnSHP.BCN_UNKN;
+			else {
+				EnumMap<Att, AttItem> atts = objs.get(0);
+				if (atts == null) shape = BcnSHP.BCN_UNKN;
+				else {
+					AttItem item = atts.get(Att.BCNSHP);
+					if (item == null) shape = BcnSHP.BCN_UNKN;
+					else shape = (BcnSHP) item.val;
+				}
+			}
+			if (shape == BcnSHP.BCN_PRCH) {
+				
+			} else if (shape == BcnSHP.BCN_WTHY) {
+					
+			} else {
+				Renderer.symbol(feature, Beacons.Shapes.get(shape));
+			}
+		}
+	}
 }
Index: /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29173)
+++ /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29174)
@@ -54,6 +54,6 @@
 
 	public class Coord {
-		double lat;
-		double lon;
+		public double lat;
+		public double lon;
 
 		Coord(double ilat, double ilon) {
@@ -67,8 +67,4 @@
 	public HashMap<Long, ArrayList<Long>> mpolys;
 	public EnumMap<Obj, ArrayList<Feature>> features;
-	public double minlat;
-	public double minlon;
-	public double maxlat;
-	public double maxlon;
 
 	private Feature feature;
@@ -149,4 +145,5 @@
 				if (atts == null) {
 					atts = new EnumMap<Att, AttItem>(Att.class);
+					items.put(idx, atts);
 				}
 				AttVal attval = S57val.convertValue(val, att);
Index: /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29173)
+++ /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29174)
@@ -1,6 +1,7 @@
 package smed2;
 
+import java.awt.Color;
 import java.awt.Graphics2D;
-import java.awt.RenderingHints;
+import java.awt.geom.Point2D;
 
 import javax.swing.Action;
@@ -8,4 +9,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
@@ -14,16 +16,28 @@
 import org.openstreetmap.josm.gui.layer.ImageryLayer;
 
+import seamap.MapHelper;
+import seamap.Renderer;
 import seamap.SeaMap;
-import symbols.Symbols;
-import symbols.Buoys;
+import seamap.SeaMap.Coord;
 
-public class MapImage extends ImageryLayer implements ZoomChangeListener {
+public class MapImage extends ImageryLayer implements ZoomChangeListener, MapHelper {
 
 	private SeaMap mapdata;
+//	private Params imageParams;
+	private Renderer renderer;
+
+	private double top;
+	private double bottom;
+	private double left;
+	private double right;
+	private double width;
+	private double height;
 	private int zoom;
 	
 	public MapImage(ImageryInfo info, SeaMap map) {
 		super(info);
+		zoomChanged();
 		MapView.addZoomChangeListener(this);
+		mapdata = map;
 	}
 	
@@ -50,16 +64,25 @@
 	@Override
 	public void paint(Graphics2D g2, MapView mv, Bounds bb) {
-		double scale = Symbols.symbolScale[zoom]*Math.pow(2, (zoom-12));
-		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-		g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
-		Symbols.drawSymbol(g2, Buoys.Pillar, scale, 768, 768, null, null);
-		g2.drawString(String.valueOf(zoom), 768, 800);
+		g2.setPaint(new Color(0xb5d0d0));
+		g2.fill(Main.map.mapView.getBounds());
+		Renderer.reRender(g2, zoom, Math.pow(2, (zoom-12)), mapdata, this);
 	}
 
 	@Override
 	public void zoomChanged() {
-		Bounds bounds = Main.map.mapView.getRealBounds();
-		zoom = ((int)Math.min(18, Math.max(9, Math.round(Math.floor(Math.log(4096/bounds.asRect().width)/Math.log(2))))));
+		if ((Main.map != null) && (Main.map.mapView != null)) {
+			Bounds bounds = Main.map.mapView.getRealBounds();
+			top = bounds.getMax().lat();
+			bottom = bounds.getMin().lat();
+			left = bounds.getMin().lon();
+			right = bounds.getMax().lon();
+			width = Main.map.mapView.getBounds().getWidth();
+			height = Main.map.mapView.getBounds().getHeight();
+			zoom = ((int) Math.min(18, Math.max(9, Math.round(Math.floor(Math.log(4096 / bounds.asRect().width) / Math.log(2))))));
+		}
 	}
 
+	public Point2D getPoint(Coord coord) {
+		return Main.map.mapView.getPoint2D(new LatLon(coord.lat, coord.lon));
+	}
 }
Index: /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29173)
+++ /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29174)
@@ -121,5 +121,7 @@
 		// System.out.println("hello");
 		rendering = new MapImage(new ImageryInfo("OpenSeaMap"), map);
+		rendering.setBackgroundLayer(true);
 		Main.main.addLayer(rendering);
+		reMap();
 	}
 
@@ -130,6 +132,6 @@
 			frame.setVisible(false);
 			frame.dispose();
-			data = null;
-			map = null;
+//			data = null;
+//			map = null;
 		}
 		isOpen = false;
@@ -159,23 +161,25 @@
 	void reMap() {
 		map = new SeaMap();
-		for (OsmPrimitive osm : data) {
-			if ((osm instanceof Node) || (osm instanceof Way)) {
-				if (osm instanceof Node) {
-					map.addNode(((Node) osm).getUniqueId(), ((Node) osm).getCoor().lat(), ((Node) osm).getCoor().lon());
-				} else {
-					map.addWay(((Way) osm).getUniqueId());
-					for (Node node : ((Way) osm).getNodes()) {
-						map.addToWay((node.getUniqueId()));
+		if (data != null) {
+			for (OsmPrimitive osm : data) {
+				if ((osm instanceof Node) || (osm instanceof Way)) {
+					if (osm instanceof Node) {
+						map.addNode(((Node) osm).getUniqueId(), ((Node) osm).getCoor().lat(), ((Node) osm).getCoor().lon());
+					} else {
+						map.addWay(((Way) osm).getUniqueId());
+						for (Node node : ((Way) osm).getNodes()) {
+							map.addToWay((node.getUniqueId()));
+						}
 					}
-				}
-				for (Entry<String, String> entry : osm.getKeys().entrySet()) {
-					map.addTag(entry.getKey(), entry.getValue());
-				}
-				map.tagsDone();
-			} else if ((osm instanceof Relation) && ((Relation) osm).isMultipolygon()) {
-				map.addMpoly(((Relation) osm).getUniqueId());
-				for (RelationMember mem : ((Relation) osm).getMembers()) {
-					if (mem.getType() == OsmPrimitiveType.WAY)
-						map.addToMpoly(mem.getUniqueId(), (mem.getRole().equals("outer")));
+					for (Entry<String, String> entry : osm.getKeys().entrySet()) {
+						map.addTag(entry.getKey(), entry.getValue());
+					}
+					map.tagsDone();
+				} else if ((osm instanceof Relation) && ((Relation) osm).isMultipolygon()) {
+					map.addMpoly(((Relation) osm).getUniqueId());
+					for (RelationMember mem : ((Relation) osm).getMembers()) {
+						if (mem.getType() == OsmPrimitiveType.WAY)
+							map.addToMpoly(mem.getUniqueId(), (mem.getRole().equals("outer")));
+					}
 				}
 			}
Index: /applications/editors/josm/plugins/smed2/src/symbols/Beacons.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/symbols/Beacons.java	(revision 29173)
+++ /applications/editors/josm/plugins/smed2/src/symbols/Beacons.java	(revision 29174)
@@ -17,9 +17,13 @@
 import java.awt.geom.Path2D;
 import java.util.ArrayList;
+import java.util.EnumMap;
 
 import symbols.Symbols.Instr;
 import symbols.Symbols.Prim;
 
+import s57.S57val.*;
+
 public class Beacons {
+	
 	public static final ArrayList<Instr> Beacon = new ArrayList<Instr>();
 	static {
@@ -155,3 +159,10 @@
 		WithyStarboard.add(new Instr(Prim.LINE, new Line2D.Double(-30,-21,0,-35)));
 	}
+	
+	public static final EnumMap<BcnSHP, ArrayList<Instr>> Shapes = new EnumMap<BcnSHP, ArrayList<Instr>>(BcnSHP.class);
+	static {
+		Shapes.put(BcnSHP.BCN_UNKN, Beacons.Beacon); Shapes.put(BcnSHP.BCN_STAK, Beacons.Stake); Shapes.put(BcnSHP.BCN_TOWR, Beacons.Tower);
+		Shapes.put(BcnSHP.BCN_LATT, Beacons.Beacon); Shapes.put(BcnSHP.BCN_PILE, Beacons.Beacon); Shapes.put(BcnSHP.BCN_POLE, Beacons.Stake);
+		Shapes.put(BcnSHP.BCN_CARN, Beacons.Cairn); Shapes.put(BcnSHP.BCN_BUOY, Beacons.Beacon); Shapes.put(BcnSHP.BCN_POST, Beacons.Stake);
+	}
 }
