CodeforAustralia / school-finder

:eyes: Find schools by location
https://education.nsw.gov.au/school-finder
GNU General Public License v3.0
17 stars 7 forks source link

distance school option broken in nearby schools map control #294

Closed techieshark closed 7 years ago

techieshark commented 7 years ago

image

When distance school selected, we get a Carto/Postgres error response and map is not updated to show distance schools.

Fixing this appears to require a change to the database.


If I run a query of all schools with 'distance' in their name, I can see that we have no good way to filter distance schools:

SELECT school_name, school_specialty_type, distance_education FROM dec_schools where school_name ~* '.*distance.*'

screen shot 2016-11-27 at 8 21 16 pm

The distance education field is confusing (#40) and last we talked about this, we were going to fix that. And because a "normal" school can have a distance education center, the school_specialty_type field won't help us (see also: #57).


Action needed: update the data so the distance_education field is one of No, School, or Centre.

Rustuma commented 7 years ago

That would be a data import error. I'll get @reekypete on to it. The flags should be "C" for Centre and "S" for School. Some schools have a DE centre and others are the whole school.

techieshark commented 7 years ago

Thanks @Rustuma -- and is it "N" for "No" (this school is not any kind of distance school)?

Rustuma commented 7 years ago

Correct

techieshark commented 7 years ago

Cool - I think the change above should do the trick after the database is updated. I've uploaded it so @reekypete can try it out as he's changing the database if he wants.

Rustuma commented 7 years ago

I'm waiting for @reekypete to make the change to the upload. Should be within the next hour

reekypete commented 7 years ago

I've had to use "N/A" instead of "N" to signify "No".

This is due to a bug in the Carto API - basically Carto tries to guess the data type of each field in a CSV upload. Since almost ALL of the data in distance_education was "N", Carto kept creating an upload table with a boolean data type for distance_education

techieshark commented 7 years ago

Thanks for the clarification!