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

Wrong dates for some bins - Fixed offset calculations dont work for every address #1061

Open
4 tasks done
PythonPi opened this issue Dec 1, 2024 · 0 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@PythonPi
Copy link

PythonPi commented Dec 1, 2024

Name of Council

Cheltenham Borough Council

Issue Information

Not all postcodes follow the same pattern for bin collection days as the example originally given. As such, the fixed offset calculations which work for the example address do not work for all addresses.

Examples of a few patterns of collection dates below, including original example.

GL51 3NA (Original example)

Type Day Week
Refuse Fri 2
Food Fri Weekly
Recycling Fri 1
Garden Fri 1

GL53 8JL

Type Day Week
Refuse Wed 2
Food Wed Weekly
Recycling Wed 1
Garden Wed 2

GL52 3JB

Type Day Week
Refuse Wed 2
Food Wed Weekly
Recycling Wed 1
Garden Tue 1

Possible fix

The following sequence of API calls would return the schedule for an address.

Request session ID

https://maps.cheltenham.gov.uk/map/Aurora.svc/RequestSession?userName=guest+CBC&password=&script=%5CAurora%5CCBC+Waste+Streets.AuroraScript%24
Returns JSON with SessionID inside Session object

Request tasks

https://maps.cheltenham.gov.uk/map/Aurora.svc/GetWorkflow?sessionId=<session_id>&workflowId=wastestreet
Returns JSON of Tasks, including task of type StatMap.Aurora.FetchResultSetTask, StatMapService. The ID field from here is required later.

Find address

Find location ID + X/Y coords from postcode/house number
https://maps.cheltenham.gov.uk/map/Aurora.svc/FindLocation?sessionId=<session_id>&address=<postcode>&limit=1
You can optionally set the locationId to a specific location ID from the response JSON to confirm a specific address.
The above would return the following JSON

{
    "Error": null,
    "InProgress": false,
    "OperationId": "00000000-0000-0000-0000-000000000000",
    "ProgressMessage": null,
    "ProgressRatio": null,
    "StartTime": null,
    "SubmissionTime": null,
    "Locations": [
        {
            "Description": "FLAT ELLERSLIE ALBERT ROAD CHELTENHAM CHELTENHAM GL52 3JB",
            "Details": null,
            "Geometry": null,
            "Id": "5213",
            "X": 395564,
            "Y": 223658
        }
    ],
    "TotalHits": 10
}

Get details for address

This is where you need the task ID from the workflow query above. Also the X and Y from the response to the previous call
https://maps.cheltenham.gov.uk/map/Aurora.svc/ExecuteTaskJob?sessionId=<session_id>&taskId=<task_id>&job=%7B%22QueryX%22:<x_coord>,%22QueryY%22:<y_coord>%7D
This returns a large JSON with all the result details in.
Collection date details are under AlphabeticalExportSet->ResultSet->Tables.
Details are split between ColumnDefinitions and Records. ResolvedRecords appears to contain the compiled text which is pushed into the web view. There is a USRN in here, but no UPRN. There are house numbers here for verification. This contains the Week-1/Week-2 dates for the address, along with which day of week that addresses bins get collected.

Verification

  • I searched for similar issues at https://github.com/robbrad/UKBinCollectionData/issues?q=is:issue and found no duplicates
  • I have checked my address/postcode/UPRN works on the council's website
  • I have provided a detailed explanation of the issue as well as steps to replicate the issue
  • I understand that this project is run by volunteer contributors therefore completion of this issue cannot be guaranteed
@PythonPi PythonPi added the bug Something isn't working label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant