Spawnpoints Moving from RDM to MAD - madBeavis/PimpMyAtv GitHub Wiki

Foreward

Doing routes and such is difficult. The following is one alternative to using RDM and associated tools for doing routes.

Setting up MAD

MAD does routes very nicely, so might as well make use of it.

  1. Create a separate instance of MAD and associated venv
  2. Properly install ortools
  3. Run MAD to create the proper tables in the database
  4. Transfer over the spawnpoints from RDM to MAD via queries below
  5. Create the geofences in MAD
  6. Create the areas in MAD
  7. Calculate routes in MAD
  8. Transfer routes back to RDM
  9. Check lap times for route
  10. Iterate if needed, adjust geofences in MAD, recalc routes and put into RDM

Some further points

  1. One can adjust the circles that MAD uses for finding routes
    1. In the file MappingManager.py (located in MAD/mapadroid/utils ) there is a spot at the top where you can set the radius MAD uses for route calcs. Restart MAD after making this change.
    2. You can edit routes within the MAD map

Query to transfer spawnpoints from RDM to MAD

MAD stores data in timestamps and RDM stores times in epoch seconds. MAD tth time is in "minutes:seconds" from top of hour and RDM stores times in seconds from top of hour.

I used access to link in the MAD trs_spawn table and RDM spawnpoints table. Then I made a query to take the data from RDM to MAD. You will of course need to adjust queries to how you name them. Below is the query I used with my naming scheme for tables:

INSERT INTO [MAD-trs_spawn] ( spawnpoint, latitude, longitude, calc_endminsec ) SELECT [RDM-spawnpoint].id, [RDM-spawnpoint].lat, [RDM-spawnpoint].lon, IIf(IsNull([RDM-spawnpoint].despawn_sec),Null,Right('000' & Int([RDM-spawnpoint].despawn_sec/60),2) & ':' & Right('000' & [RDM-spawnpoint].despawn_sec Mod 60,2)) AS endtime FROM [RDM-spawnpoint];

Query to transfer spawnpoints from MAD to RDM

In case one wants to go the other direction with spawnpoints, one can use the following query:

INSERT INTO [RDM-spawnpoint] ( id, lat, lon, despawn_sec ) SELECT [MAD-trs_spawn].spawnpoint, [MAD-trs_spawn].latitude, [MAD-trs_spawn].longitude, iif([MAD-trs_spawn].calc_endminsec > '',left([MAD-trs_spawn].calc_endminsec,2)*60 + right([MAD-trs_spawn].calc_endminsec,2) ,null) AS end_time FROM [MAD-trs_spawn];