Skip to main content

UK Police Crime Report

Page/Section: Module-UKPolice-Overview

The UK Police Crime Report module displays crime information for a selected date and location ID. Users enter the required values and click Submit to view recorded crime incidents for that specific area. The module presents the results in a structured, sortable table that supports pagination and column ordering.

The layout is designed for clarity, ensuring users can quickly interpret crime patterns and navigate through available records.


UI Input Fields

Page/Section: Module-UKPolice-Inputs

The module includes two required form fields:

  • Date*
    A calendar-style selector in YYYY-MM format.
    This value determines which month’s crime data will be displayed.

  • Location ID*
    A numeric identifier that corresponds to a geographic point.
    The selected value determines the area for which the crime records will be shown.


Location Name Dropdown

Page/Section: Module-UKPolice-LocationDropdown

Next to the Location ID field, the module provides a Location Name dropdown to simplify selection. This dropdown contains user-friendly street labels such as:

  • On or near Campbell Street
  • On or near Roman Street
  • On or near Marquis Street
  • On or near King William Street

Selecting an item from this dropdown automatically populates the Location ID field with its corresponding numeric identifier. The dropdown is designed for convenience, while the filtering is still driven entirely by the numeric Location ID.


Response Mapping

Page/Section: Module-UKPolice-Mapping

When results are loaded, each record is mapped into standardized table fields, including:

  • Crime ID
  • Persistent ID
  • Category
  • Month
  • Location Type
  • Latitude
  • Longitude
  • Street ID
  • Street Name
  • Outcome Category
  • Outcome Date
  • Context

These fields allow consistent presentation, sorting, and filtering across locations and dates.


Example JSON Output

Page/Section: Module-UKPolice-ExampleResponse

Below is an example dataset that appears in the UI after selecting:

  • Date: 2024-01
  • Location ID: 1738842
[
{
"crime_id": 116208998,
"persistent_id": "",
"category": "anti-social-behaviour",
"month": "2024-01",
"location_type": "Force",
"latitude": "52.632805",
"longitude": "-1.124819",
"street_id": 1738842,
"street_name": "On or near Campbell Street",
"outcome_category": null,
"outcome_date": null,
"context": ""
}
]

(Additional records continue with the same format.)


Table Rendering Behavior

Page/Section: Module-UKPolice-Table

Once populated, the results table displays a list of crimes matching the selected input criteria. Key features include:

  • Sortable columns for quick data inspection
  • Pagination controls for navigating long lists
  • Responsive layout for easy viewing across screen sizes

If no matching crimes exist, the table displays:
“No available options.”


Error Handling

Page/Section: Module-UKPolice-ErrorHandling

The module provides user-friendly messages when:

  • Required fields are missing
  • Invalid date formats are entered
  • No matching records exist for the chosen filters
  • A temporary issue occurs while loading the results

These messages help guide the user toward resolving the issue and successfully retrieving the information needed.