PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

Question: Possible to get catch place of Pokémon?

Open sino123 opened this issue 9 years ago • 5 comments

Description: Is it possible to get the catched coordinates (lat, lng) of Pokémon? E. g. I can get the catch date and time but could not figure out how to get the catch position.

Pokemon pest;
List<Pokemon> pokemons = go.getInventories().getPokebank().getPokemons();
//....
pest.getCreationTimeMs()
//How to get catch place (lat, lng)?

Version: latest

sino123 avatar Dec 10 '16 09:12 sino123

As far as I know, the latitude and longitude that the Pokémon was caught at is not stored. Looks like the cell id it was caught in is, so I'd imagine that is what is used to show the place at which the Pokémon was caught in the official app. I am not sure how cell positions are incorporated into their ids.

Gegy avatar Dec 10 '16 13:12 Gegy

Maybe this is a breadcrumb to the solution: https://www.npmjs.com/package/s2-geometry

clangdev avatar Dec 30 '16 09:12 clangdev

@clangdev S2 helper functions are already included

https://github.com/Grover-c13/PokeGOAPI-Java/tree/3c8a56fd183182d27856922f697324f702c0984b/library/src/main/java/com/pokegoapi/google/common/geometry

And yes: caught pokemon have a cell ID stored and converting that to a boundingbox is easy with those functions (or cheat and show an actual lat/lng)

jabbink avatar Dec 30 '16 10:12 jabbink

Ok, thx. Looks like this issue died some 23 days ago. I personally do not need that. Close, anyone?

clangdev avatar Jan 02 '17 05:01 clangdev

I would say: don't close as the issue is not actually resolved, but looking the code PokemonDetails does have a public getCapturedS2CellId(), so this was never an issue in the first place.

Closing

jabbink avatar Jan 03 '17 13:01 jabbink