It is rather a topic “how I started to do it, or help with a question - Am I right?”
I work in a trading company. Due to the crisis, we are forced to optimize the resources of our company as much as possible. In order to really see (!) How agents walk around the city, I start this topic.
')
Introduction
Each of our agents is equipped with a PDA. Order data is sent to the server, where various data is recorded including. “Client code”, “session start” and “end of session”, “application data”, etc. (for each client).
The server stores the following data on agent visits:
id | customer id | agent id | Date | HomeSessions | EndSessions | Successful | Renouncement
-------------------------------------------------- -----------------------------------------
1 | 1031 | 15 | 09/10/2008 | 09:30:14 | 09:36:50 | 1 | 0
2 | 1491 | 16 | 09/10/2008 | 19:30:14 | 09:36:50 | 1 | 0
Puzzled
Problem number 1: Apply> 4000 potential customers to the city map. With binding ID.
Problem number 2: Break into categories "Good", "Srednyachok" and "Greedy." (In the cuts of the month, quarter, year - optional)
Task number 3: Automate the process of drawing the route passed by the agent in his covered area.
And other tasks that simplify the work of an agent to bypass his area.
Process
There is a base of more than 1000 customers of this type:
Id | Name | Address
-------------------------------------------------- ---------------
1031 | Rozhkova Local Store LLP | st. Pushkin 24
1491 | Island PI "Cookery" | st. Sadovaya, 13 Bldg. 17
Of course, they must be applied using not very clever software written to maximize the simplification of this task.
Add a field to the database:
Id | Name | Address | <b> Coordinates </ b>
-------------------------------------------------- -------------------------
1031 | Rozhkova Local Store LLP | st. Pushkin d.24 | <b> x = 2145; y = 504 </ b>
1491 | Island PI "Cookery" | st. Sadovaya, 13 Bldg. 17 | <b> x = 332; y = 1276 </ b>
Tool

The screenshot shows that you can select customers (LIMIT 50): “all”, “marked”, “not marked”, “not found”.
After successfully putting customers on the card. We can track agents for their movements, for a given territory.
Having a map with clients, guided by the table of visits, using SVG, we can draw the path according to the available coordinates in the client base.
Main problems:- Our area is not traced in detail in any of the services (google.com, yandex.ru) = (
- Map size 28000x28000 px is not displayed in the browser. I had to break, it turned out a table of 14x14 pieces of 2000px
Some clarity:- The main accounting system for Visits, Orders, Download, Delivery hangs in a Win32 shell on a FireBird.
- The relief is that the tool is needed only for local access.
- The tool is written in PHP + MySQL
- Clients are applied as objects in the form “img” with client id = id
(To be continued)ps If someone faced with similar tasks, or just have thoughts, please - share them