Skip to main content

A suite of standardized data structure and pipeline for city data engineering

Project description


UDL (UrbanDataLayer) is a suite of standard data structure and pipeline for city data engineering, which processes city data from various raw data into a unified data format.

UDL is featured for:

  • Unified standardized formats for city data: five data layers (grid, graph, point, polygon and linestring).
  • User-friendly APIs of data processing: scheme transformation, granularity alignment and feature fusion.

Usage

  1. Install Python >= 3.8. For convenience, execute the following command.
pip install udlayer
  1. Construct a UDL layer data. The full layer data formats and data processing APIs are available in the documentation.
# Example: Construct a polygon layer data from a geojson file
from udlayer.layer.polygonlayer import PolygonLayer

polygonlayer = PolygonLayer("Vermont", "sample_Vermont.geojson", year=2014, column_list=['tag'])
print(polygonlayer.data)

# Example: Transform a tiff file to a grid layer data
from udlayer.transformation.transformation import *
from udlayer.alignment.alignment import *
from udlayer.utils.utility import *

griddata = tif_to_grid("pm2.5", ["Shanghai_pm2.5.tif"], start_lat=30.975, start_lon=121.1, end_lat=31.514, end_lon=121.804, year=2014)
print(griddata.data)
  1. Transform between different data layers.
# Example: Transform a polygon layer to a graph layer
from udlayer.transformation.transformation import *

with open('sample_Vermont.pickle', 'rb') as f:
    polygon = pickle.load(f)
graph_data = polygon_to_graph(polygon)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

udlayer-0.2.3.tar.gz (17.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page