Skip to main content
Glama
meta.json3.49 kB
{"job_config":{"name":null,"steps":[{"type":"udf","name":null,"metadata":null,"ignore_chunk_error":false,"udf":{"name":"yearly_crime_amount","type":"geopandas_v2","headers":[],"metadata":{"fused:mcp":{"description":"\nThe User-Defined Function (UDF) 'yearly_crime_per_category' is designed to perform a geo-statistical analysis of crime data for a specific area within Vancouver based on the geographical coordinates provided. The function calculates the total number of crimes committed yearly since a specified year up to the current year within a specific radius of the given coordinates.\n\nInput Parameters:\nThe function takes four parameters: 'up_to_year', 'lat', 'lon', and 'buffer_amount'. \n1. 'up_to_year': This integer value specifies the year since when the analysis should be performed up till the current year. The default value is set at 2021. \n2. 'lat' and 'lon': These float values define the geographical coordinates of the area of interest, specifically, latitude('lat') and longitude('lon'). These values are set to default to a location in Vancouver city, but must be redefined by the users according to the area for which data analysis is to be done. \n3. 'buffer_amount': This float value represents the radius (in meters) around the defined coordinate position within which the crime data analysis would be calculated. The buffer amount defaults to 1000 meters.\n\nFunctionality and Output: \nThe function reads the crime data CSV files from an S3 bucket path for each year, starting from the specified 'up_to_year' to the current year. It then processes and clips the dataset according to the location and buffer amount parameter precisely. \nAfterward, it performs a grouped statistical analysis based on various crime categories, calculates the total number of crimes, and returns progressive data about the yearly crime rates and their respective categories within the specified location buffer.\n\nTechnical Details and Limitations:\n1. This UDF operates by using several specialized libraries including 'pandas', 'geopandas', 'shapely', and datetime. It converts CSV data into geospatial data, and then adjusts the coordinate system for accurate buffer calculations. It uses spatial join operations to select the relevant data within the area of interest.\n2. The function assumes the availability of the requisite crime data CSV files for all the years from the given 'up_to_year' up till the current year at the specified S3 path.\n3. The accuracy of the function heavily depends on the quality, detail, and format of the input CSV files, as well as the appropriateness and correctness of the provided geographical parameters.\n4. The function analyzes the crime data per year. Thus, if a wide range 'up_to_year' is given, the function can take a substantial amount of time due to the large amount of data processing involved.\n\nBy carefully considering the input parameters and limitations, the 'yearly_crime_per_category' UDF proves to be a powerful tool in performing progressive geo-analysis of crime data based on geographical coordinates.\n","parameters":[{"name":"up_to_year","type":"int"},{"name":"lat","type":"float"},{"name":"lon","type":"float"},{"name":"buffer_amount","type":"float"}]},"fused:slug":"yearly_crime_amount","fused:name":"yearly_crime_amount"},"table_schema":null,"entrypoint":"yearly_crime_amount","cache_max_age":null,"parameters":{},"original_headers":"","source":"yearly_crime_amount.py"},"input":null}],"metadata":null}}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fusedio/fused-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server