Closed sargunv closed 7 years ago
@sargunster currently the best we could do is just region->locations->location areas. If you could look over the data and see some way of creating a model for connecting locations to one another based of adjacency that might be a welcome addition
My first thought is an addition to the location object with a list of connections, like this example for kalos-route-1
:
{
"id": 622,
"name": "kalos-route-1",
"region": {
"name": "kalos",
"url": "http://pokeapi.co/api/v2/region/6/"
},
"names": [
{
"name": "Route 1",
"language": {
"name": "en",
"url": "http://pokeapi.co/api/v2/language/9/"
}
}
],
"connections": [
{
"direction": "north",
"location": {
"name": "aquacorde-town",
"url": "http://pokeapi.co/api/v2/location/588/"
}
},
{
"direction": "south",
"location": {
"name": "vaniville-town",
"url": "http://pokeapi.co/api/v2/location/587/"
}
}
],
"game_indices": [],
"areas": []
}
@sargunster how would you handle special cases where connections are not in a direction? Where is this information available already?
The information is on Bulbapedia articles for locations, under the "Connecting Locations" header: http://bulbapedia.bulbagarden.net/wiki/Kalos_Route_1
Could you give an example of one that's not in a direction?
@sargunster I seem to remember a few games having locations that you teleported into.
That information is great but not well structured, we'd need to either collect the data by hand (slow and prone to human error) or construct some scraping tool to automate the data gathering :)
Seems like some pages (like Santalune Forest) don't follow the same format as the others.
Just a thought. If we do end up wanting to generate our own CSVs, I feel like we might want to keep them separate of the veekun csvs. Somethling like
data/v2/veekun/
and data/v2/pokeapi
juat to keep things clean and obvious
@zaneadix yes for sure. Or perhaps Veekun has plans to add this sort of data?
@phalt @zaneadix another thought. How about a new repo only for the data? This could be done together with those from Veekun if they want. Additional this new repo could be for all sort of pokemon data (like the card game (#76), sprites/images (#80), pokemon go (#90), location connections (this issue), …). This would require some changes at the 'db data build script', but other projects could easily use this data (e.g. with git submodules). There would be a separation of code and data, this would mean you could run an older version of the api with newer data or the other way around. Updates of the data would mean update the local repo ant rerun the 'db data build script' and this would not change the source.
Would it be possible to get information on which locations connect to each other? Or possibly a "region map" as a graph with nodes as locations, and connected nodes representing connected locations.