HartBlanc/anki-uk-geography

Constituencies & how did you do this?

Opened this issue · 5 comments

Hi,

I'm really interested in the process behind this deck but I'm not sure where to look in terms of youtube tutorials or other tutorials. I can see you're 80% of the way through setting this up so constituencies can be studied in the same set and I have wanted to do that for a while - I'm interested in memorising constituency name, location and current MP. However I'm new to making complex decks on anki, I use other people's for my own memorisation. I don't understand how your txt and py files work with the image, and the complex card types when you look in the settings for them. I'd be really interested if you could point me in the right direction to trying to figure all this stuff out, as I am going to make this set of con name/loc/MP and if I can build on the stuff you've already done that would be great.

I know python if that helps. It seems like you keep text file dictionaries of name:name and then name:loc and the loc corresponds to a specific fill pattern on the map but I can't figure out the intricacies of it. Would love any pointers. Merry Christmas

Hi aliflo,

Constituencies

I have actually finished the deck for the constituencies, which I have used myself for memorising locations/names, it does not include the MPs. I'm personally not interested in learning the MPs so I'm unlikely to invest the time to add this.

The deck is a little rough around the edges, which is why I haven't released it formally yet. I've just added a pre-release for the constituency deck that you can have a look at if you like (here).

How did you do this?

The build process is admittedly quite complex for an Anki deck and I haven't really seen other projects out there using an approach like this so you're unlikely to find tutorials for it.

In terms of actually drawing the maps, I basically just downloaded the base maps from Wikipedia and messed around with them in Inkscape without any prior experience, I just played around with it until it looked how I wanted it to. To modify which elements of the SVG are highlighted in the cards I used a bit of CSS and Javascript, again I don't have lots of experience with these technologies, but other programming experience I have helps a lot.

I've done a little write up in a blog post that might provide some more info. I have also explained the build process to some extent in the contribution documentation the diagram is up to date, but the accompanying text may be a bit out of date in places.

I'm currently working on using a proper build system (please) to hopefully make the process a little easier to reason about.

Hi Callum,

Did you ever make any progress with this? This summer, I have more free time and I am intending to try and memorise constituencies. Because of my limited knowledge of Anki, my current plan is to just take the 100s of images from Wikipedia/your list and put them in a deck, but I thought I'd ask you - I will probably edit them to add MPs and so I could potentially make an interesting fork of your work and give it wider appeal.

Hey, I haven't done any work on the constituencies side of things.

Feel free to fork, and take any content from this repo :)

aliflo commented

Hi @HartBlanc, hope you are well. Last month the UK boundary commissions released their 2023 review, which gives constituency boundaries for the next few elections. I'm trying to follow the build process for remaking the constituencies section of the deck. So far, I've:

  • Taken SHP files from each boundary commission website and aligned field names in QGIS.
  • Merged into a single SHP and then converted the SHP file into an SVG using https://products.aspose.app/gis/viewer/shp-to-svg.
  • Reduced line thickness from 1pt to 0.2pt in Inkscape.

So I have a somewhat serviceable SVG which has the metadata for constituency names. I can't share it directly as it's 30MB, but here's a onedrive link where I've hosted it, and an inkscape screenshot.
image

I'm trying to understand how the original deck colours in sections of the map. It seems to be happening in the card template section here:
image

image

What do these codes mean and how did you identify them? My limited knowledge assumption is that these are telling Anki which section of the SVG to highlight in red, where to draw the box, and which bit to colour in. I remember this was where I got stuck last year as well when I tried to do this - I couldn't quite piece together from your documentation how you'd done it.

I read your blog post and the documentation originally linked, which seem to suggest that since my SVG file has labels on all of the constituencies, it should just be a case of creating the CSS styling template. I don't entirely see the need for the Javascript section, but I may well be wrong. I'm probably in the third 'column' of your flowchart here right now.

I appreciate you may not have time to reply to this, but I do feel relatively close to being able to crack the process, I just need to understand this bit with the SVGs, CSVs and card templates, so I thought I'd ask. My half-finished process may also be useful to anyone else who thinks about working on something similar or forking this deck in the future.