everypolitician / democratic-commons-tasks

An issues-only repository for tracking work for the Democratic Commons project
0 stars 0 forks source link

Source boundary data for administrative divisions of Canada #35

Closed jukesie closed 6 years ago

jukesie commented 6 years ago

Obtain shapefiles of boundary data (at levels 1 and 2 and where available level 3)

mhl commented 6 years ago

@jukesie n.b. I'm not sure what levels 1, 2 and 3 mean here? Is level 1 the whole country? We should probably standardise terminology for this.

I'll try to describe the steps I'm going through here so we could turn them into step-by-step instructions.

First we need to establish which administrative levels we'll need boundaries for. This should be available from the Wikiproject country page, in this case: https://www.wikidata.org/wiki/Wikidata:WikiProject_every_politician/Canada

(The provincial legislatures don't seem to be complete there yet, lots of other provinces have one: https://en.wikipedia.org/wiki/Legislative_assemblies_of_Canadian_provinces_and_territories - these need to be completed.)

Clicking through to "all areas" for each legislature there, it looks like we'll need at least:

The only provincial legislature there is Ontario, whose areas are a mix of constituency, electoral district, electoral district of Canada, federal electoral district of Canada and provincial electoral district in Canada. This already makes me think that the Wikidata modelling of those constituencies isn't quite correct, but we should check that by researching a bit about the Legislative Assembly of Ontario. From its Wikipedia page it looks as if the electoral areas are known as "Ridings" and there's no indication that they're of heterogenous types.

We're also considering any city assemblies where the city is over a million people, which we can find from: http://tinyurl.com/yc82bk6c

That mentions:

So we'll need to research what the electoral boundaries are within those too.

Some example OpenStreetMap data availability checks

The place to start when looking for OpenStreetMap boundary data is:

In the table there for Canada, we can see that the proposed admin levels are:

Each of them corresponds to a Global MapIt type of O02 ... O10.

You can query each of those admin levels, restricting it to Canada, and see the results on a map by doing: http://global.mapit.mysociety.org/areas/O04.map.html?country=CA

Note that there are also boundaries in OSM that are tagged with boundary=political if they only have political, not administrative meaning (or something like that). You can see the documentation for boundary=political. The Global MapIt type codes for these subtypes of boundary=political aren't easily predictable, but you can find them here: https://github.com/mysociety/global.mapit.mysociety.org/blob/master/bin/get-boundaries-by-admin-level.py#L40

So I would also go through each of these types, with the country restriction, e.g.

... although most of them aren't going to apply.

Whole country

The whole country looks fine: http://global.mapit.mysociety.org/area/958715.html

Provinces

It looks from here as if a few provinces are missing, namely:

However, boundaries aren't included in Global MapIt if they're unclosed - e.g. if there's even a tiny part of the boundary missing, so for higher level administrative areas (where they're very likely to have the country code set on the boundary relations / ways) you can also check that in Overpass Turbo, and indeed, those boundaries do exist, and we could extract them as GeoJSON from Overpass Turbo:

https://overpass-turbo.eu/s/tEN

Overal plan / still to do

crowbot commented 6 years ago

Adding a note that OpenNorth has some boundary files with their associated licenses at https://github.com/opennorth/represent-canada-data - "Open North has permission to redistribute all shapefiles in this repository. Please read the overall license and the LICENSE.txt file in each directory to know your rights. In some cases, you will not have permission to redistribute the shapefile."

jukesie commented 6 years ago

@mhl this is great - really useful. As for the Administrative levels it was what was used on Wikipedia and the OKFN Index thing to describe them so I just used that...

dracos commented 6 years ago

"It looks from here as if a few provinces are missing" - they are all there, just your browser will take quite a long time to draw their boundaries (or depending when you wrote that it was only showing 200 boundaries on the map and there are a lot of "NU"s) :)

Here's my summary. By "open" I mean it looks like to be an attribution license of some sort, but each one would need individually confirming.

All the below (apart from Senate) are single member areas.

Canada

Provinces

Territories

Self autonomous regions

Cities >1m people

crowbot commented 6 years ago

Prepare Canada data for 19th December deadline

ajparsons commented 6 years ago

Cities boundary data

Missing OCDs for Vancouver and Surrey

Working sheet