Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java	(revision 24191)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java	(revision 24214)
@@ -134,4 +134,7 @@
 	private JCheckBox limitPathCountCheck;
 	private JTextField limitPathCount;
+	private JCheckBox splitOnColorChangeCheck;
+	private JCheckBox splitOnShapeClosedCheck;
+	private JCheckBox splitOnSingleSegmentCheck;
 
 
@@ -247,4 +250,8 @@
 		this.limitPathCountCheck = new JCheckBox(tr("Take only first X paths"));
 		this.limitPathCount = new JTextField("10000");
+
+		this.splitOnColorChangeCheck = new JCheckBox(tr("Color/width change"));
+		this.splitOnShapeClosedCheck = new JCheckBox(tr("Shape closed"));
+		this.splitOnSingleSegmentCheck = new JCheckBox(tr("Single segments"));
 
 		JPanel configPanel = new JPanel(new GridBagLayout());
@@ -293,8 +300,13 @@
 
 
-		JPanel selectFilePanel = new JPanel(new GridBagLayout());
-		selectFilePanel.setBorder(BorderFactory.createTitledBorder(tr("Load file")));
-		c.gridx = 0; c.gridy = 0; c.gridwidth = 1;
-		selectFilePanel.add(this.loadFileButton, c);
+		c.gridx = 0; c.gridy = 7; c.gridwidth = 1;
+		configPanel.add(new JLabel(tr("Introduce separate layers for:")), c);
+		c.gridx = 1; c.gridy = 7; c.gridwidth = 1;
+		configPanel.add(this.splitOnShapeClosedCheck, c);
+		c.gridx = 2; c.gridy = 7; c.gridwidth = 1;
+		configPanel.add(this.splitOnSingleSegmentCheck, c);
+		c.gridx = 1; c.gridy = 8; c.gridwidth = 1;
+		configPanel.add(this.splitOnColorChangeCheck, c);
+
 
 		JPanel projectionPanel = new JPanel(new GridBagLayout());
@@ -353,5 +365,5 @@
 		panel.add(configPanel, c);
 		c.gridx = 0; c.gridy = 1; c.gridwidth = 1;
-		panel.add(selectFilePanel, c);
+		panel.add(loadFileButton, c);
 		c.gridx = 0; c.gridy = 2; c.gridwidth = 1;
 		panel.add(projectionPanel, c);
@@ -552,4 +564,5 @@
 		fc.setAcceptAllFileFilterUsed(false);
 		fc.setMultiSelectionEnabled(false);
