Cities of Your Country deck

I would not mind sending you the file (not sure how to go about that) but I also would not mind just doing it for you to help out if you share the code.

1 Like

I sent a DM:)

1 Like

Hey man!
Awesome deck! I’m using to study my state’s cities (Rio de Janeiro - Brazil)
The first thing I noticed is that the pin on the answer map is a little to big since some cities are small, so it was dificult to see exactly where the city was in the first place, but then I found in the code how to make it smaller.
Then I got it to work by retrieving dynamically the city’s map from wikicommons like this commons|wikimedia|org/wiki/File:RiodeJaneiro_Municip_NovaIguacu.svg (i cant post links, just add h t t p in the front to work, and change | for dot) so it can show better the city boundaries and not only the main location.

I was wondering since you have the peg so we can click and also the peg of the actual location, is it possible to create like in geoguesr and calculate the distance between chosen location and correct location? that would be awesome! Just an idea

I saw that there are a lot of missing cities, can I send to you and you add since I saw the other answer that you have the script?

I tried making a deck like this a long time ago with every regions of the world, and I spent a lot of time trying to see how it could be automated, but it turned out to be to difficult since the maps are not structured and named properly on Wikipedia so it would have to be made manually.
Another problem is that it would require way more memory than someone would want to download, let alone be possible on AnkiWeb. So it would have to use references and only work when online.

is it possible to create like in geoguesr and calculate the distance between chosen location and correct location?

It is possible, yes, but following the concept of Anki, it is not Anki which tells you whether you got it right, but yourself. It also makes for faster reviews this way.

I saw that there are a lot of missing cities, can I send to you and you add since I saw the other answer that you have the script?

You can send some examples yes, then I can see what they look like in Wikidata and see if it is possible to add them (in some countries they are not called a “city” or “town”). But if I were to add all types of human settlements including villages it would take very long to gather the data and result in millions of cards which would mean it could not be shared on AnkiWeb.

Even if its not staying completely true to the Anki style, it could still be interesting to implement.
Since there is already the code to plonk down a pin, it would only be a matter of applying a distance formula.

It would require that the maps’ borders were added to the deck and calculate the coordinates on review. Some maps are complex like this: Module:Location map/data/Japan - Wikipedia, but I don’t think it will make a big difference in loading time still, so I’ll consider doing it.

This is the list of cities in Rio de Janeiro state in Brazil

This is a list of municipalities, not cities. I intentionally excluded adminitrative regions as I first thought I would do one with the border images earlier metioned, but I’m looking into if it’s possible without taking up so much space that it exceeds the 250MB limit on Ankiweb. It will just be quite lagging for users if too many cards are added.

1 Like

@edusanzio @dizzypenguin Sorry for the long wait. I made a big update with subdivisions added. I also made the GeoGuessr feature, see how to activate it in the description.

How to update

  • To fix order, delete all from the search “note:Cities is:new” before importing.
  • Import the new version with settings update notes “Always”.
  • Delete all from “note:Cities -tag:cities::version-2024-11-07”
  • Delete “cities::version-2024-11-07” tag
  • Run “Notes” → “Clear Unused Tags”
  • Suspend/delete what you want

It should be note:Cities -tag:cities::version-2024-11-07

  • Run “Tools” → “Remove unused tags”

Notes > Clear Unused Tags

Thanks for this!
I fixed it

Thank you for the deck!

1 Like

How do you fix this issue?

I can’t seem to get the same error.
Does it only happen on this card? Have you modified the note or the card template?

No it happens with all the cards. Should I just delete the deck and try to redownload it?

Maybe try to import the deck in another profile and then copy and paste the card template from there

Really great deck man! It’s a little to granular for my needs though. Is there any way to extract the hundred largest cities from each country and either export that to a separate deck or throw the other notes away?

Unfortunately there’s no way to automatically select the first 100 cards of a search, you have to select them manually for each country. But you can filter by population: e.g. any cities with a population of at least 50,000:
Population:re:[5-9][\d,]{5,}|[\d,]{7,}

You could also keep all cards in a different profile and export as you want to study more cards if suspending is not enough.

Thanks, I’ll try that