colouring-cities / colouring-core

The Core Platform for the Colouring Cities Research Programme (CCRP)
https://colouringcities.org
GNU General Public License v3.0
48 stars 42 forks source link

Reorder Land Use options #1194

Closed mdsimpson42 closed 8 months ago

mdsimpson42 commented 1 year ago

Connected to (#1149)

Reorder the options that pop up to Autofill "Current land use(s)" (under "Specific Land Use" on the "Land Use" category), as follows:

Residential, Residential garden buildings, Hotels Boarding Houses and Guest Houses, Residential Institutions, Unclassified presumed residential, Shops, financial and professional services, Manufacturing, Offices, Storage, Wholesale distribution, Restaurants and cafes, Bars and Nightclubs, Medical/Health Services, Places of worship, Community services, Amusement and show places, Sports facilities and grounds, Other outdoor amenities/open spaces, Libraries Museums and galleries, Holiday Parks and Camps, Allotments and farms, Transport, tracks and ways, Transport- terminals and interchanges, Car Parks, Vehicle storage (private), Goods and fright terminals, Waterways, Post and telecommunications, Water Storage and treatment, Energy production and distribution, Refuse disposal, Defence, Cemeteries and Cremetoria, Agriculture, Mineral working, Fisheries.

mdsimpson42 commented 1 year ago

I'm not sure how to do this (just as I couldn't solve colouring-cities/colouring-london#157).

There is some code in "api/services/autofill.ts" that queries the database, but I'm not sure how to edit how the text is displayed (#1149) or how to change the order to the specific order stated above.

It should be relatively easy to rank the options by ID or alphabetically, for example, but specifying the order as above is more complicated. Perhaps we could assign a priority/index value to the table in the database and sort using that instead.

[Will come back to this later, focussing on high-priority tasks]

polly64 commented 1 year ago

@matkoniecz any thoughts on this one? @mdsimpson42 could you also kindly activate the domestic/non-domestic? question in land use

mdsimpson42 commented 1 year ago

So, the land uses appear in the same order on the form that they are stored in the database. I can easily, for example, order them by 'description' so they appear in alphabetical order.

Getting them into the order above is more difficult. The values are added in a mixture of different files, so there isn't a single one that I can edit to fix the problem. I could create a script to drop the data from the database and then re-add them in the correct order.

Also, there are some elements listed above that are not in the database (there's no "Residential" or "Residential garden buildings", for example, only "Residential Institutions").

There is a partial list in this file (with others added in other files) https://github.com/colouring-cities/colouring-core/blob/master/migrations/015.bulk_data_sources.up.sql


Is there a list of all these land use options (including the U0XX IDs)? Preferably in a spreadsheet so we can get them in the correct order?