+		fc.setSelectedFile(this.fileName);
 		fc.setFileFilter(new FileFilter(){
 			@Override
@@ -671,5 +684,5 @@
 		monitor.setCustomText(tr("Parsing file"));
 
-		PathOptimizer data = new PathOptimizer(nodesTolerance, color);
+		PathOptimizer data = new PathOptimizer(nodesTolerance, color, this.splitOnColorChangeCheck.isSelected());
 
 		try {
@@ -709,4 +722,10 @@
 		}
 
+		if (nodesTolerance > 0.0) {
+			monitor.setTicks(83);
+			monitor.setCustomText(tr("Joining nodes"));
+			data.mergeNodes();
+		}
+
 		monitor.setTicks(85);
 		monitor.setCustomText(tr("Joining adjacent segments"));
@@ -748,5 +767,5 @@
 		monitor.setTicks(95);
 		monitor.setCustomText(tr("Finalizing layers"));
-		data.splitLayersByPathKind();
+		data.splitLayersByPathKind(this.splitOnShapeClosedCheck.isSelected(), this.splitOnSingleSegmentCheck.isSelected());
 		data.finish();
 
Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/OsmBuilder.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/OsmBuilder.java	(revision 24191)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/OsmBuilder.java	(revision 24214)
@@ -122,6 +122,8 @@
 	private Way insertWay(PdfPath path, Map<Point2D, Node> point2Node, int multipathId, boolean multipolygon) {
 
-		monitor.setExtraText(tr(" "+this.monitorPos+"/"+this.monitorTotal));
-		monitor.setTicks(this.monitorPos);
+		if (this.monitorPos % 100 == 0) {
+			monitor.setExtraText(tr(" "+this.monitorPos+"/"+this.monitorTotal));
+			monitor.setTicks(this.monitorPos);
+		}
 		this.monitorPos ++;
 
@@ -185,5 +187,5 @@
 		}
 
-		String s = Integer.toHexString(col.getRGB());
+		String s = Integer.toHexString(col.getRGB() & 0xffffff);
 		while (s.length() < 6) {
 			s = "0" + s;
Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java	(revision 24191)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java	(revision 24214)
@@ -21,8 +21,10 @@
 	private final double pointsTolerance;
 	private final Color color;
-
-	public PathOptimizer(double _pointsTolerance, Color _color)
+	boolean splitOnColorChange;
+
+	LayerContents prevLayer = null;
+
+	public PathOptimizer(double _pointsTolerance, Color _color, boolean _splitOnColorChange)
 	{
-
 		uniquePointMap = new HashMap<Point2D, Point2D>();
 		uniquePoints = new ArrayList<Point2D>();
@@ -31,4 +33,5 @@
 		pointsTolerance = _pointsTolerance;
 		color = _color;
+		splitOnColorChange = _splitOnColorChange;
 	}
 
@@ -161,8 +164,8 @@
 	}
 
-	public void splitLayersByPathKind() {
+	public void splitLayersByPathKind(boolean closed, boolean single) {
 		List<LayerContents> newLayers = new ArrayList<LayerContents>();
 		for(LayerContents l: this.layers) {
-			List<LayerContents> splitResult = splitBySegmentKind(l);
+			List<LayerContents> splitResult = splitBySegmentKind(l, closed, single);
 
 			for(LayerContents ll: splitResult) {
@@ -186,11 +189,17 @@
 
 	private LayerContents getLayer(LayerInfo info) {
-		LayerContents layer;
+
+		LayerContents layer = null;
 
 		if (this.layerMap.containsKey(info))
 		{
 			layer = this.layerMap.get(info);
-		}
-		else
+
+			if (layer != this.prevLayer && this.splitOnColorChange) {
+				layer = null;
+			}
+		}
+
+		if (layer == null)
 		{
 			layer = new LayerContents();
@@ -201,4 +210,5 @@
 		}
 
+		this.prevLayer = layer;
 		return layer;
 	}
@@ -573,6 +583,10 @@
 	}
 
-	private List<LayerContents> splitBySegmentKind(LayerContents layer)
+	private List<LayerContents> splitBySegmentKind(LayerContents layer, boolean closed, boolean single)
 	{
+		if (!closed && !single) {
+			return Collections.singletonList(layer);
+		}
+
 		List<PdfPath> singleSegmentPaths = new ArrayList<PdfPath>();
 		List<PdfPath> multiSegmentPaths = new ArrayList<PdfPath>();
@@ -580,12 +594,12 @@
 
 		for(PdfPath path: layer.paths) {
-			if (path.points.size() <= 3) {
+			if (path.points.size() <= 3 && single) {
 				singleSegmentPaths.add(path);
 			}
-			else if (path.isClosed()) {
+			else if (!path.isClosed() && closed) {
+				multiSegmentPaths.add(path);
+			}
+			else {
 				closedPaths.add(path);
-			}
-			else {
-				multiSegmentPaths.add(path);
 			}
 		}
Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/pdfbox/GraphicsProcessor.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/pdfbox/GraphicsProcessor.java	(revision 24191)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/pdfbox/GraphicsProcessor.java	(revision 24214)
@@ -48,5 +48,8 @@
 	private void addPath(Shape s, boolean closed) {
 		pathNo ++;
-		this.monitor.setCustomText(tr(" {0} objects so far", pathNo));
+
+		if (pathNo % 100 == 0) {
+			this.monitor.setCustomText(tr(" {0} objects so far", pathNo));
+		}
 
 		if (pathNo >= maxPaths) {
