Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore adding geo codes and maps #2297

Closed
AnnCorp opened this issue Jan 31, 2018 · 23 comments
Closed

Explore adding geo codes and maps #2297

AnnCorp opened this issue Jan 31, 2018 · 23 comments

Comments

@AnnCorp
Copy link
Contributor

AnnCorp commented Jan 31, 2018

Brock Fanning in the US has been developing some proof of concepts for adding maps - see ticket
https://github.com/GSA/sdg-indicators/issues/858 and proof of concept (using D3) http://brock.tips/sdg-indicators/8-1-1/.
Keen to explore how much of this work we could reuse as is and what further developments would be needed to add maps? (Assuming add some kind of 'Maps' table to the side of charts and tables?)
Two suggested indicators could use for proof of concept are
3.2.2 https://sustainabledevelopment-uk.github.io/3-2-2/ and
11.6.2 https://sustainabledevelopment-uk.github.io/11-6-2/
ONS Geography have confirmed it would be good practice for us to add the 9-digit geo codes to our data files.
Need to discuss requirements in more detail with Mango team re what we could do and then breakdown into smaller github tickets.
Some initial suggested steps:
(1) will be for us to have test data files with the 9-digit GSS codes included - may alraedy have these for 3.2.2 and 11.6.2
(2) explore what changes needed re having these codes - presume would not want codes displayed in data filtering options, though would want them in the indicator .csv files (inlcude in filtered .csv or not?)
(3) explore how display maps for these 2 indicators
Chris Gale in ONS Geography would be able to provide advice on best practive etc with the maps and the geoportal is a good resource re boundaries etc http://geoportal.statistics.gov.uk/.

@AnnCorp
Copy link
Contributor Author

AnnCorp commented Feb 1, 2018

@AnnCorp
Copy link
Contributor Author

AnnCorp commented Feb 1, 2018

http://geoportal.statistics.gov.uk/
This is the where to find ONS Geography info on boundaries, maps, register of geographic codes etc

@AnnCorp AnnCorp changed the title Explore adding maps Explore adding geo codes and maps Feb 5, 2018
@AnnCorp
Copy link
Contributor Author

AnnCorp commented Feb 5, 2018

@MaxEngledewAdmin please could you attach to this issue data files for 3.2.2 and 11.6.2 with geo codes added? Would the ones Graham did still be valid or have any other parts of the data for these indicators been updated more recently. Thank you!

@D-Cobbledick
Copy link
Contributor

3.2.2 CSV GeoCode.xlsx
11.6.2 CSV GeoCode.xlsx

Hi Ann,

Geocodes for indicators 3.2.2 and 11.6.2 in files attached.

For 11.6.2, I've had to make some best fit assumptions which I've highlighted. These have been taken from my current list of GeoCodes in tab 2.

Please let me know if you need anything else,

Regards,

David

@D-Cobbledick
Copy link
Contributor

3.2.2 CSV GeoCode.xlsx

  • Corrected - now containing 'Year' column...

@dougmet
Copy link
Contributor

dougmet commented Feb 13, 2018

Hi, this is really interesting. So we can have another protected column (so far we have Year, Units, and Value) called GeoCode which is not displayed on normal plots but does form the basis for a map.

We'd need:

  1. Build step to make sure they are valid codes
  2. A separate "map" tab
  3. Able to join geocodes to boundary files
  4. Think about how all of this interacts with the filtering

One good thing is that we don't need a separate data file because our format supports extra columns like this.

@brockfanning
Copy link
Collaborator

@dougmet I'd been wondering about item 4 also - how to interact with filtering. It seems like the current filtering could work in a map, if only they used radio buttons instead of checkboxes. Do you think maybe they could be converted to radio buttons only while users are on the Map tab?

@dougmet
Copy link
Contributor

dougmet commented Feb 15, 2018

Yes it's like filtering except that you can only choose one thing. Could work changing to radio buttons. Or perhaps you have to choose one column from the currently selected, with an extra drop-down inside the map pane. So you filter to the ones you're interested in on the chart/table page and then choose them one at a time on the map.

@shaneporter
Copy link
Contributor

Taking a look at that 3.2.2 spreadsheet, I see that the geocode for England and Wales is K04000001. There are different codes for other Geography fields as expected. However, there are a number of different geocodes, K02000001 to K02000024 inclusive, for rows with no Georgraphy field. What do these represent?

