Om / About

  • 2024
  • 2023
  • 2022
  • 2016
  • 2015
  • 2014
  • 2013
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • 2004
  • Creating the Centrum of Centrum

    9 september 2013

    My orienteering club Centrum OK has about 150 members at the moment and the name ”Centrum” means center/centre. Today one member, Martin Lerjen, asked me if I knew the exact center of Centrum. I told him I once created a map when the club only had a few members but it was a such a hassle to get the data that time. What I did was search each of the members’ address on Eniro and then used the GPS tool there to get the coordinates. Yes you can imagine how long time that took…

    So today I was thinking of another method.

    A quick google on ”postcodes coordinates” (but in swedish) took me to this site which has coordinates for all (well not all but almost all) postal code areas in Sweden. Since most of our members live in Stockholm where the postal code areas are quite small, I figured that these coordinates would be good enough to find out where the center point of our club is.

    From the website above I got all postal codes in CSV format like this:

    "10005";"Stockholm, Stockholms Län, Sverige";"59.300064";"19.084435"

    Then I downloaded the member data with names and postal codes from Idrott Online.

    After that I added the CSV file with all the coordinates in QGIS as ”Delimited Text Layer” (image above) and then the member database, but this one only added as a table.

    When both files where in QGIS I joined the two files using the postal code column, then exported it as a DBF. Opened the file in Open Office and exported as CSV again. The file looked like this now:

    Oskar,Karlin,117 38,11738,"Stockholm, Stockholms Län, Sverige",59.31657,18.02833

    This file I added to QGIS as ”Delimited Text Layer” and then exported it as a geo-JSON file which looks like this on a map:

    As you can see, some of the addresses were not in Stockholm area at all. In order to get a more accurate center of Centrum based on people who actually come to our trainings I decided to exclude everyone with a postal code that didn’t start with the number 1 (Stockholm):

    Then to get the actual center point of Centrum (in Stockholm) I just summarised all the rows with coordinates and divided by the number of rows. Which was: 59.3186785549 18.0534747746. Here it is:

    Next step was to make a Centrum branded background map. Since our club colours are dark red and black, this is what I ended up with (together with Leaflet.MarkerCluster):

    Lämna ett svar

    Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *