Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/FilePlacement.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/FilePlacement.java	(revision 24077)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/FilePlacement.java	(revision 24080)
@@ -91,13 +91,19 @@
 	}
 
+	EastNorth en = new EastNorth(0, 0);
+
 	public LatLon tranformCoords(double x, double y) {
 
 		if (this.projection == null){
-			return new LatLon(y/1000, x/1000);
+			//en.setLocation(x * 1024,y * 1024);
+			//return Main.proj.eastNorth2latlon( en);
+			return new LatLon(y / 1000, x / 1000);
 		}
 		else{
+
 			x = (x - this.minX) * (this.maxEast - this.minEast) / (this.maxX - this.minX)  + this.minEast;
 			y = (y - this.minY) * (this.maxNorth - this.minNorth) /  (this.maxY - this.minY) + this.minNorth;
-			return this.projection.eastNorth2latlon(new EastNorth(x, y));
+			en.setLocation(x,y);
+			return this.projection.eastNorth2latlon(en);
 		}
 	}
@@ -105,4 +111,7 @@
 	public EastNorth reverseTransform(LatLon coor) {
 		if (this.projection == null){
+			//EastNorth result = this.projection.latlon2eastNorth(coor);
+			//result.setLocation(result.east() / 1024, result.north() / 1024);
+			//return result;
 			return new EastNorth(coor.lon() * 1000, coor.lat() * 1000);
 		}
Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java	(revision 24077)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java	(revision 24080)
@@ -78,4 +78,8 @@
 	private JTextField colorFilterColor;
 	private JCheckBox colorFilterCheck;
+	private JCheckBox removeParallelSegmentsCheck;
+	private JTextField removeParallelSegmentsTolerance;
+	private JCheckBox removeLargeObjectsCheck;
+	private JTextField removeLargeObjectsSize;
 
 	public LoadPdfDialog() {
@@ -177,6 +181,14 @@
 		this.removeSmallObjectsSize = new JTextField("1");
 
+		this.removeLargeObjectsCheck = new JCheckBox(tr("Remove objects larger than"));
+		this.removeLargeObjectsSize = new JTextField("10");
+
+
 		this.colorFilterCheck = new JCheckBox(tr("Only this color"));
 		this.colorFilterColor = new JTextField("#000000");
+
+		this.removeParallelSegmentsCheck = new JCheckBox(tr("Remove parallel lines"));
+		this.removeParallelSegmentsTolerance = new JTextField("3");
+
 
 		JPanel configPanel = new JPanel(new GridBagLayout());
@@ -197,9 +209,23 @@
 
 		c.gridx = 0; c.gridy = 2; c.gridwidth = 1;
+		configPanel.add(this.removeLargeObjectsCheck, c);
+		c.gridx = 1; c.gridy = 2; c.gridwidth = 1; c.anchor = c.NORTHEAST;
+		configPanel.add(new JLabel("Tolerance :"), c);
+		c.gridx = 2; c.gridy = 2; c.gridwidth = 1; c.anchor = c.NORTHWEST;
+		configPanel.add(this.removeLargeObjectsSize, c);
+
+		c.gridx = 0; c.gridy = 3; c.gridwidth = 1;
+		configPanel.add(this.removeParallelSegmentsCheck, c);
+		c.gridx = 1; c.gridy = 3; c.gridwidth = 1; c.anchor = c.NORTHEAST;
+		configPanel.add(new JLabel("Max distance :"), c);
+		c.gridx = 2; c.gridy = 3; c.gridwidth = 1; c.anchor = c.NORTHWEST;
+		configPanel.add(this.removeParallelSegmentsTolerance, c);
+
+		c.gridx = 0; c.gridy = 4; c.gridwidth = 1;
 		configPanel.add(this.colorFilterCheck, c);
-		c.gridx = 2; c.gridy = 2; c.gridwidth = 1;
+		c.gridx = 2; c.gridy = 4; c.gridwidth = 1;
 		configPanel.add(this.colorFilterColor, c);
 
-		c.gridx = 0; c.gridy = 3; c.gridwidth = 2;
+		c.gridx = 0; c.gridy = 5; c.gridwidth = 2;
 		configPanel.add(this.debugModeCheck, c);
 
@@ -270,5 +296,5 @@
 		panel.add(okCancelPanel, c);
 
-		this.setSize(400, 500);
+		this.setSize(400, 520);
 		this.setContentPane(panel);
 	}
@@ -396,5 +422,6 @@
 
 		LatLon ll = ((Node)selected.iterator().next()).getCoor();
-		return this.placement.reverseTransform(ll);
+		FilePlacement pl = new FilePlacement();
+		return pl.reverseTransform(ll);
 	}
 
@@ -509,4 +536,18 @@
 
 
+		if (this.removeParallelSegmentsCheck.isSelected()) {
+			try {
+				double tolerance = Double.parseDouble(this.removeParallelSegmentsTolerance.getText());
+				data.removeParallelLines(tolerance);
+			}
+			catch (Exception e) {
+				JOptionPane
+				.showMessageDialog(
+						Main.parent,
+						tr("Max distance is not a number"));
+				return null;
+			}
+		}
+
 		if (this.mergeCloseNodesCheck.isSelected()) {
 			try {
@@ -539,4 +580,18 @@
 		}
 
+
+		if (this.removeLargeObjectsCheck.isSelected()) {
+			try {
+				double tolerance = Double.parseDouble(this.removeLargeObjectsSize.getText());
+				data.removeLargeObjects(tolerance);
+			}
+			catch (Exception e) {
+				JOptionPane
+				.showMessageDialog(
+						Main.parent,
+						tr("Tolerance is not a number"));
+				return null;
+			}
+		}
 
 		data.splitLayersByPathKind();
Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/ParallelSegmentsFinder.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/ParallelSegmentsFinder.java	(revision 24080)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/ParallelSegmentsFinder.java	(revision 24080)
@@ -0,0 +1,176 @@
+package pdfimport;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class ParallelSegmentsFinder {
+	public double angle;
+	public double angleSum;
+	public int refCount;
+	public List<PdfPath> paths = new ArrayList<PdfPath>();
+
+	public void addPath(PdfPath path, double angle2) {
+		angleSum += angle2;
+		paths.add(path);
+		angle = angleSum /paths.size();
+	}
+
+	public List<ParallelSegmentsFinder> splitByDistance(double maxDistance)
+	{
+		//sort perpendicular to angle
+		AffineTransform tr = new AffineTransform();
+		tr.rotate(-angle);
+
+		final Map<PdfPath, Point2D> positions = new HashMap<PdfPath, Point2D>();
+		Point2D src = new Point2D.Double();
+
+		for(PdfPath path: paths)
+		{
+			src.setLocation((path.firstPoint().getX() + path.lastPoint().getX()) / 2, (path.firstPoint().getY() + path.lastPoint().getY()) / 2);
+			Point2D dest = new Point2D.Double();
+			Point2D destA = new Point2D.Double();
+			Point2D destB = new Point2D.Double();
+			tr.transform(src, dest);
+			tr.transform(path.firstPoint(), destA);
+			tr.transform(path.lastPoint(), destB);
+			positions.put(path, dest);
+		}
+		//point.y = Perpendicular lines, point.x = parallel lines
+
+		Collections.sort(paths, new Comparator<PdfPath>() {
+			public int compare(PdfPath o1, PdfPath o2) {
+				double y1 = positions.get(o1).getY();
+				double y2 = positions.get(o2).getY();
+				return y1 > y2 ? 1: y1 < y2 ? -1 : 0;
+			}
+		});
+
+		//process sweep
+		List<ParallelSegmentsFinder> result = new ArrayList<ParallelSegmentsFinder>();
+
+		Map<PdfPath, ParallelSegmentsFinder> sweepLine = new HashMap<PdfPath, ParallelSegmentsFinder>();
+
+		Set<ParallelSegmentsFinder> adjacentClustersSet = new HashSet<ParallelSegmentsFinder>();
+		List<ParallelSegmentsFinder> adjacentClusters = new ArrayList<ParallelSegmentsFinder>();
+		List<PdfPath> pathsToRemove = new ArrayList<PdfPath>();
+
+		for (PdfPath path: paths){
+			adjacentClusters.clear();
+			adjacentClustersSet.clear();
+			pathsToRemove.clear();
+
+			for (PdfPath p: sweepLine.keySet()) {
+				Point2D pathPos = positions.get(path);
+				Point2D pPos = positions.get(p);
+
+				if (pathPos.getY() - pPos.getY() > maxDistance) {
+					//path too far from sweep line
+					pathsToRemove.add(p);
+				} else {
+
+					double distance = distanceLineLine(path, p);
+
+					if (distance <= maxDistance) {
+						if (adjacentClustersSet.add(sweepLine.get(p)))
+						{
+							adjacentClusters.add(sweepLine.get(p));
+						}
+					}
+				}
+			}
+
+			//remove segments too far apart
+			for(PdfPath p: pathsToRemove){
+				ParallelSegmentsFinder finder = sweepLine.remove(p);
+				finder.refCount --;
+				if (finder.refCount == 0){
+					result.add(finder);
+				}
+			}
+
+			//join together joinable parts
+			if (adjacentClusters.size() > 0){
+				ParallelSegmentsFinder finder = adjacentClusters.remove(0);
+				finder.paths.add(path);
+				sweepLine.put(path, finder);
+				finder.refCount ++;
+
+				for(ParallelSegmentsFinder finder1: adjacentClusters){
+					for(PdfPath path1: finder1.paths){
+						finder.paths.add(path1);
+						sweepLine.put(path1, finder);
+						finder.refCount ++;
+					}
+				}
+			}
+			else
+			{
+				ParallelSegmentsFinder finder = new ParallelSegmentsFinder();
+				finder.addPath(path, angle);
+				sweepLine.put(path, finder);
+				finder.refCount = 1;
+			}
+		}
+
+		//process remaining paths in sweep line
+		for (PdfPath p: sweepLine.keySet()) {
+			ParallelSegmentsFinder finder = sweepLine.get(p);
+			finder.refCount --;
+			if (finder.refCount == 0){
+				result.add(finder);
+			}
+		}
+
+		return result;
+	}
+
+	private double distanceLineLine(PdfPath p1, PdfPath p2) {
+		return distanceLineLine(p1.firstPoint(), p1.lastPoint(), p2.firstPoint(), p2.lastPoint());
+	}
+
+	private double distanceLineLine(Point2D p1, Point2D p2, Point2D p3, Point2D p4) {
+		double dist1 = closestPointToSegment(p1, p2, p3).distance(p3);
+		double dist2 = closestPointToSegment(p1, p2, p4).distance(p4);
+		double dist3 = closestPointToSegment(p3, p4, p1).distance(p1);
+		double dist4 = closestPointToSegment(p3, p4, p2).distance(p2);
+		return Math.min(Math.min(dist1, dist2),Math.min(dist3, dist4));
+	}
+
+	/**
+	 * Calculates closest point to a line segment.
+	 * @param segmentP1
+	 * @param segmentP2
+	 * @param point
+	 * @return segmentP1 if it is the closest point, segmentP2 if it is the closest point,
+	 * a new point if closest point is between segmentP1 and segmentP2.
+	 */
+	public static Point2D closestPointToSegment(Point2D segmentP1, Point2D segmentP2, Point2D point) {
+
+		double ldx = segmentP2.getX() - segmentP1.getX();
+		double ldy = segmentP2.getY() - segmentP1.getY();
+
+		if (ldx == 0 && ldy == 0) //segment zero length
+			return segmentP1;
+
+		double pdx = point.getX() - segmentP1.getX();
+		double pdy = point.getY() - segmentP1.getY();
+
+		double offset = (pdx * ldx + pdy * ldy) / (ldx * ldx + ldy * ldy);
+
+		if (offset <= 0)
+			return segmentP1;
+		else if (offset >= 1)
+			return segmentP2;
+		else
+			return new Point2D.Double(segmentP1.getX() + ldx * offset, segmentP1.getY() + ldy * offset);
+
+	}
+}
Index: applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java
===================================================================
--- applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java	(revision 24077)
+++ applications/editors/josm/plugins/pdfimport/src/pdfimport/PathOptimizer.java	(revision 24080)
@@ -47,7 +47,18 @@
 
 	public void addMultiPath(LayerInfo info, List<PdfPath> paths) {
+
 		LayerContents layer = this.getLayer(info);
-		PdfMultiPath p = new PdfMultiPath(paths);
-		layer.multiPaths.add(p);
+		boolean goodMultiPath = true;
+
+		for(PdfPath path: paths) {
+			goodMultiPath &= path.isClosed();
+		}
+
+		if (goodMultiPath) {
+			PdfMultiPath p = new PdfMultiPath(paths);
+			layer.multiPaths.add(p);
+		} else {
+			layer.paths.addAll(paths);
+		}
 	}
 
@@ -78,4 +89,9 @@
 
 
+	public void removeParallelLines(double maxDistance){
+		for(LayerContents layer: this.layers) {
+			this.removeParallelLines(layer, maxDistance);
+		}
+	}
 
 	public void mergeNodes(double tolerance) {
@@ -96,5 +112,12 @@
 	public void removeSmallObjects(double tolerance) {
 		for(LayerContents layer: this.layers) {
-			this.removeSmallObjects(layer, tolerance);
+			this.removeSmallObjects(layer, tolerance, Double.POSITIVE_INFINITY);
+		}
+	}
+
+
+	public void removeLargeObjects(double tolerance) {
+		for(LayerContents layer: this.layers) {
+			this.removeSmallObjects(layer, 0.0, tolerance);
 		}
 	}
@@ -232,9 +255,10 @@
 
 
-	private void removeSmallObjects(LayerContents layer, double tolerance) {
+	private void removeSmallObjects(LayerContents layer, double min, double max) {
 		List<PdfPath> newPaths = new ArrayList<PdfPath>(layer.paths.size());
 
 		for(PdfPath path: layer.paths) {
-			boolean good = getShapeSize(path) >= tolerance;
+			double size = getShapeSize(path);
+			boolean good = size >= min && size <= max;
 
 			if (good) {
@@ -250,5 +274,6 @@
 			boolean good = true;
 			for(PdfPath path: mp.paths) {
-				good &= getShapeSize(path) >= tolerance;
+				double size = getShapeSize(path);
+				good &= size >= min && size <= max;
 			}
 
@@ -274,4 +299,73 @@
 	}
 
+
+
+	/***
+	 * This method finds parralel lines with similar distance and removes them.
+	 * @param layer
+	 */
+	private void removeParallelLines(LayerContents layer, double maxDistance) {
+		double angleTolerance = 1.0 / 180.0 * Math.PI; // 1 degree
+		int minSegments = 10;
+
+		//filter paths by direction
+		List<ParallelSegmentsFinder> angles = new ArrayList<ParallelSegmentsFinder>();
+
+		for(PdfPath path: layer.paths) {
+			if (path.points.size() != 2){
+				continue;
+			}
+
+			Point2D p1 = path.firstPoint();
+			Point2D p2 = path.lastPoint();
+			double angle = Math.atan2(p2.getX() - p1.getX(), p2.getY() - p1.getY());
+			//normalize between 0 and 180 degrees
+			while (angle < 0) angle += Math.PI;
+			while (angle > Math.PI) angle -= Math.PI;
+			boolean added = false;
+
+			for(ParallelSegmentsFinder pa: angles) {
+				if (Math.abs(pa.angle - angle) < angleTolerance){
+					pa.addPath(path, angle);
+					added = true;
+					break;
+				}
+			}
+
+			if (!added) {
+				ParallelSegmentsFinder pa = new ParallelSegmentsFinder();
+				pa.addPath(path, angle);
+				angles.add(pa);
+			}
+		}
+
+		Set<PdfPath> pathsToRemove = new HashSet<PdfPath>();
+
+		//process each direction
+		for (ParallelSegmentsFinder pa: angles){
+			if (pa.paths.size() < minSegments){
+				continue;
+			}
+
+			List<ParallelSegmentsFinder> parts = pa.splitByDistance(maxDistance);
+
+			for(ParallelSegmentsFinder part: parts) {
+				if (part.paths.size() >= minSegments){
+					pathsToRemove.addAll(part.paths);
+				}
+			}
+		}
+
+		//generate new path list
+		List<PdfPath> result = new ArrayList<PdfPath>(layer.paths.size() - pathsToRemove.size());
+
+		for(PdfPath path: layer.paths) {
+			if (!pathsToRemove.contains(path)) {
+				result.add(path);
+			}
+		}
+
+		layer.paths = result;
+	}
 
 
@@ -354,5 +448,5 @@
 						//remove excess segments from start of chain
 						while (lastPoint != firstPoint) {
-							PdfPath pathToRemove = pathChain.remove(0);							
+							PdfPath pathToRemove = pathChain.remove(0);
 							firstPoint = pathToRemove.getOtherEnd(firstPoint);
 						}
@@ -639,3 +733,4 @@
 
 
+
 }
