mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

UK: no elections listed when I search a postcode #973

Closed Bjwebb closed 7 years ago

Bjwebb commented 7 years ago

What I did: Type a postcode "CB2 1BY" into the search box.

What I got: Just a list of areas image

What I expected: The information on these pages (or links to them): https://candidates.democracyclub.org.uk/election/local.cambridgeshire.2017-05-04/post/CED:market/market https://candidates.democracyclub.org.uk/election/mayor.cambridgeshire-and-peterborough.2017-05-04/post/cambridgeshire-and-peterborough/cambridgeshire-and-peterborough-combined-authority

jf1 commented 7 years ago

I noticed similar when searching for M328AA - the only results shown are the MTW and WMC (not relevant this year) and the results don't show the GMCA Mayor (a live election).

Additionally, I've just searched for Manchester then Greater Manchester and it only tried to match on candidate names - perhaps first check if the search term matches a high-level Nominatim UK place name?

The only reliable and quick way I've come up with for finding the GM Mayoral election is to enter a candidate name that I already know, but obviously this option isn't available to most people searching for info about candidate names.

mhl commented 7 years ago

(Here's a little triage, but I'm only a vaguely aware of how @symroe is handling all these new elections, so this is all a bit superficial.)

That postcode is used for this MapIt query: http://mapit.democracyclub.org.uk/postcode/cb21by

That only returns areas of type: CED, CTY, DIS, DIW, EUR, WMC, WMP, EUP and PDG.

However, the elections you're expecting to be returned have different AreaTypes associated with them:

The only one of those that can work with the code as it ias at the moment is CED. That causes a lookup for an area with identifier unit_id:1277 (formed from format_code_from_area) and type CED. There's no such Area, though - those with type CED are: https://gist.github.com/mhl/f04d0930a9b506283adf18438be6a438

So it looks like there might be multiple things going wrong here :(

symroe commented 7 years ago

See: utter fury at OS for not making this data open until after the election.

Also, I plan to use everyelection to do lookups, I've just not got around to it yet :-\

On Wed, 22 Feb 2017, 18:43 Mark Longair, notifications@github.com wrote:

(Here's a little triage, but I'm only a vaguely aware of how @symroe https://github.com/symroe is handling all these new elections, so this is all a bit superficial.)

That postcode is used for this MapIt query: http://mapit.democracyclub.org.uk/postcode/cb21by

That only returns areas of type: CED, CTY, DIS, DIW, EUR, WMC, WMP, EUP and PDG.

However, the elections you're expecting to be returned have different AreaTypes associated with them:

  • local.cambridgeshire.2017-05-04 has area types with names 'CED' and one that I assume is an error since its name is: ''
  • mayor.cambridgeshire-and-peterborough.2017-05-04 has one area type with name 'combined-authority'

The only one of those that can work with the code as it ias at the moment is CED. That causes a lookup for an area with identifier unit_id:1277 (formed from format_code_from_area) and type CED. There's no such Area, though - those with type CED are: https://gist.github.com/mhl/f04d0930a9b506283adf18438be6a438

So it looks like there might be multiple things going wrong here :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mysociety/yournextrepresentative/issues/973#issuecomment-281762004, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOymQF7o2B43ejrdD_lKIHT1DYssVBfks5rfIHPgaJpZM4MI1bp .

jf1 commented 7 years ago

From memory, CEDs aren't straightforward wrt unique identifiers. CAs are, and their boundary data is available here

symroe commented 7 years ago

I've deployed a change to the lookup code in the DC fork that uses our election service to lookup elections. That service has the new boundaries in, so we're able to return results for the missing elections now :)

andylolz commented 7 years ago

Looks fixed for the reported postcode: https://candidates.democracyclub.org.uk/search?q=CB2+1BY

mhl commented 7 years ago

I don't know why this says that I reopened this. I suppose I might have clicked "reopen" by accident, but I certainly didn't intend to!