mysociety / mapit.mysociety.org

A Django project for running mySociety's main instance of MapIt for the UK
http://mapit.mysociety.org
Other
6 stars 2 forks source link

NHS2020 import #115

Closed ajparsons closed 4 years ago

ajparsons commented 4 years ago

@dracos: I've a few questions about a mapit import.

I'd like to import the 2020 CCG boundaries.

The current set of boundaries have a NHSE code, not a GSS code (the 2020 shapefile has a GSS code): https://mapit.mysociety.org/area/148891.html

As I understand it, this means that it will import unchanged boundaries again. Below I leave the old ones in an inactive generation, but is there a better way to handle this?

Also, are these import steps right:

# create new generation
./manage.py mapit_generation_create --commit --desc "2020 NHS CCGs"

# import CCG2020 boundaries
./manage.py mapit_import 2020path.shp --area_type_code CCG --name_type_code S --name_field CCG20NM --code_type gss --code_field CCG20CD --generation_id 40 --country_code E --commit 

# promote non-ccg boundaries
./manage.py  mapit_generation_raise_on_current_areas --type CPW

# and so on for CPW, EUP, HOC, HOL, LAE, LAS, OLF, OLG, OMF, OMG, SPA, WAS, SHB, WLH
# not CCG - is there a better way of doing this?

#activate new generation
/manage.py mapit_generation_activate --commit
dracos commented 4 years ago

Someone coincidentally emailed mapit about this a few days ago. I guess the better way would be to assign the GSS codes to the existing areas (if that makes sense?) and then it could match on them presumably. But meh, it's only a few areas isn't it. "is there a better way of doing this?" - my mapit_UK_add_2020_structural_changes.py included a raise_generation_on_everything_else, but other than doing something similar; you could have a loop through area types I guess.

dracos commented 4 years ago
python manage.py mapit_import ~matthew/nhs2020/England/Clinical_Commissioning_Groups__April_2020__EN_BFC_V2.shp \
        --generation_id 40 --country_code E --area_type_code CCG \
        --name_type_code nhse --name_field ccg20nm \
        --code_field ccg20cd --code_type gss --commit

python manage.py mapit_import ~matthew/nhs2020/NI/dohTrustBoundary.shp \
        --generation_id 40 --country_code N --area_type_code NIHT \
        --name_type_code nhsw --name_field TrustName \
        --code_field TrustCode --code_type osni_oid --commit

python manage.py mapit_import ~matthew/nhs2020/Scotland/SG_NHS_HealthBoards_2019.shp \
        --generation_id 40 --country_code S --area_type_code SHB \
        --name_type_code nhss --name_field HBName \
        --code_field HBCode --code_type nhss --commit

python manage.py mapit_import ~matthew/nhs2020/Wales/Local_Health_Boards__April_2019__Boundaries_WA_BFC.shp \
        --generation_id 40 --country_code W --area_type_code WLHB \
        --name_type_code hscni --name_field lhb19nm \
        --code_field lhb19cd --code_type nhsw --commit