public void createVillagePolygons() {
		int z = 0;
		for (CustomRelation vr : villageRelationsMap.values()) {
			setStatus("polygon: " + Integer.toString(++z) + "/" + Integer.toString(villageRelationsMap.size()));
			CustomPolygon vp = new CustomPolygon();
			vp.setName(vr.getName());
			CustomNode firstNode = new CustomNode();
			int lastNode = 0;
			do {
				int way = getNextVillageWay(vr, villageWaysMap, lastNode);
				CustomWay vw = villageWaysMap.get(way);
				boolean areNodesForward = (lastNode == 0 || vw.getMembers().get(0) == lastNode);
				if (areNodesForward) {
					for (int i = 0; i < vw.getMembers().size(); i++) {
						if (firstNode.getNodeId() == 0) {
							firstNode = villageNodesMap.get(vw.getMembers().get(i));
						}
						vp.addVillageNode(villageNodesMap.get(vw.getMembers().get(i)));
						lastNode = vp.getVillageNodes().get(vp.getVillageNodes().size() - 1).getNodeId();
					}
				} else {
					for (int i = vw.getMembers().size() - 1; i >= 0; i--) {
						if (firstNode.getNodeId() == 0) {
							firstNode = villageNodesMap.get(vw.getMembers().get(i));
						}
						vp.addVillageNode(villageNodesMap.get(vw.getMembers().get(i)));
						lastNode = vp.getVillageNodes().get(vp.getVillageNodes().size() - 1).getNodeId();
					}
				}
				vp.getVillageNodes().remove(vp.getVillageNodes().size() - 1);
				vr.getMembers().remove(vr.getMembers().indexOf(vr.getMemberWithWayId(vw.getWayId())));
			} while (vr.getMembers().size() > 0);
			vp.addVillageNode(firstNode);
			villagePolygons.put(vp.getName(),vp);
		}
		setChanged();
		notifyObservers(villagePolygons);
	}