Fused Python User Defined Functions (UDFs)

repository·main·Indexed 42 days ago

https://github.com/fusedio/udfs

A collection of serverless Python building blocks that convert functions into live HTTP endpoints. These UDFs enable data platforms to interface via a managed API and include specialized tools for geospatial analysis, such as Overture Maps data retrieval, Sentinel 2 satellite imaging, H3 hexagonal indexing, and Copernicus 30m DEM elevation data. They can be executed in Jupyter Notebooks using the `fused` SDK via `fused.load()` and `fused.run()`.

Tokens
19.5K
Snippets
42
Records
170
Agent score
54%

What's inside Fused Python UDFs

  1. Overview of common UDF utilities

    main
    The public/common package contains shared utility functions and components used across various public User Defined Functions (UDFs) within the Fused ecosystem. This package is intended to provide standardized helper logic to ensure consistency across different UDF implementations.
  2. Overview of Crop Mask Zonal Statistics UDF

    main

    The Crop_Mask_Zonal_Statistics UDF calculates Solar-Induced Fluorescence (SIF) data for U.S. counties. It uses USDA Cropland Data Layers to mask NetCDF data with GeoTiff files, allowing for crop-specific insights.

    Key capabilities include:

    • Computing SIF metrics (sums, means, and ratios) for specific crops (e.g., corn) and non-crop areas.
    • Customizing temporal and spatial parameters such as year, month, period, and county FIPS codes.
    • Outputting a GeoDataFrame containing detailed, spatially-referenced statistics.

    This UDF is suitable for crop yield prediction, drought monitoring, and agricultural planning.

  3. Overview of Simple Trips Simulation UDF

    main

    The Simple_Trips_Gen_Lima UDF is a tool designed for urban planning simulations. It models trips by leveraging real-world population density, zoning data, and road networks.

    Users can provide parameters such as:

    • Trip schedules
    • Origins
    • Destinations

    The tool then calculates travel paths to help inform infrastructure decisions like transit route optimization or road network impact assessments. It is built using GeoPandas and OSMnx.

  4. Overview of Vegetation Segmentation UDF

    main
    This User Defined Function (UDF) provides scalable vegetation analysis using classical computer vision techniques rather than machine learning models. It enables real-time global vegetation segmentation by allowing users to select specific vegetation indices and set threshold values to process satellite imagery dynamically.
  5. Overview of the Invasive Species Hotspot UDF

    main

    The Invasive Species Hotspot UDF identifies geographic areas where Arundo donax is likely to spread. It achieves this by modeling the relationship between built-environment factors and species susceptibility using Overture Maps data.

    The model calculates a weighted sum based on the proximity to the following Overture data classes:

    • Golf Courses
    • Bridges
    • Water bodies (e.g., rivers, streams)

    Workflow Logic:

    1. Retrieves Overture maps datasets via get_overture to create GeoDataFrames.
    2. Generates H3 scores based on spatial buffers around each identified feature.
    3. Aggregates these H3 scores into a final weighted sum to map the hotspots.
  6. Overview of Power Plants H3 UDF

    main

    This UDF aggregates data from the Global Power Plant Database using dynamic H3 levels that adjust based on the zoom level. It is designed for spatial analysis of energy infrastructure using H3 hexagonal indexing and DuckDB.

    Recommended Usage: Use a light base map for visualization. You can adjust the map opacity within the Visualize tab of the interface.

  7. Overview of Zonal Stats Forest Observations - viewer

    main

    The Zonal Stats Forest Observations - viewer UDF is a visualization tool designed to display the results of a zonal statistics workflow for global forest cover.

    It takes a table containing aggregates of a global forest cover raster across municipal zones (defined by a vector table) and processes it for map rendering. The UDF functions as a 'tile UDF', meaning it clips the output table to fit within specific tile bounds and renders the data as a choropleth map. The map uses color intensity (ranging from 0 to 1) within municipality polygons to represent the average forest cover values.

  8. Overview of Placekey DOL Violations NPI UDF

    main
    This User Defined Function (UDF) uses Placekey to merge two specific datasets: the National Provider Identifier (NPI) dataset and the Department of Labor (DOL) Wage and Hour Compliance Dataset. It is designed to facilitate data joining between provider identifiers and labor compliance records using Placekey's spatial/identity matching capabilities.
  9. Overview of DEM_Tile_Hexify UDF

    main
    The DEM_Tile_Hexify UDF is designed to dynamically convert terrain TIFF tiles into an H3 grid. It aggregates raster values (using either sum or mean methods) for H3 hexagonal cells. The resolution of the H3 grid is determined by the zoom level. This UDF is useful for processing terrain data from various global sources such as ArcticDEM, Copernicus, NOAA's ETOPO1, and USGS 3DEP.