brandonshults / pipoam

A tool for clipping points on a map using polygons.
https://www.youtube.com/watch?v=jotvK8W-6MM
28 stars 2 forks source link

Scan with clipped-spawnpoints.json sometimes returns no result #2

Closed DrAtari closed 8 years ago

DrAtari commented 8 years ago

Sometimes there is no Pokemon at the location which gets scanned at the time specified in clipped-spawnpoints.json. The circle shown with "Scanned Locations" in PokemonGo-Map is empty.

When I export spawn points with PokemonGo-Map instead it always returns a Pokemon at the scanned location.

Does your code change anything about the spawn times? I have no idea what else could cause this.

brandonshults commented 8 years ago

Are you loading the spawnpoints into pipoam from a JSON file or from your database?

If you are loading from a JSON file the numbers should be completely untouched.

If loading from DB there is a conversion that happens to the time stored in the database. This is likely the culprit, I will look into it.

DrAtari commented 8 years ago

Yea, I'm loading pogom.db by entering the path in pipoam. Thanks.

brandonshults commented 8 years ago

it was indeed an issue with the conversion from database time. I've pushed a fix. Here's the quick and dirty script I used to compare spawn json times:

const spawns = require('./spawns.json');
const allPoints = require('./all-points.json');

spawns.forEach(spawn => {
  const matches = allPoints.filter(point => point.lat === spawn.lat && point.lng === spawn.lng);
  console.log(spawn);
  console.log(matches);
  console.log('\n\n');
});
DrAtari commented 8 years ago

Great thanks. Saw that you simply added a second in the fix. Somehow I expected that this may be a way to fix it, without even looking at the code :)

brandonshults commented 8 years ago

Well, I was multiplying instead of adding before too. The addition is because the times are stored in the db as disappear times but we need appear times.

DrAtari commented 8 years ago

It still shows some empty spawn points. Just now it scanned a spawn point at minute 57. On the map of spawn points I created I see that a pokemon is supposed to spawn there at minute 41 and 36 seconds. The status display in PokemonGo-Map shows that it's just 60s behind.

I'll try again with spawn point files exported with PokemonGo-Map and let it run for a while to make sure it's not a problem with their code.

brandonshults commented 8 years ago

Did you make sure to re-import from the database first? The conversion happens at import, not export. I've been running for 15+ minutes now and haven't had a single miss or sub 14m remaining.

DrAtari commented 8 years ago

I don't see any empty spawn points when using the .json exported with PokemonGo-Map. It seems that when encountering an empty spawn point while using the .json exported with pipoam, the timer was exactly 15 minutes too late. I'll run the .json exported with pipoam again and see if the other empty spawn points are also 15 minutes too late.

And no, I didn't reimport the database. Will try that.

DrAtari commented 8 years ago

Ok, seems like everything works as supposed. Thanks for your very useful work.