Also, there is a lot of repeated data here. Could we not specify a Geography -> Geocode mapping somewhere else? An additional piece of indicator metadata would specify whether there is a map (but couldn't we just do this automatically for everything with a Geography field?

Also, are the geographical regions limited to countries (or groups of countries, such as England and Wales)? May this change?

@shaneporter
Copy link
Contributor

So, from call:

  • Geography is sometimes limited to country (or England and Wales that I've also seen on 3.2.2 for example), but other indicators have/will have Geographies defined by other levels, such as region of UK.

@dougmet
Copy link
Contributor

dougmet commented Mar 6, 2018

@Mengledew
Copy link
Contributor

I think this is the only published indicator with LA breakdown at the moment: Automated Geo-coding - 4.2.1.xlsx. There will definitely be more coming onto the site relatively soon.

@dougmet
Copy link
Contributor

dougmet commented Mar 6, 2018

Thanks Max. The file size (13.1Mb) is a bit of a warning that we may hit the limit of serving all of the data from a single CSV file if we have too many dissaggregations with geocode. My feeling is that in the first instance we breakdown by geocode OR other fields. Down the line when data is served via a service we could have as many breakdowns as we like.

@D-Cobbledick
Copy link
Contributor

Automated Geo-coding - 4.2.1.csv.zip

CSV version of 4.2.1 geo-codes (hidden formula tabs removed). This size (7Mb) should be more representative

@shaneporter
Copy link
Contributor

The CSV is converted to JSON and embedded in the HTML.

This amount of data will cripple the load time, and unless it's loaded on demand, isn't practical at all.

@dougmet
Copy link
Contributor

dougmet commented Mar 6, 2018

Could we not just have one level of dissaggregation at this level of detail? Essentially Year, GeoCode. Then we can show just one map. Otherwise we're going to need to find a whole new way to serve the data.

@dougmet
Copy link
Contributor

dougmet commented Mar 7, 2018

Well this is a bit embarrassing. I did some work to strip off the geocodes so that it only reports the headline. Turns out the file size is about the same as it is in the live site. So we're already at 7Mb (ish)!

Here's an ever-so-slightly smaller csv with the value column at the end.

small-4-2-1.zip

@dougmet dougmet mentioned this issue Mar 8, 2018
@shaneporter
Copy link
Contributor

Thanks. I removed the NA text, and I was good to go.

My thinking for now is that I will detect the presence of a GeoCode column, and dynamically create the 'Map' tab.

At present, the API endpoint is fixed, but this can be changed quite easily when the time comes.

@dougmet
Copy link
Contributor

dougmet commented Mar 13, 2018

Ah, yes that's a bad default. need to remember to set na="". Agree with detecting GeoCode column. Also agree at fixing the end point. Only other option is to use the metadata.

@AnnCorp AnnCorp added the Sprint 13 Starts 22 March label Mar 22, 2018
@AnnCorp
Copy link
Contributor Author

AnnCorp commented Mar 22, 2018

@shaneporter @dougmet from discussions within SDG team and with ONS Geography suggest the following:

  • keep a consistent UK map outline (not GB) for all the maps, as target coverage is UK
  • for bits that are out of scope, make it transparent rather than white, so that there is a clear distinction between where areas are out of scope and where there is missing data
  • use white for missing data but reduce the starkness of the white (240,240,240 rather than 255,255,255)
  • where there is data it should always be a colour, not white so scale would start with palest green
    Once these bits are done and the scale labels are on etc then will send to Geography for them to review.
    If this is on the wrong ticket, please paste across to the individual tickets.Cheers!

@shaneporter
Copy link
Contributor

Thanks for the feedback @AnnCorp. I will get onto the tweaks asap.

@dougmet dougmet added the Geography Related to mapping label Mar 23, 2018
@shaneporter
Copy link
Contributor

shaneporter commented Mar 26, 2018

I think those first two points are covered in #2590.

@AnnCorp
Copy link
Contributor Author

AnnCorp commented Mar 28, 2018

Looks great - happy to close this ticket. Would raise any future enhancements as separate tickets.

@AnnCorp AnnCorp closed this as completed Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants